| 4849 | } |
| 4850 | |
| 4851 | void __rte_cold |
| 4852 | ixgbe_set_rx_function(struct rte_eth_dev *dev) |
| 4853 | { |
| 4854 | uint16_t i, rx_using_sse; |
| 4855 | struct ixgbe_adapter *adapter = dev->data->dev_private; |
| 4856 | |
| 4857 | /* |
| 4858 | * In order to allow Vector Rx there are a few configuration |
| 4859 | * conditions to be met and Rx Bulk Allocation should be allowed. |
| 4860 | */ |
| 4861 | if (ixgbe_rx_vec_dev_conf_condition_check(dev) || |
| 4862 | !adapter->rx_bulk_alloc_allowed || |
| 4863 | rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_128) { |
| 4864 | PMD_INIT_LOG(DEBUG, "Port[%d] doesn't meet Vector Rx " |
| 4865 | "preconditions", |
| 4866 | dev->data->port_id); |
| 4867 | |
| 4868 | adapter->rx_vec_allowed = false; |
| 4869 | } |
| 4870 | |
| 4871 | /* |
| 4872 | * Initialize the appropriate LRO callback. |
| 4873 | * |
| 4874 | * If all queues satisfy the bulk allocation preconditions |
| 4875 | * (hw->rx_bulk_alloc_allowed is TRUE) then we may use bulk allocation. |
| 4876 | * Otherwise use a single allocation version. |
| 4877 | */ |
| 4878 | if (dev->data->lro) { |
| 4879 | if (adapter->rx_bulk_alloc_allowed) { |
| 4880 | PMD_INIT_LOG(DEBUG, "LRO is requested. Using a bulk " |
| 4881 | "allocation version"); |
| 4882 | dev->rx_pkt_burst = ixgbe_recv_pkts_lro_bulk_alloc; |
| 4883 | } else { |
| 4884 | PMD_INIT_LOG(DEBUG, "LRO is requested. Using a single " |
| 4885 | "allocation version"); |
| 4886 | dev->rx_pkt_burst = ixgbe_recv_pkts_lro_single_alloc; |
| 4887 | } |
| 4888 | } else if (dev->data->scattered_rx) { |
| 4889 | /* |
| 4890 | * Set the non-LRO scattered callback: there are Vector and |
| 4891 | * single allocation versions. |
| 4892 | */ |
| 4893 | if (adapter->rx_vec_allowed) { |
| 4894 | PMD_INIT_LOG(DEBUG, "Using Vector Scattered Rx " |
| 4895 | "callback (port=%d).", |
| 4896 | dev->data->port_id); |
| 4897 | #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM) |
| 4898 | dev->recycle_rx_descriptors_refill = |
| 4899 | ixgbe_recycle_rx_descriptors_refill_vec; |
| 4900 | #endif |
| 4901 | dev->rx_pkt_burst = ixgbe_recv_scattered_pkts_vec; |
| 4902 | } else if (adapter->rx_bulk_alloc_allowed) { |
| 4903 | PMD_INIT_LOG(DEBUG, "Using a Scattered with bulk " |
| 4904 | "allocation callback (port=%d).", |
| 4905 | dev->data->port_id); |
| 4906 | dev->rx_pkt_burst = ixgbe_recv_pkts_lro_bulk_alloc; |
| 4907 | } else { |
| 4908 | PMD_INIT_LOG(DEBUG, "Using Regular (non-vector, " |
no test coverage detected