1 From a7cbf4fabd46b0d02b651f5defac754e56e11e0e Mon Sep 17 00:00:00 2001
2 From: Leyi Rong <leyi.rong@intel.com>
3 Date: Wed, 8 Apr 2020 14:22:00 +0800
4 Subject: [DPDK 07/17] net/iavf: flexible Rx descriptor definitions
6 Add definitions for flexible Rx descriptor structures and macros.
8 Signed-off-by: Leyi Rong <leyi.rong@intel.com>
10 drivers/net/iavf/iavf_rxtx.h | 200 +++++++++++++++++++++++++++++++++++
11 1 file changed, 200 insertions(+)
13 diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
14 index 09b5bd99e..5e309631e 100644
15 --- a/drivers/net/iavf/iavf_rxtx.h
16 +++ b/drivers/net/iavf/iavf_rxtx.h
17 @@ -157,6 +157,206 @@ union iavf_tx_offload {
21 +/* Rx Flex Descriptors
22 + * These descriptors are used instead of the legacy version descriptors
24 +union iavf_16b_rx_flex_desc {
26 + __le64 pkt_addr; /* Packet buffer address */
27 + __le64 hdr_addr; /* Header buffer address */
28 + /* bit 0 of hdr_addr is DD bit */
32 + u8 rxdid; /* descriptor builder profile ID */
33 + u8 mir_id_umb_cast; /* mirror=[5:0], umb=[7:6] */
34 + __le16 ptype_flex_flags0; /* ptype=[9:0], ff0=[15:10] */
35 + __le16 pkt_len; /* [15:14] are reserved */
36 + __le16 hdr_len_sph_flex_flags1; /* header=[10:0] */
38 + /* ff1/ext=[15:12] */
41 + __le16 status_error0;
45 + } wb; /* writeback */
48 +union iavf_32b_rx_flex_desc {
50 + __le64 pkt_addr; /* Packet buffer address */
51 + __le64 hdr_addr; /* Header buffer address */
52 + /* bit 0 of hdr_addr is DD bit */
58 + u8 rxdid; /* descriptor builder profile ID */
59 + u8 mir_id_umb_cast; /* mirror=[5:0], umb=[7:6] */
60 + __le16 ptype_flex_flags0; /* ptype=[9:0], ff0=[15:10] */
61 + __le16 pkt_len; /* [15:14] are reserved */
62 + __le16 hdr_len_sph_flex_flags1; /* header=[10:0] */
64 + /* ff1/ext=[15:12] */
67 + __le16 status_error0;
73 + __le16 status_error1;
89 + } wb; /* writeback */
92 +/* Rx Flex Descriptor for Comms Package Profile
93 + * RxDID Profile ID 16-21
94 + * Flex-field 0: RSS hash lower 16-bits
95 + * Flex-field 1: RSS hash upper 16-bits
96 + * Flex-field 2: Flow ID lower 16-bits
97 + * Flex-field 3: Flow ID upper 16-bits
98 + * Flex-field 4: AUX0
99 + * Flex-field 5: AUX1
101 +struct iavf_32b_rx_flex_desc_comms {
104 + u8 mir_id_umb_cast;
105 + __le16 ptype_flexi_flags0;
107 + __le16 hdr_len_sph_flex_flags1;
110 + __le16 status_error0;
115 + __le16 status_error1;
132 +/* Rx Flex Descriptor for Comms Package Profile
133 + * RxDID Profile ID 22-23 (swap Hash and FlowID)
134 + * Flex-field 0: Flow ID lower 16-bits
135 + * Flex-field 1: Flow ID upper 16-bits
136 + * Flex-field 2: RSS hash lower 16-bits
137 + * Flex-field 3: RSS hash upper 16-bits
138 + * Flex-field 4: AUX0
139 + * Flex-field 5: AUX1
141 +struct iavf_32b_rx_flex_desc_comms_ovs {
144 + u8 mir_id_umb_cast;
145 + __le16 ptype_flexi_flags0;
147 + __le16 hdr_len_sph_flex_flags1;
150 + __le16 status_error0;
155 + __le16 status_error1;
172 +/* Receive Flex Descriptor profile IDs: There are a total
173 + * of 64 profiles where profile IDs 0/1 are for legacy; and
174 + * profiles 2-63 are flex profiles that can be programmed
175 + * with a specific metadata (profile 7 reserved for HW)
178 + IAVF_RXDID_LEGACY_0 = 0,
179 + IAVF_RXDID_LEGACY_1 = 1,
180 + IAVF_RXDID_FLEX_NIC = 2,
181 + IAVF_RXDID_FLEX_NIC_2 = 6,
183 + IAVF_RXDID_COMMS_GENERIC = 16,
184 + IAVF_RXDID_COMMS_AUX_VLAN = 17,
185 + IAVF_RXDID_COMMS_AUX_IPV4 = 18,
186 + IAVF_RXDID_COMMS_AUX_IPV6 = 19,
187 + IAVF_RXDID_COMMS_AUX_IPV6_FLOW = 20,
188 + IAVF_RXDID_COMMS_AUX_TCP = 21,
189 + IAVF_RXDID_COMMS_OVS_1 = 22,
190 + IAVF_RXDID_COMMS_OVS_2 = 23,
191 + IAVF_RXDID_LAST = 63,
194 +enum iavf_rx_flex_desc_status_error_0_bits {
195 + /* Note: These are predefined bit offsets */
196 + IAVF_RX_FLEX_DESC_STATUS0_DD_S = 0,
197 + IAVF_RX_FLEX_DESC_STATUS0_EOF_S,
198 + IAVF_RX_FLEX_DESC_STATUS0_HBO_S,
199 + IAVF_RX_FLEX_DESC_STATUS0_L3L4P_S,
200 + IAVF_RX_FLEX_DESC_STATUS0_XSUM_IPE_S,
201 + IAVF_RX_FLEX_DESC_STATUS0_XSUM_L4E_S,
202 + IAVF_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S,
203 + IAVF_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_S,
204 + IAVF_RX_FLEX_DESC_STATUS0_LPBK_S,
205 + IAVF_RX_FLEX_DESC_STATUS0_IPV6EXADD_S,
206 + IAVF_RX_FLEX_DESC_STATUS0_RXE_S,
207 + IAVF_RX_FLEX_DESC_STATUS0_CRCP_S,
208 + IAVF_RX_FLEX_DESC_STATUS0_RSS_VALID_S,
209 + IAVF_RX_FLEX_DESC_STATUS0_L2TAG1P_S,
210 + IAVF_RX_FLEX_DESC_STATUS0_XTRMD0_VALID_S,
211 + IAVF_RX_FLEX_DESC_STATUS0_XTRMD1_VALID_S,
212 + IAVF_RX_FLEX_DESC_STATUS0_LAST /* this entry must be last!!! */
215 +/* for iavf_32b_rx_flex_desc.ptype_flex_flags0 member */
216 +#define IAVF_RX_FLEX_DESC_PTYPE_M (0x3FF) /* 10-bits */
218 +/* for iavf_32b_rx_flex_desc.pkt_len member */
219 +#define IAVF_RX_FLX_DESC_PKT_LEN_M (0x3FFF) /* 14-bits */
221 int iavf_dev_rx_queue_setup(struct rte_eth_dev *dev,