提交 1ba15e7a 编写于 作者: I Izabela Bakollari 提交者: sanglipeng

aquantia: Do not purge addresses when setting the number of rings

stable inclusion
from stable-v5.10.158
commit 6922948c2ec1cc45b11acb8ec2eeb3a8353d572b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6922948c2ec1cc45b11acb8ec2eeb3a8353d572b

--------------------------------

[ Upstream commit 2a838911 ]

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: c1af5427 ("net: aquantia: Ethtool based ring size configuration")
Signed-off-by: NIzabela Bakollari <ibakolla@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 df912cde
......@@ -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>
......@@ -849,7 +850,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);
......@@ -865,7 +866,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;
......
......@@ -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 @@ static int aq_ndev_open(struct net_device *ndev)
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;
......
......@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册