On 10/10/2022 7:48 AM, Chaoyong He wrote:
From: Peng Zhang <peng.zh...@corigine.com>

When the testpmd app start-up with parameter max-pkt-len, it will set MTU.
But the initialized value of flubfsz is inappropriate, if the value of
flbufsz is smaller than the valude of max-pkt-len, the testpmd app will
start fail.


What is the failure in the testpmd?

This patch is fixing something but it is not clear what is fixed, the concern is it may be changing driver to make something pass in test application (testpmd).

What is 'flubfsz', is it Hw configured frame buffer size?


Fixes: 5c305e218f15 ("net/nfp: fix initialization")
Cc: sta...@dpdk.org

Signed-off-by: Peng Zhang <peng.zh...@corigine.com>
Reviewed-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderl...@corigine.com>
---
  drivers/net/nfp/nfp_ethdev.c    | 2 +-
  drivers/net/nfp/nfp_ethdev_vf.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 5cdd34e588..b95e623f1f 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -517,7 +517,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;
+       hw->flbufsz = hw->max_mtu;
/* VLAN insertion is incompatible with LSOv2 */
        if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index d304d78d34..47acb4c60e 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -396,7 +396,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;
+       hw->flbufsz = hw->max_mtu;
/* VLAN insertion is incompatible with LSOv2 */
        if (hw->cap & NFP_NET_CFG_CTRL_LSO2)

Reply via email to