All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH net-next 2/2] net: switchdev: recurse into __switchdev_handle_fdb_del_to_device
Date: Tue, 20 Jul 2021 20:35:57 +0300	[thread overview]
Message-ID: <20210720173557.999534-3-vladimir.oltean@nxp.com> (raw)
In-Reply-To: <20210720173557.999534-1-vladimir.oltean@nxp.com>

The difference between __switchdev_handle_fdb_del_to_device and
switchdev_handle_del_to_device is that the former takes an extra
orig_dev argument, while the latter starts with dev == orig_dev.

We should recurse into the variant that does not lose the orig_dev along
the way. This is relevant when deleting FDB entries pointing towards a
bridge (dev changes to the lower interfaces, but orig_dev shouldn't).

The addition helper already recurses properly, just the deletion one
doesn't.

Fixes: 8ca07176ab00 ("net: switchdev: introduce a fanout helper for SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/switchdev/switchdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 82dd4e4e86f5..42e88d3d66a7 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -532,10 +532,10 @@ static int __switchdev_handle_fdb_del_to_device(struct net_device *dev,
 		if (netif_is_bridge_master(lower_dev))
 			continue;
 
-		err = switchdev_handle_fdb_del_to_device(lower_dev, fdb_info,
-							 check_cb,
-							 foreign_dev_check_cb,
-							 del_cb, lag_del_cb);
+		err = __switchdev_handle_fdb_del_to_device(lower_dev, orig_dev,
+							   fdb_info, check_cb,
+							   foreign_dev_check_cb,
+							   del_cb, lag_del_cb);
 		if (err && err != -EOPNOTSUPP)
 			return err;
 	}
-- 
2.25.1


  parent reply	other threads:[~2021-07-20 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 17:35 [PATCH net-next 0/2] Fixes for the switchdev FDB fan-out helpers Vladimir Oltean
2021-07-20 17:35 ` [PATCH net-next 1/2] net: switchdev: remove stray semicolon in switchdev_handle_fdb_del_to_device shim Vladimir Oltean
2021-07-21  7:57   ` Matthieu Baerts
2021-07-20 17:35 ` Vladimir Oltean [this message]
2021-07-21 15:10 ` [PATCH net-next 0/2] Fixes for the switchdev FDB fan-out helpers patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210720173557.999534-3-vladimir.oltean@nxp.com \
    --to=vladimir.oltean@nxp.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.