* [VF] Initializes Receive Unit. */
| 5729 | * [VF] Initializes Receive Unit. |
| 5730 | */ |
| 5731 | int __rte_cold |
| 5732 | ixgbevf_dev_rx_init(struct rte_eth_dev *dev) |
| 5733 | { |
| 5734 | struct ixgbe_hw *hw; |
| 5735 | struct ixgbe_rx_queue *rxq; |
| 5736 | struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; |
| 5737 | uint32_t frame_size = dev->data->mtu + IXGBE_ETH_OVERHEAD; |
| 5738 | uint64_t bus_addr; |
| 5739 | uint32_t srrctl, psrtype = 0; |
| 5740 | uint16_t buf_size; |
| 5741 | uint16_t i; |
| 5742 | int ret; |
| 5743 | |
| 5744 | PMD_INIT_FUNC_TRACE(); |
| 5745 | hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 5746 | |
| 5747 | if (rte_is_power_of_2(dev->data->nb_rx_queues) == 0) { |
| 5748 | PMD_INIT_LOG(ERR, "The number of Rx queue invalid, " |
| 5749 | "it should be power of 2"); |
| 5750 | return -1; |
| 5751 | } |
| 5752 | |
| 5753 | if (dev->data->nb_rx_queues > hw->mac.max_rx_queues) { |
| 5754 | PMD_INIT_LOG(ERR, "The number of Rx queue invalid, " |
| 5755 | "it should be equal to or less than %d", |
| 5756 | hw->mac.max_rx_queues); |
| 5757 | return -1; |
| 5758 | } |
| 5759 | |
| 5760 | /* |
| 5761 | * When the VF driver issues a IXGBE_VF_RESET request, the PF driver |
| 5762 | * disables the VF receipt of packets if the PF MTU is > 1500. |
| 5763 | * This is done to deal with 82599 limitations that imposes |
| 5764 | * the PF and all VFs to share the same MTU. |
| 5765 | * Then, the PF driver enables again the VF receipt of packet when |
| 5766 | * the VF driver issues a IXGBE_VF_SET_LPE request. |
| 5767 | * In the meantime, the VF device cannot be used, even if the VF driver |
| 5768 | * and the Guest VM network stack are ready to accept packets with a |
| 5769 | * size up to the PF MTU. |
| 5770 | * As a work-around to this PF behaviour, force the call to |
| 5771 | * ixgbevf_rlpml_set_vf even if jumbo frames are not used. This way, |
| 5772 | * VF packets received can work in all cases. |
| 5773 | */ |
| 5774 | if (ixgbevf_rlpml_set_vf(hw, frame_size) != 0) |
| 5775 | PMD_INIT_LOG(ERR, "Set max packet length to %d failed.", |
| 5776 | frame_size); |
| 5777 | |
| 5778 | /* |
| 5779 | * Assume no header split and no VLAN strip support |
| 5780 | * on any Rx queue first . |
| 5781 | */ |
| 5782 | rxmode->offloads &= ~RTE_ETH_RX_OFFLOAD_VLAN_STRIP; |
| 5783 | /* Setup RX queues */ |
| 5784 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 5785 | rxq = dev->data->rx_queues[i]; |
| 5786 | |
| 5787 | /* Allocate buffers for descriptor rings */ |
| 5788 | ret = ixgbe_alloc_rx_queue_mbufs(rxq); |
no test coverage detected