| 2743 | } |
| 2744 | |
| 2745 | void |
| 2746 | ngbe_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 | |
| 2793 | static const struct { |
| 2794 | eth_rx_burst_t pkt_burst; |
no test coverage detected