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

Function txgbevf_dev_rx_init

dpdk/drivers/net/txgbe/txgbe_rxtx.c:4822–4948  ·  view source on GitHub ↗

* [VF] Initializes Receive Unit. */

Source from the content-addressed store, hash-verified

4820 * [VF] Initializes Receive Unit.
4821 */
4822int __rte_cold
4823txgbevf_dev_rx_init(struct rte_eth_dev *dev)
4824{
4825 struct txgbe_hw *hw;
4826 struct txgbe_rx_queue *rxq;
4827 struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
4828 uint64_t bus_addr;
4829 uint32_t srrctl, psrtype;
4830 uint16_t buf_size;
4831 uint16_t i;
4832 int ret;
4833
4834 PMD_INIT_FUNC_TRACE();
4835 hw = TXGBE_DEV_HW(dev);
4836
4837 if (rte_is_power_of_2(dev->data->nb_rx_queues) == 0) {
4838 PMD_INIT_LOG(ERR, "The number of Rx queue invalid, "
4839 "it should be power of 2");
4840 return -1;
4841 }
4842
4843 if (dev->data->nb_rx_queues > hw->mac.max_rx_queues) {
4844 PMD_INIT_LOG(ERR, "The number of Rx queue invalid, "
4845 "it should be equal to or less than %d",
4846 hw->mac.max_rx_queues);
4847 return -1;
4848 }
4849
4850 /*
4851 * When the VF driver issues a TXGBE_VF_RESET request, the PF driver
4852 * disables the VF receipt of packets if the PF MTU is > 1500.
4853 * This is done to deal with limitations that imposes
4854 * the PF and all VFs to share the same MTU.
4855 * Then, the PF driver enables again the VF receipt of packet when
4856 * the VF driver issues a TXGBE_VF_SET_LPE request.
4857 * In the meantime, the VF device cannot be used, even if the VF driver
4858 * and the Guest VM network stack are ready to accept packets with a
4859 * size up to the PF MTU.
4860 * As a work-around to this PF behaviour, force the call to
4861 * txgbevf_rlpml_set_vf even if jumbo frames are not used. This way,
4862 * VF packets received can work in all cases.
4863 */
4864 if (txgbevf_rlpml_set_vf(hw,
4865 (uint16_t)dev->data->mtu + TXGBE_ETH_OVERHEAD)) {
4866 PMD_INIT_LOG(ERR, "Set max packet length to %d failed.",
4867 dev->data->mtu + TXGBE_ETH_OVERHEAD);
4868 return -EINVAL;
4869 }
4870
4871 /*
4872 * Assume no header split and no VLAN strip support
4873 * on any Rx queue first .
4874 */
4875 rxmode->offloads &= ~RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
4876
4877 /* Set PSR type for VF RSS according to max Rx queue */
4878 psrtype = TXGBE_VFPLCFG_PSRL4HDR |
4879 TXGBE_VFPLCFG_PSRL4HDR |

Callers 1

txgbevf_dev_startFunction · 0.85

Calls 7

txgbevf_rlpml_set_vfFunction · 0.85
txgbe_set_rx_functionFunction · 0.85
rte_is_power_of_2Function · 0.50
wr32Function · 0.50

Tested by

no test coverage detected