Lines Matching full:pi
49 static int iavf_isc_txd_encap(void *arg, if_pkt_info_t pi);
116 * @pi: packet information
130 iavf_tso_detect_sparse(bus_dma_segment_t *segs, int nsegs, if_pkt_info_t pi) in iavf_tso_detect_sparse() argument
136 segsz = pi->ipi_tso_segsz; in iavf_tso_detect_sparse()
139 hlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; in iavf_tso_detect_sparse()
140 tsolen = pi->ipi_len - hlen; in iavf_tso_detect_sparse()
160 segsz = pi->ipi_tso_segsz; in iavf_tso_detect_sparse()
187 * @pi: Tx packet info
196 if_pkt_info_t pi, u32 *cmd, u32 *off) in iavf_tx_setup_offload() argument
198 switch (pi->ipi_etype) { in iavf_tx_setup_offload()
201 if (pi->ipi_csum_flags & IAVF_CSUM_IPV4) in iavf_tx_setup_offload()
216 *off |= (pi->ipi_ehdrlen >> 1) << IAVF_TX_DESC_LENGTH_MACLEN_SHIFT; in iavf_tx_setup_offload()
217 *off |= (pi->ipi_ip_hlen >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT; in iavf_tx_setup_offload()
219 switch (pi->ipi_ipproto) { in iavf_tx_setup_offload()
221 if (pi->ipi_csum_flags & IAVF_CSUM_TCP) { in iavf_tx_setup_offload()
223 *off |= (pi->ipi_tcp_hlen >> 2) << in iavf_tx_setup_offload()
226 MPASS(pi->ipi_tcp_hlen != 0); in iavf_tx_setup_offload()
230 if (pi->ipi_csum_flags & IAVF_CSUM_UDP) { in iavf_tx_setup_offload()
237 if (pi->ipi_csum_flags & IAVF_CSUM_SCTP) { in iavf_tx_setup_offload()
251 * @pi: packet info structure
259 iavf_tso_setup(struct tx_ring *txr, if_pkt_info_t pi) in iavf_tso_setup() argument
267 idx = pi->ipi_pidx; in iavf_tso_setup()
269 total_hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; in iavf_tso_setup()
270 tsolen = pi->ipi_len - total_hdr_len; in iavf_tso_setup()
279 if (pi->ipi_tso_segsz < IAVF_MIN_TSO_MSS) { in iavf_tso_setup()
281 pi->ipi_tso_segsz = IAVF_MIN_TSO_MSS; in iavf_tso_setup()
283 mss = pi->ipi_tso_segsz; in iavf_tso_setup()
288 MPASS(pi->ipi_ehdrlen != 0); in iavf_tso_setup()
289 MPASS(pi->ipi_ip_hlen != 0); in iavf_tso_setup()
312 * @pi: packet info to encapsulate
320 iavf_isc_txd_encap(void *arg, if_pkt_info_t pi) in iavf_isc_txd_encap() argument
324 struct iavf_tx_queue *que = &vsi->tx_queues[pi->ipi_qsidx]; in iavf_isc_txd_encap()
326 int nsegs = pi->ipi_nsegs; in iavf_isc_txd_encap()
327 bus_dma_segment_t *segs = pi->ipi_segs; in iavf_isc_txd_encap()
332 if (__predict_false(pi->ipi_len < IAVF_MIN_FRAME)) { in iavf_isc_txd_encap()
338 i = pi->ipi_pidx; in iavf_isc_txd_encap()
340 tx_intr = (pi->ipi_flags & IPI_TX_INTR); in iavf_isc_txd_encap()
343 if (pi->ipi_csum_flags & CSUM_OFFLOAD) { in iavf_isc_txd_encap()
345 if (pi->ipi_csum_flags & CSUM_TSO) { in iavf_isc_txd_encap()
347 if (iavf_tso_detect_sparse(segs, nsegs, pi)) in iavf_isc_txd_encap()
349 i = iavf_tso_setup(txr, pi); in iavf_isc_txd_encap()
351 iavf_tx_setup_offload(que, pi, &cmd, &off); in iavf_isc_txd_encap()
353 if (pi->ipi_mflags & M_VLANTAG) in iavf_isc_txd_encap()
359 MPASS(pi->ipi_len >= IAVF_MIN_FRAME); in iavf_isc_txd_encap()
361 if (!(pi->ipi_csum_flags & CSUM_TSO)) in iavf_isc_txd_encap()
362 MPASS(pi->ipi_len <= IAVF_MAX_FRAME); in iavf_isc_txd_encap()
379 | ((u64)htole16(pi->ipi_vtag) << IAVF_TXD_QW1_L2TAG1_SHIFT)); in iavf_isc_txd_encap()
394 pi->ipi_new_pidx = i; in iavf_isc_txd_encap()