[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zwuxwavki0lL01Ox@shredder.mtl.com>
Date: Sun, 13 Oct 2024 14:40:49 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Menglong Dong <menglong8.dong@...il.com>
Cc: kuba@...nel.org, aleksander.lobakin@...el.com, horms@...nel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
dsahern@...nel.org, dongml2@...natelecom.cn, amcohen@...dia.com,
gnault@...hat.com, bpoirier@...dia.com, b.galvani@...il.com,
razor@...ckwall.org, petrm@...dia.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v7 06/12] net: vxlan: make vxlan_snoop() return
drop reasons
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 <dongml2@...natelecom.cn>
> Reviewed-by: Simon Horman <horms@...nel.org>
Reviewed-by: Ido Schimmel <idosch@...dia.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.
[...]
> 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;
Powered by blists - more mailing lists