Thread (30 messages) 30 messages, 4 authors, 2024-10-15

Re: [PATCH net-next v7 06/12] net: vxlan: make vxlan_snoop() return drop reasons

From: Ido Schimmel <idosch@nvidia.com>
Date: 2024-10-13 11:41:03
Also in: lkml

On Wed, Oct 09, 2024 at 10:28:24AM +0800, Menglong Dong wrote:
Change the return type of vxlan_snoop() from bool to enum
skb_drop_reason. In this commit, two drop reasons are introduced:

  SKB_DROP_REASON_MAC_INVALID_SOURCE
  SKB_DROP_REASON_VXLAN_ENTRY_EXISTS

Signed-off-by: Menglong Dong <redacted>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>

IMO the second reason is quite obscure and unlikely to be very useful,
but time will tell. The closest thing in the bridge driver is 802.1X /
MAB support (see "locked" and "mab" bridge link attributes in "man
bridge"), but I don't think it's close enough to allow us making this
reason more generic.

[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 34b44755f663..1a81a3957327 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -1437,9 +1437,10 @@ static int vxlan_fdb_get(struct sk_buff *skb,
  * and Tunnel endpoint.
  * Return true if packet is bogus and should be dropped.
The last line is no longer correct so please remove it in a follow up
patch (unless you need another version).
  */
-static bool vxlan_snoop(struct net_device *dev,
-			union vxlan_addr *src_ip, const u8 *src_mac,
-			u32 src_ifindex, __be32 vni)
+static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
+					union vxlan_addr *src_ip,
+					const u8 *src_mac, u32 src_ifindex,
+					__be32 vni)
 {
 	struct vxlan_dev *vxlan = netdev_priv(dev);
 	struct vxlan_fdb *f;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help