aquantia: Do not purge addresses when setting the number of rings
authorIzabela Bakollari <ibakolla@redhat.com>
Wed, 23 Nov 2022 10:10:08 +0000 (11:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Nov 2022 09:28:46 +0000 (09:28 +0000)
IPV6 addresses are purged when setting the number of rx/tx
rings using ethtool -G. The function aq_set_ringparam
calls dev_close, which removes the addresses. As a solution,
call an internal function (aq_ndev_close).

Fixes: c1af5427954b ("net: aquantia: Ethtool based ring size configuration")
Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
drivers/net/ethernet/aquantia/atlantic/aq_main.c
drivers/net/ethernet/aquantia/atlantic/aq_main.h

index a08f221e30d41f85bf4505b250c6d8bd7a281d1c..ac4ea93bd8ddad18f03544f762444c809d953369 100644 (file)
@@ -13,6 +13,7 @@
 #include "aq_ptp.h"
 #include "aq_filters.h"
 #include "aq_macsec.h"
+#include "aq_main.h"
 
 #include <linux/ptp_clock_kernel.h>
 
@@ -858,7 +859,7 @@ static int aq_set_ringparam(struct net_device *ndev,
 
        if (netif_running(ndev)) {
                ndev_running = true;
-               dev_close(ndev);
+               aq_ndev_close(ndev);
        }
 
        cfg->rxds = max(ring->rx_pending, hw_caps->rxds_min);
@@ -874,7 +875,7 @@ static int aq_set_ringparam(struct net_device *ndev,
                goto err_exit;
 
        if (ndev_running)
-               err = dev_open(ndev, NULL);
+               err = aq_ndev_open(ndev);
 
 err_exit:
        return err;
index 8a0af371e7dc7a0c865ac0f145b2fe02f114b177..77609dc0a08d6021c55645becd73732dd815dcd9 100644 (file)
@@ -58,7 +58,7 @@ struct net_device *aq_ndev_alloc(void)
        return ndev;
 }
 
-static int aq_ndev_open(struct net_device *ndev)
+int aq_ndev_open(struct net_device *ndev)
 {
        struct aq_nic_s *aq_nic = netdev_priv(ndev);
        int err = 0;
@@ -88,7 +88,7 @@ err_exit:
        return err;
 }
 
-static int aq_ndev_close(struct net_device *ndev)
+int aq_ndev_close(struct net_device *ndev)
 {
        struct aq_nic_s *aq_nic = netdev_priv(ndev);
        int err = 0;
index 99870865f66dbc7caedadac00818f077363e2b24..a78c1a168d8efbb358ecedfff1a4c2d63a287eaf 100644 (file)
@@ -16,5 +16,7 @@ DECLARE_STATIC_KEY_FALSE(aq_xdp_locking_key);
 
 void aq_ndev_schedule_work(struct work_struct *work);
 struct net_device *aq_ndev_alloc(void);
+int aq_ndev_open(struct net_device *ndev);
+int aq_ndev_close(struct net_device *ndev);
 
 #endif /* AQ_MAIN_H */