[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK+XE==Yn+HyWUtcNNv-GuG5N1y6_UMxC_9brnorpG3Kz2qFyA@mail.gmail.com>
Date: Mon, 17 Jun 2019 23:09:26 +0100
From: John Hurley <john.hurley@...ronome.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Jiri Pirko <jiri@...lanox.com>,
Davide Caratti <dcaratti@...hat.com>,
Simon Horman <simon.horman@...ronome.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
oss-drivers@...ronome.com
Subject: Re: [PATCH net-next v2 1/3] net: sched: add mpls manipulation actions
to TC
On Mon, Jun 17, 2019 at 10:18 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
>
> On Fri, Jun 14, 2019 at 3:56 PM John Hurley <john.hurley@...ronome.com> wrote:
> >
> > On Fri, Jun 14, 2019 at 5:59 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
> > >
> > > On Thu, Jun 13, 2019 at 10:44 AM John Hurley <john.hurley@...ronome.com> wrote:
> > > > +static inline void tcf_mpls_set_eth_type(struct sk_buff *skb, __be16 ethertype)
> > > > +{
> > > > + struct ethhdr *hdr = eth_hdr(skb);
> > > > +
> > > > + skb_postpull_rcsum(skb, &hdr->h_proto, ETH_TLEN);
> > > > + hdr->h_proto = ethertype;
> > > > + skb_postpush_rcsum(skb, &hdr->h_proto, ETH_TLEN);
> > >
> > > So you just want to adjust the checksum with the new ->h_proto
> > > value. please use a right csum API, rather than skb_post*_rcsum().
> > >
> >
> > Hi Cong,
> > Yes, I'm trying to maintain the checksum value if checksum complete
> > has been set.
> > The function above pulls the old eth type out of the checksum value
> > (if it is checksum complete), updates the eth type, and pushes the new
> > eth type into the checksum.
> > This passes my tests on the checksum.
> > I couldn't see an appropriate function to do this other than
> > recalculating the whole thing.
> > Maybe I missed something?
>
> I never say it is wrong, I mean to say using a csum API is more
> clear. Please look into checksum API's, there are many options
> for different scenarios, there must be one serves your purpose.
>
Ok, I'll have another look here and see if I can get something more appropriate.
Thanks
> Thanks.
Powered by blists - more mailing lists