From: Wenxuan Wu <wenxuanx...@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: sta...@dpdk.org

Signed-off-by: Wenxuan Wu <wenxuanx...@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

Reply via email to