[PATCH] net/i40e: fix max frmame size config at port level
wenxuanx.wu at intel.com
wenxuanx.wu at intel.com
Thu Apr 28 10:56:13 CEST 2022
From: Wenxuan Wu <wenxuanx.wu at intel.com>
Max frame size of XL710 can only be set when link is up, and the wait
time is 1 sec. But X722 consumes longer time which is too short to up would
result in this error.
Acctually, max frame size of X722 can be set regardless of link status.
This fix resolve max frame size can only be set when link is up.
Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
Cc: stable at dpdk.org
Signed-off-by: Wenxuan Wu <wenxuanx.wu at intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 755786dc10..d3cc6a2769 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12108,17 +12108,15 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
update_link_reg(hw, &link);
if (link.link_status)
break;
-
rte_delay_ms(CHECK_INTERVAL);
} while (--rep_cnt);
- if (link.link_status) {
+ /* Only I40E_MAC_XL710 link up should be guaranteed */
+ if (hw->mac.type == I40E_MAC_X722 || link.link_status)
status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
- if (status != I40E_SUCCESS)
- PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
- } else {
- PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
- }
+
+ if (status != I40E_SUCCESS)
+ PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
}
RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
--
2.25.1
More information about the stable
mailing list