[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADxym3bkVFApps1wJpSQME=WcN_Xy1_biL94TZyhQucBHaRc5w@mail.gmail.com>
Date: Sun, 1 Sep 2024 20:47:27 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: idosch@...dia.com, 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 v2 06/12] net: vxlan: make vxlan_set_mac() return
drop reasons
On Sat, Aug 31, 2024 at 7:26 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Fri, 30 Aug 2024 09:59:55 +0800 Menglong Dong wrote:
> > -static bool vxlan_set_mac(struct vxlan_dev *vxlan,
> > - struct vxlan_sock *vs,
> > - struct sk_buff *skb, __be32 vni)
> > +static enum skb_drop_reason vxlan_set_mac(struct vxlan_dev *vxlan,
> > + struct vxlan_sock *vs,
> > + struct sk_buff *skb, __be32 vni)
> > {
> > union vxlan_addr saddr;
> > u32 ifindex = skb->dev->ifindex;
> > @@ -1620,7 +1620,7 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan,
> >
> > /* Ignore packet loops (and multicast echo) */
> > if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
> > - return false;
> > + return (u32)VXLAN_DROP_INVALID_SMAC;
>
> It's the MAC address of the local interface, not just invalid...
>
Yeah, my mistake. It seems that we need to add a
VXLAN_DROP_LOOP_SMAC here? I'm not sure if it is worth here,
or can we reuse VXLAN_DROP_INVALID_SMAC here too?
> > /* Get address from the outer IP header */
> > if (vxlan_get_sk_family(vs) == AF_INET) {
> > @@ -1635,9 +1635,9 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan,
> >
> > if ((vxlan->cfg.flags & VXLAN_F_LEARN) &&
> > vxlan_snoop(skb->dev, &saddr, eth_hdr(skb)->h_source, ifindex, vni))
> > - return false;
> > + return (u32)VXLAN_DROP_ENTRY_EXISTS;
>
> ... because it's vxlan_snoop() that checks:
>
> if (!is_valid_ether_addr(src_mac))
It seems that we need to make vxlan_snoop() return skb drop reasons
too, and we need to add a new patch, which makes this series too many
patches. Any advice?
I'll see if I can combine some of them into one.
Thanks!
Menglong Dong
> --
> pw-bot: cr
Powered by blists - more mailing lists