4 * Copyright(c) 2014-2015 Chelsio Communications.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Chelsio Communications nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 CPL_SGE_EGR_UPDATE = 0xA5,
41 CPL_TX_PKT_LSO = 0xED,
45 enum { /* TX_PKT_XT checksum types */
58 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
77 #if defined(RSS_HDR_VLD) || defined(CHELSIO_FW)
78 #define RSS_HDR struct rss_header rss_hdr
84 struct work_request_hdr {
90 #define WR_HDR struct work_request_hdr wr
91 #define WR_HDR_SIZE sizeof(struct work_request_hdr)
104 struct cpl_tx_pkt_core {
113 struct cpl_tx_pkt_core c;
116 /* cpl_tx_pkt_core.ctrl0 fields */
118 #define M_TXPKT_PF 0x7
119 #define V_TXPKT_PF(x) ((x) << S_TXPKT_PF)
120 #define G_TXPKT_PF(x) (((x) >> S_TXPKT_PF) & M_TXPKT_PF)
122 #define S_TXPKT_INTF 16
123 #define M_TXPKT_INTF 0xF
124 #define V_TXPKT_INTF(x) ((x) << S_TXPKT_INTF)
125 #define G_TXPKT_INTF(x) (((x) >> S_TXPKT_INTF) & M_TXPKT_INTF)
127 #define S_TXPKT_OPCODE 24
128 #define M_TXPKT_OPCODE 0xFF
129 #define V_TXPKT_OPCODE(x) ((x) << S_TXPKT_OPCODE)
130 #define G_TXPKT_OPCODE(x) (((x) >> S_TXPKT_OPCODE) & M_TXPKT_OPCODE)
132 /* cpl_tx_pkt_core.ctrl1 fields */
133 #define S_TXPKT_IPHDR_LEN 20
134 #define M_TXPKT_IPHDR_LEN 0x3FFF
135 #define V_TXPKT_IPHDR_LEN(x) ((__u64)(x) << S_TXPKT_IPHDR_LEN)
136 #define G_TXPKT_IPHDR_LEN(x) (((x) >> S_TXPKT_IPHDR_LEN) & M_TXPKT_IPHDR_LEN)
138 #define S_TXPKT_ETHHDR_LEN 34
139 #define M_TXPKT_ETHHDR_LEN 0x3F
140 #define V_TXPKT_ETHHDR_LEN(x) ((__u64)(x) << S_TXPKT_ETHHDR_LEN)
141 #define G_TXPKT_ETHHDR_LEN(x) (((x) >> S_TXPKT_ETHHDR_LEN) & M_TXPKT_ETHHDR_LEN)
143 #define S_T6_TXPKT_ETHHDR_LEN 32
144 #define M_T6_TXPKT_ETHHDR_LEN 0xFF
145 #define V_T6_TXPKT_ETHHDR_LEN(x) ((__u64)(x) << S_T6_TXPKT_ETHHDR_LEN)
146 #define G_T6_TXPKT_ETHHDR_LEN(x) \
147 (((x) >> S_T6_TXPKT_ETHHDR_LEN) & M_T6_TXPKT_ETHHDR_LEN)
149 #define S_TXPKT_CSUM_TYPE 40
150 #define M_TXPKT_CSUM_TYPE 0xF
151 #define V_TXPKT_CSUM_TYPE(x) ((__u64)(x) << S_TXPKT_CSUM_TYPE)
152 #define G_TXPKT_CSUM_TYPE(x) (((x) >> S_TXPKT_CSUM_TYPE) & M_TXPKT_CSUM_TYPE)
154 #define S_TXPKT_VLAN 44
155 #define M_TXPKT_VLAN 0xFFFF
156 #define V_TXPKT_VLAN(x) ((__u64)(x) << S_TXPKT_VLAN)
157 #define G_TXPKT_VLAN(x) (((x) >> S_TXPKT_VLAN) & M_TXPKT_VLAN)
159 #define S_TXPKT_VLAN_VLD 60
160 #define V_TXPKT_VLAN_VLD(x) ((__u64)(x) << S_TXPKT_VLAN_VLD)
161 #define F_TXPKT_VLAN_VLD V_TXPKT_VLAN_VLD(1ULL)
163 #define S_TXPKT_IPCSUM_DIS 62
164 #define V_TXPKT_IPCSUM_DIS(x) ((__u64)(x) << S_TXPKT_IPCSUM_DIS)
165 #define F_TXPKT_IPCSUM_DIS V_TXPKT_IPCSUM_DIS(1ULL)
167 #define S_TXPKT_L4CSUM_DIS 63
168 #define V_TXPKT_L4CSUM_DIS(x) ((__u64)(x) << S_TXPKT_L4CSUM_DIS)
169 #define F_TXPKT_L4CSUM_DIS V_TXPKT_L4CSUM_DIS(1ULL)
171 struct cpl_tx_pkt_lso_core {
177 /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
180 struct cpl_tx_pkt_lso {
182 struct cpl_tx_pkt_lso_core c;
183 /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */
186 /* cpl_tx_pkt_lso_core.lso_ctrl fields */
187 #define S_LSO_TCPHDR_LEN 0
188 #define M_LSO_TCPHDR_LEN 0xF
189 #define V_LSO_TCPHDR_LEN(x) ((x) << S_LSO_TCPHDR_LEN)
190 #define G_LSO_TCPHDR_LEN(x) (((x) >> S_LSO_TCPHDR_LEN) & M_LSO_TCPHDR_LEN)
192 #define S_LSO_IPHDR_LEN 4
193 #define M_LSO_IPHDR_LEN 0xFFF
194 #define V_LSO_IPHDR_LEN(x) ((x) << S_LSO_IPHDR_LEN)
195 #define G_LSO_IPHDR_LEN(x) (((x) >> S_LSO_IPHDR_LEN) & M_LSO_IPHDR_LEN)
197 #define S_LSO_ETHHDR_LEN 16
198 #define M_LSO_ETHHDR_LEN 0xF
199 #define V_LSO_ETHHDR_LEN(x) ((x) << S_LSO_ETHHDR_LEN)
200 #define G_LSO_ETHHDR_LEN(x) (((x) >> S_LSO_ETHHDR_LEN) & M_LSO_ETHHDR_LEN)
202 #define S_LSO_IPV6 20
203 #define V_LSO_IPV6(x) ((x) << S_LSO_IPV6)
204 #define F_LSO_IPV6 V_LSO_IPV6(1U)
206 #define S_LSO_LAST_SLICE 22
207 #define V_LSO_LAST_SLICE(x) ((x) << S_LSO_LAST_SLICE)
208 #define F_LSO_LAST_SLICE V_LSO_LAST_SLICE(1U)
210 #define S_LSO_FIRST_SLICE 23
211 #define V_LSO_FIRST_SLICE(x) ((x) << S_LSO_FIRST_SLICE)
212 #define F_LSO_FIRST_SLICE V_LSO_FIRST_SLICE(1U)
214 #define S_LSO_OPCODE 24
215 #define M_LSO_OPCODE 0xFF
216 #define V_LSO_OPCODE(x) ((x) << S_LSO_OPCODE)
217 #define G_LSO_OPCODE(x) (((x) >> S_LSO_OPCODE) & M_LSO_OPCODE)
219 #define S_LSO_T5_XFER_SIZE 0
220 #define M_LSO_T5_XFER_SIZE 0xFFFFFFF
221 #define V_LSO_T5_XFER_SIZE(x) ((x) << S_LSO_T5_XFER_SIZE)
222 #define G_LSO_T5_XFER_SIZE(x) (((x) >> S_LSO_T5_XFER_SIZE) & M_LSO_T5_XFER_SIZE)
227 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
248 /* rx_pkt.l2info fields */
250 #define V_RXF_UDP(x) ((x) << S_RXF_UDP)
251 #define F_RXF_UDP V_RXF_UDP(1U)
254 #define V_RXF_TCP(x) ((x) << S_RXF_TCP)
255 #define F_RXF_TCP V_RXF_TCP(1U)
258 #define V_RXF_IP(x) ((x) << S_RXF_IP)
259 #define F_RXF_IP V_RXF_IP(1U)
262 #define V_RXF_IP6(x) ((x) << S_RXF_IP6)
263 #define F_RXF_IP6 V_RXF_IP6(1U)
265 /* cpl_fw*.type values */
289 ULP_TX_SC_IMM = 0x81,
290 ULP_TX_SC_DSGL = 0x82,
291 ULP_TX_SC_ISGL = 0x83
294 #define S_ULPTX_CMD 24
295 #define M_ULPTX_CMD 0xFF
296 #define V_ULPTX_CMD(x) ((x) << S_ULPTX_CMD)
298 #define S_ULP_TX_SC_MORE 23
299 #define V_ULP_TX_SC_MORE(x) ((x) << S_ULP_TX_SC_MORE)
300 #define F_ULP_TX_SC_MORE V_ULP_TX_SC_MORE(1U)
302 struct ulptx_sge_pair {
312 #if !(defined C99_NOT_SUPPORTED)
313 struct ulptx_sge_pair sge[0];
323 #define S_ULPTX_NSGE 0
324 #define M_ULPTX_NSGE 0xFFFF
325 #define V_ULPTX_NSGE(x) ((x) << S_ULPTX_NSGE)
332 /* ulp_txpkt.cmd_dest fields */
333 #define S_ULP_TXPKT_DEST 16
334 #define M_ULP_TXPKT_DEST 0x3
335 #define V_ULP_TXPKT_DEST(x) ((x) << S_ULP_TXPKT_DEST)
337 #define S_ULP_TXPKT_FID 4
338 #define M_ULP_TXPKT_FID 0x7ff
339 #define V_ULP_TXPKT_FID(x) ((x) << S_ULP_TXPKT_FID)
341 #define S_ULP_TXPKT_RO 3
342 #define V_ULP_TXPKT_RO(x) ((x) << S_ULP_TXPKT_RO)
343 #define F_ULP_TXPKT_RO V_ULP_TXPKT_RO(1U)
345 #endif /* T4_MSG_H */