Skip to content

Commit

Permalink
nfp: clean mc addresses in application firmware when closing port
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2036075

commit cc7eab25b1cf3f9594fe61142d3523ce4d14a788 upstream.

When moving devices from one namespace to another, mc addresses are
cleaned in software while not removed from application firmware. Thus
the mc addresses are remained and will cause resource leak.

Now use `__dev_mc_unsync` to clean mc addresses when closing port.

Fixes: e20aa07 ("nfp: fix schedule in atomic context when sync mc address")
Cc: stable@vger.kernel.org
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Acked-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Message-ID: <20230705052818.7122-1-louis.peens@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
  • Loading branch information
zhangyinjun authored and roxanan1996 committed Sep 20, 2023
1 parent 55ae824 commit 206ba57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/netronome/nfp/nfp_net_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#include "crypto/crypto.h"
#include "crypto/fw.h"

static int nfp_net_mc_unsync(struct net_device *netdev, const unsigned char *addr);

/**
* nfp_net_get_fw_version() - Read and parse the FW version
* @fw_ver: Output fw_version structure to read to
Expand Down Expand Up @@ -1084,6 +1086,9 @@ static int nfp_net_netdev_close(struct net_device *netdev)

/* Step 2: Tell NFP
*/
if (nn->cap_w1 & NFP_NET_CFG_CTRL_MCAST_FILTER)
__dev_mc_unsync(netdev, nfp_net_mc_unsync);

nfp_net_clear_config_and_disable(nn);
nfp_port_configure(netdev, false);

Expand Down

0 comments on commit 206ba57

Please sign in to comment.