1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Cavium, Inc
10 #include <rte_atomic.h>
11 #include <rte_common.h>
12 #include <rte_ethdev_driver.h>
13 #include <rte_ether.h>
16 #include <rte_prefetch.h>
18 #include "octeontx_ethdev.h"
19 #include "octeontx_rxtx.h"
20 #include "octeontx_logs.h"
23 octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
25 struct octeontx_rxq *rxq;
32 while (count < nb_pkts) {
33 valid_event = rte_event_dequeue_burst(rxq->evdev,
38 rx_pkts[count++] = ev.mbuf;
41 return count; /* return number of pkts received */
44 #define T(name, f3, f2, f1, f0, sz, flags) \
45 static uint16_t __rte_noinline __rte_hot \
46 octeontx_xmit_pkts_ ##name(void *tx_queue, \
47 struct rte_mbuf **tx_pkts, uint16_t pkts) \
51 return __octeontx_xmit_pkts(tx_queue, tx_pkts, pkts, cmd, \
55 OCCTX_TX_FASTPATH_MODES
59 octeontx_set_tx_function(struct rte_eth_dev *dev)
61 struct octeontx_nic *nic = octeontx_pmd_priv(dev);
63 const eth_tx_burst_t tx_burst_func[2][2][2][2] = {
64 #define T(name, f3, f2, f1, f0, sz, flags) \
65 [f3][f2][f1][f0] = octeontx_xmit_pkts_ ##name,
67 OCCTX_TX_FASTPATH_MODES
71 dev->tx_pkt_burst = tx_burst_func
72 [!!(nic->tx_offload_flags & OCCTX_TX_OFFLOAD_MBUF_NOFF_F)]
73 [!!(nic->tx_offload_flags & OCCTX_TX_OFFLOAD_OL3_OL4_CSUM_F)]
74 [!!(nic->tx_offload_flags & OCCTX_TX_OFFLOAD_L3_L4_CSUM_F)]
75 [!!(nic->tx_offload_flags & OCCTX_TX_MULTI_SEG_F)];