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

Function ngbe_set_rx_function

dpdk/drivers/net/ngbe/ngbe_rxtx.c:2745–2791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2743}
2744
2745void
2746ngbe_set_rx_function(struct rte_eth_dev *dev)
2747{
2748 struct ngbe_adapter *adapter = ngbe_dev_adapter(dev);
2749
2750 if (dev->data->scattered_rx) {
2751 /*
2752 * Set the scattered callback: there are bulk and
2753 * single allocation versions.
2754 */
2755 if (adapter->rx_bulk_alloc_allowed) {
2756 PMD_INIT_LOG(DEBUG, "Using a Scattered with bulk "
2757 "allocation callback (port=%d).",
2758 dev->data->port_id);
2759 dev->rx_pkt_burst = ngbe_recv_pkts_sc_bulk_alloc;
2760 } else {
2761 PMD_INIT_LOG(DEBUG, "Using Regular (non-vector, "
2762 "single allocation) "
2763 "Scattered Rx callback "
2764 "(port=%d).",
2765 dev->data->port_id);
2766
2767 dev->rx_pkt_burst = ngbe_recv_pkts_sc_single_alloc;
2768 }
2769 /*
2770 * Below we set "simple" callbacks according to port/queues parameters.
2771 * If parameters allow we are going to choose between the following
2772 * callbacks:
2773 * - Bulk Allocation
2774 * - Single buffer allocation (the simplest one)
2775 */
2776 } else if (adapter->rx_bulk_alloc_allowed) {
2777 PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are "
2778 "satisfied. Rx Burst Bulk Alloc function "
2779 "will be used on port=%d.",
2780 dev->data->port_id);
2781
2782 dev->rx_pkt_burst = ngbe_recv_pkts_bulk_alloc;
2783 } else {
2784 PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are not "
2785 "satisfied, or Scattered Rx is requested "
2786 "(port=%d).",
2787 dev->data->port_id);
2788
2789 dev->rx_pkt_burst = ngbe_recv_pkts;
2790 }
2791}
2792
2793static const struct {
2794 eth_rx_burst_t pkt_burst;

Callers 2

eth_ngbe_dev_initFunction · 0.85
ngbe_dev_rx_initFunction · 0.85

Calls 1

ngbe_dev_adapterFunction · 0.85

Tested by

no test coverage detected