/*******************************************************************************
* lm_l4if.h - L4 lm interface
******************************************************************************/
#ifndef _LM_L4IF_H
#define _LM_L4IF_H
struct _lm_device_t *pdev);
struct _lm_device_t *pdev);
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
/** Description:
* Parameters
* - mblk: memory block for the virtual memory
* - phy_mblk: memory block for the physical memory
*/
struct _lm_device_t *pdev,
/** Description
* Post buffered data
*/
struct _lm_device_t *pdev,
/** Description
* Init sp_data phys and virt memory for a given tcp state to
* the sp_req_mgr sp_data memory
*/
struct _lm_device_t *pdev,
);
/** Description:
* same space in the memory block (such as doorbell-data)
* Parameters
* - mblk: memory block for the virtual memory
* - phy_mblk: memory block for the physical memory
*/
struct _lm_device_t *pdev,
/* Get the required size for a connections virtual memory
* Parameters:
* - tcp_state: A specific tcp state that the size is requested for. If NULL, then
* the default size is returned
*/
struct _lm_device_t * pdev,
/* Get the required size for a connections physical memory
* Assumptions: Physical memory size is the same for all connections
*/
struct _lm_device_t * pdev);
struct _lm_device_t * pdev,
struct _lm_device_t * pdev,
/* Desciption:
* delete tcp state from lm _except_ from actual freeing of memory.
* the task of freeing of memory is done in lm_tcp_free_tcp_state()
* Assumptions:
* global toe lock is taken by the caller
*/
void lm_tcp_del_tcp_state(
struct _lm_device_t *pdev,
/* Desciption:
* delete path state from lm
* Assumptions:
* global toe lock is taken by the caller
*/
void lm_tcp_del_path_state(
struct _lm_device_t *pdev,
/* Desciption:
* delete neigh state from lm
* Assumptions:
* global toe lock is taken by the caller
*/
void lm_tcp_del_neigh_state(
struct _lm_device_t *pdev,
void lm_tcp_free_tcp_resc(
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
/* initiate offload request completion */
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
struct _lm_device_t *pdev,
);
/** Description
* Returns data that is buffered in the generic buffers to the mm.
* after this function completes, and the data is indicated to the client
* the next function (lm_tcp_rx_buffered_data_indicated) should be called.
* Assumptions:
* - function is called as a result of a call to mm_tcp_rx_indicate_gen
* - return_buf_ctx will be sent to lm_tcp_rx_buffered_data_indicated and to l4_buffer_return
* Returns:
* - LM_STATUS_SUCCESS - buffered data succesfully passed to mm
* - LM_STATUS_FAILURE - no more buffered data
*/
);
/** Description
* Called from the flow of terminate. Returns data that is buffered in the generic buffers
* with no conditions
* Assumptions:
* - function is called as a result of a terminate
* - return_buf_ctx will be sent to l4_buffer_return
*/
);
/** Description
* Called by the mm to notify the result of the indication
* accepted_bytes contains the number of bytes that were accepted by the client. This value can
* be less than the indicated number of bytes. In which case the indication was a partially succesful
* indication
* Assumption:
* - This function is called as a result of a call to mm_tcp_rx_indicate_gen call
* and only after lm_tcp_rx_get_buffered_data was called.
* - return_buf_ctx is the buffer returned to lm_tcp_rx_get_buffered_data
* - accepted_bytes <= indicated number of bytes
*/
struct _lm_device_t * pdev,
);
/** Description
* If connection is still open updates the sws, updates the pending return indications
*/
struct _lm_device_t * pdev,
);
/** Description
* Called:
* 1. when a buffer is returned from a client and the connection is already closed
* 2. when upload_completion returns from the client
* Checks if the connection is dead and can be deleted (depending on state,
* and pending return indications)
* If the call is due to (2), changes the state to UPLOAD_DONE
* 3. when offload completion is proceesed and we service deferred cqes,
* its possible that the connection was uploaded while waiting to the offload completion
* Assumptions:
* SP and Rx locks are taken by the caller
* Return:
* TRUE - if connection can be deleted i.e. state = UPLOAD_DONE,
* and all pending indications returned
* FALSE - o/w
*/
struct _lm_device_t * pdev,
);
#define TCP_IS_DEAD_OP_RTRN_BUFS (0)
/** Description
* checks the state of the connection (POST_BLOCKED or NOT)
* Returns
* SUCCESS - if connection is open
* CONNECTION_CLOSED - if connection is blocked
*/
struct _lm_device_t * pdev,
lm_tcp_con_t * rx_con);
/** Description
* calculates the size of a generic buffer based on min_gen_buf_size and mtu
* this function should be called at init, it does not initialize the lm
* toe_info parameter
* Assumptions:
* mtu and min_gen_buf_size are initialized
* Returns:
* size of generic buffer
*/
/** Description
* extracts the size of a generic buffer from the lmdev
*/
/*********************** TOE RSS ******************************/
/**
* @Description: Update TOE RSS. The origin of this call is when getting
* an OS RSS update. It's actually by L2 interface and not
* L4. However, the ramrods are separate for L4 + L2 due to the
* assumptions by the different protocols of what the data is
* in the indirection table.
*
* @Assumptions: Called BEFORE calling L2
* enable-rss!!
*
* @param pdev
* @param chain_indirection_table - table of TOE RCQ chain values
* @param table_size - size of table above
* table will all point to the same entry
*
* @return lm_status_t - PENDING is completion will arrive asyncrounoulsy
* - SUCCESS if no ramrod is sent (for example table didn't change)
* - FAILURE o/w
*/
/* This functions sets the update window mode. We work in two modes:
* SHORT_LOOP and LONG_LOOP.
* SHORT_LOOP: if generic indication succeeded, the window is update immediately by the accepted bytes
* LONG_LOOP: if generic indication succeeded, the window is updated only when the buffer is returned via l4_return_buffer
*/
/**
* Description:
* - Post a fin request BD in the bd chain
* Returns:
* - SUCCESS - fin request was posted on the BD chain
* - CONNECTION CLOSED- as described in lm_tcp_tx_post_buf()
*/
);
/** Description
* check if there is a pending remote disconnect on the rx connection.
* This function is called from the um, after buffers have been posted. If there is a
* remote disconnect pending, it will be processed.
*/
{
(gen_info->peninsula_nbytes == 0) &&
}
/** Description
* checks whether it is OK to update the tcp state. We only update if the connection
* is not being offload/uploaded/invalidated i.e. normal or aborted.
*/
{
/* a state status is changed to invalidate only after the invalidate is completed, therefore
* to make sure a state isn't in the process of being invalidated we check it's flags to see
* whether an invalidate request has already been posted. */
}
/**
* Description:
* initializes the lm data in a slow path request given the request parameters
*/
void lm_init_sp_req_type (
struct _lm_device_t * pdev,
void * req_input_data);
/**
* Description (for following two functions)
* given the previous tcp state. If tcp_state is NULL, it
* returns the first such tcp_state
* Returns
* tcp_state: if such exists
* NULL: if there are no more tcp states dependent of the
*/
struct _lm_device_t *pdev,
void *path_state,
struct _lm_device_t *pdev,
void * neigh_state,
/**
* Description
* finds the next neigh state following by given the
* previous neigh_state. If neigh_state is NULL, it returns
* the first neigh_state in list of neigh states
* Returns
* neigh_state: if exists
* NULL: if neigh list is empty or no more neigh states in
* the list
*/
struct _lm_device_t *pdev,
/**
* Description
* finds the next path states matched non NULL neigh
* If neigh_state is NULL, it returns the next path state in
* list of path states
* Returns
* path_state: if such exists
* NULL: if there are no more path states dependent of the
* given neigh (in not NULL)
*/
struct _lm_device_t *pdev,
/**
* Description
* finds the next tcp states in list of tcp
*
* Returns
* tcp_state: if such exists
* NULL: if there are no more tcp states in the list
*/
struct _lm_device_t *pdev,
/* GilR 8/22/2006 - TBD - temp implementation, for debugging. to be removed?/wrapped with "#if DBG"? */
void lm_tcp_internal_query(
/**
* Returns the number of entries needed in frag list
* taking into an account the CWnd and MSS
*/
struct _lm_device_t * pdev,
);
/** Description
* function is called whenever the UM allocates more generic buffers
*/
struct _lm_device_t * pdev);
/** Description
* Callback function for cids being recylced
*/
void lm_tcp_recycle_cid_cb(
struct _lm_device_t *pdev,
void *cookie,
struct _lm_device_t *pdev,
struct _lm_device_t *pdev);
lm_tcp_state_t* lm_tcp_find_offloaded_tcp_tuple(struct _lm_device_t * pdev, u8_t src_ip_byte, u8_t src_tcp_b, u8_t dst_tcp_b, lm_tcp_state_t * prev_tcp);
void lm_tcp_rx_clear_isles(struct _lm_device_t * pdev, lm_tcp_state_t * tcp_state, d_list_t * isles_list);
u32_t * pattern_size);
#endif /* _LM_L4IF_H */