net/nfp: fix initialization
authorPeng Zhang <peng.zhang@corigine.com>
Wed, 15 Jun 2022 10:14:17 +0000 (12:14 +0200)
committerFerruh Yigit <ferruh.yigit@xilinx.com>
Fri, 17 Jun 2022 15:29:55 +0000 (17:29 +0200)
When the testpmd start-up, it will check MTU range,
if MTU > flubfsz, it will lead testpmd start fail.
Because the hw->flbufsz doesn't have the initialized
value, so it will lead the bug.

Fixes: 417be15e5f11 ("net/nfp: make sure MTU is never larger than mbuf size")
Cc: stable@dpdk.org
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
drivers/net/nfp/nfp_ethdev.c
drivers/net/nfp/nfp_ethdev_vf.c

index 7b8949a..3003946 100644 (file)
@@ -516,6 +516,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
        hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
        hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
        hw->mtu = RTE_ETHER_MTU;
+       hw->flbufsz = RTE_ETHER_MTU;
 
        /* VLAN insertion is incompatible with LSOv2 */
        if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
index bddb1ec..b666428 100644 (file)
@@ -395,6 +395,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
        hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
        hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
        hw->mtu = RTE_ETHER_MTU;
+       hw->flbufsz = RTE_ETHER_MTU;
 
        /* VLAN insertion is incompatible with LSOv2 */
        if (hw->cap & NFP_NET_CFG_CTRL_LSO2)