]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:56 +0000 (11:23 +0100)
[ Upstream commit 2a83891130512dafb321418a8e7c9c09268d8c59 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 de2a9348bc3f87c6a1804b7c4c4a2c706cfd029b..1d512e6a89f5cd0ef210bb7f8f35b56d12cc0a6c 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>
 
@@ -841,7 +842,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);
@@ -857,7 +858,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 ff245f75fa3d156c0b8b2349c1d152fcb8933e5c..1401fc4632b5175be343149421cc5eecc602bd62 100644 (file)
@@ -53,7 +53,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;
@@ -83,7 +83,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 a5a624b9ce73365bbcaf613be0ea9b5236dae296..2a562ab7a5afdb94662044406fb4ca3cea92da60 100644 (file)
@@ -14,5 +14,7 @@
 
 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 */