drivers/net/ethernet/qlogic/qed/qed_iwarp.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qed/qed_iwarp.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/qlogic/qed/qed_iwarp.h
Extension
.h
Size
5672 bytes
Lines
207
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct qed_iwarp_ll2_buff {
	struct qed_iwarp_ll2_buff *piggy_buf;
	void *data;
	dma_addr_t data_phys_addr;
	u32 buff_size;
};

struct qed_iwarp_ll2_mpa_buf {
	struct list_head list_entry;
	struct qed_iwarp_ll2_buff *ll2_buf;
	struct unaligned_opaque_data data;
	u16 tcp_payload_len;
	u8 placement_offset;
};

/* In some cases a fpdu will arrive with only one byte of the header, in this
 * case the fpdu_length will be partial (contain only higher byte and
 * incomplete bytes will contain the invalid value
 */
#define QED_IWARP_INVALID_INCOMPLETE_BYTES 0xffff

struct qed_iwarp_fpdu {
	struct qed_iwarp_ll2_buff *mpa_buf;
	void *mpa_frag_virt;
	dma_addr_t mpa_frag;
	dma_addr_t pkt_hdr;
	u16 mpa_frag_len;
	u16 fpdu_length;
	u16 incomplete_bytes;
	u8 pkt_hdr_size;
};

struct qed_iwarp_info {
	struct list_head listen_list;	/* qed_iwarp_listener */
	struct list_head ep_list;	/* qed_iwarp_ep */
	struct list_head ep_free_list;	/* pre-allocated ep's */
	struct list_head mpa_buf_list;	/* list of mpa_bufs */
	struct list_head mpa_buf_pending_list;
	spinlock_t iw_lock;	/* for iwarp resources */
	spinlock_t qp_lock;	/* for teardown races */
	u32 rcv_wnd_scale;
	u16 rcv_wnd_size;
	u16 max_mtu;
	u8 mac_addr[ETH_ALEN];
	u8 crc_needed;
	u8 tcp_flags;
	u8 ll2_syn_handle;
	u8 ll2_ooo_handle;
	u8 ll2_mpa_handle;
	u8 peer2peer;
	enum mpa_negotiation_mode mpa_rev;
	enum mpa_rtr_type rtr_type;
	struct qed_iwarp_fpdu *partial_fpdus;
	struct qed_iwarp_ll2_mpa_buf *mpa_bufs;
	u8 *mpa_intermediate_buf;
	u16 max_num_partial_fpdus;
};

enum qed_iwarp_ep_state {
	QED_IWARP_EP_INIT,
	QED_IWARP_EP_MPA_REQ_RCVD,
	QED_IWARP_EP_MPA_OFFLOADED,
	QED_IWARP_EP_ESTABLISHED,
	QED_IWARP_EP_CLOSED
};

union async_output {
	struct iwarp_eqe_data_mpa_async_completion mpa_response;
	struct iwarp_eqe_data_tcp_async_completion mpa_request;
};

#define QED_MAX_PRIV_DATA_LEN (512)
struct qed_iwarp_ep_memory {
	u8 in_pdata[QED_MAX_PRIV_DATA_LEN];
	u8 out_pdata[QED_MAX_PRIV_DATA_LEN];
	union async_output async_output;
};

/* Endpoint structure represents a TCP connection. This connection can be
 * associated with a QP or not (in which case QP==NULL)
 */
struct qed_iwarp_ep {
	struct list_head list_entry;
	struct qed_rdma_qp *qp;
	struct qed_iwarp_ep_memory *ep_buffer_virt;
	dma_addr_t ep_buffer_phys;
	enum qed_iwarp_ep_state state;
	int sig;
	struct qed_iwarp_cm_info cm_info;
	enum tcp_connect_mode connect_mode;

Annotation

Implementation Notes