MCPcopy Create free account
hub / github.com/F-Stack/f-stack / enqueue_simple_pkts

Function enqueue_simple_pkts

dpdk/drivers/net/enic/enic_rxtx.c:621–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621static void enqueue_simple_pkts(struct rte_mbuf **pkts,
622 struct wq_enet_desc *desc,
623 uint16_t n,
624 struct enic *enic)
625{
626 struct rte_mbuf *p;
627 uint16_t mss;
628
629 while (n) {
630 n--;
631 p = *pkts++;
632 desc->address = p->buf_iova + p->data_off;
633 desc->length = p->pkt_len;
634 /* VLAN insert */
635 desc->vlan_tag = p->vlan_tci;
636 desc->header_length_flags &=
637 ((1 << WQ_ENET_FLAGS_EOP_SHIFT) |
638 (1 << WQ_ENET_FLAGS_CQ_ENTRY_SHIFT));
639 if (p->ol_flags & RTE_MBUF_F_TX_VLAN) {
640 desc->header_length_flags |=
641 1 << WQ_ENET_FLAGS_VLAN_TAG_INSERT_SHIFT;
642 }
643 /*
644 * Checksum offload. We use WQ_ENET_OFFLOAD_MODE_CSUM, which
645 * is 0, so no need to set offload_mode.
646 */
647 mss = 0;
648 if (p->ol_flags & RTE_MBUF_F_TX_IP_CKSUM)
649 mss |= ENIC_CALC_IP_CKSUM << WQ_ENET_MSS_SHIFT;
650 if (p->ol_flags & RTE_MBUF_F_TX_L4_MASK)
651 mss |= ENIC_CALC_TCP_UDP_CKSUM << WQ_ENET_MSS_SHIFT;
652 desc->mss_loopback = mss;
653
654 /*
655 * The app should not send oversized
656 * packets. tx_pkt_prepare includes a check as
657 * well. But some apps ignore the device max size and
658 * tx_pkt_prepare. Oversized packets cause WQ errors
659 * and the NIC ends up disabling the whole WQ. So
660 * truncate packets..
661 */
662 if (unlikely(p->pkt_len > ENIC_TX_MAX_PKT_SIZE)) {
663 desc->length = ENIC_TX_MAX_PKT_SIZE;
664 rte_atomic64_inc(&enic->soft_stats.tx_oversized);
665 }
666 desc++;
667 }
668}
669
670uint16_t enic_simple_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
671 uint16_t nb_pkts)

Callers 1

enic_simple_xmit_pktsFunction · 0.85

Calls 1

rte_atomic64_incFunction · 0.50

Tested by

no test coverage detected