DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] driver/i40e: enable max frame at port level
@ 2022-04-28  7:45 wenxuanx.wu
  0 siblings, 0 replies; only message in thread
From: wenxuanx.wu @ 2022-04-28  7:45 UTC (permalink / raw)
  To: beilei.xing, dev; +Cc: wenxuanx.wu, yidingx.zhou, stable

From: Wenxuan Wu <wenxuanx.wu@intel.com>

This fix resolve max frame size can only be set when link is up.

hw.type would result in different behavior:
For X710, max frame size can be set regardless of link status.
For X722, link up should be guaranteed.

Fixes: a4ba77367923
Cc: stable@dpdk.org

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 755786dc10..0bd9e5eac0 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12104,20 +12104,18 @@ i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
 	struct rte_eth_link link;
 	enum i40e_status_code status;
 
-	do {
-		update_link_reg(hw, &link);
-		if (link.link_status)
-			break;
-
-		rte_delay_ms(CHECK_INTERVAL);
-	} while (--rep_cnt);
+	if (hw->mac.type == I40E_MAC_XL710) { /* I40E_MAC_XL710 */
+		do {
+			update_link_reg(hw, &link);
+			if (link.link_status)
+				break;
+			rte_delay_ms(CHECK_INTERVAL);
+		} while (--rep_cnt);
 
-	if (link.link_status) {
+		if (link.link_status)
+			status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
+	} else {/* I40E_MAC_X722 */
 		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");
 	}
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-28  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  7:45 [PATCH] driver/i40e: enable max frame at port level wenxuanx.wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).