[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpXwKtT==DU3FhZ+HTc03TV7K0LcYEEXCUb6wTStospV4A@mail.gmail.com>
Date: Tue, 4 Jun 2019 10:41:58 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Eli Britstein <elibr@...lanox.com>
Cc: Davide Caratti <dcaratti@...hat.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
Jamal Hadi Salim <jhs@...atatu.com>,
"David S . Miller" <davem@...emloft.net>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Shuang Li <shuali@...hat.com>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH net v3 1/3] net/sched: act_csum: pull all VLAN headers
before checksumming
On Sat, Jun 1, 2019 at 9:22 PM Eli Britstein <elibr@...lanox.com> wrote:
>
>
> On 6/1/2019 1:50 AM, Cong Wang wrote:
> > On Fri, May 31, 2019 at 3:01 PM Davide Caratti <dcaratti@...hat.com> wrote:
> >> Please note: this loop was here also before this patch (the 'goto again;'
> >> line is only patch context). It has been introduced with commit
> >> 2ecba2d1e45b ("net: sched: act_csum: Fix csum calc for tagged packets").
> >>
> > This is exactly why I ask...
> >
> >
> >>> Why do you still need to loop here? tc_skb_pull_vlans() already
> >>> contains a loop to pop all vlan tags?
> >> The reason why the loop is here is:
> >> 1) in case there is a stripped vlan tag, it replaces tc_skb_protocol(skb)
> >> with the inner ethertype (i.e. skb->protocol)
> >>
> >> 2) in case there is one or more unstripped VLAN tags, it pulls them. At
> >> the last iteration, when it does:
> > Let me ask it in another way:
> >
> > The original code, without your patch, has a loop (the "goto again") to
> > pop all vlan tags.
> >
> > The code with your patch adds yet another loop (the while loop inside your
> > tc_skb_pull_vlans()) to pop all vlan tags.
> >
> > So, after your patch, we have both loops. So, I am confused why we need
> > these two nested loops to just pop all vlan tags? I think one is sufficient.
> After Davide's patch, the "goto again" is needed to re-enter the switch
> case, and guaranteed to be done only once, as all the VLAN tags were
> already pulled. The alternative is having a dedicated if before the switch.
Yeah, I think that can be simply moved before the switch so
that we don't have to use two loops, which should be easier to
understand too.
Thanks.
Powered by blists - more mailing lists