From: Shrikrishna Khare <skhare@vmware.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: sbhatewara@vmware.com, pv-drivers@vmware.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Amitabha Banerjee <banerjeea@vmware.com>
Subject: Re: [PATCH net-next] Driver: Vmxnet3: Copy TCP header to mapped frame for IPv6 packets
Date: Sat, 28 Feb 2015 19:16:00 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.02.1502281846330.20149@shri-linux.eng.vmware.com> (raw)
In-Reply-To: <54F24ACC.7020108@cogentembedded.com>
On Sat, 28 Feb 2015, Sergei Shtylyov wrote:
> Hello.
>
> On 02/28/2015 10:58 PM, Shrikrishna Khare wrote:
>
> > Allows for packet parsing to be done by the fast path. This performance
> > optimization already exists for IPv4. Add similar logic for IPv6.
>
> > Signed-off-by: Amitabha Banerjee <banerjeea@vmware.com>
> > Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
> > ---
> > drivers/net/vmxnet3/vmxnet3_drv.c | 26 ++++++++++++++++----------
> > drivers/net/vmxnet3/vmxnet3_int.h | 5 +++--
> > 2 files changed, 19 insertions(+), 12 deletions(-)
>
> > diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c
> > b/drivers/net/vmxnet3/vmxnet3_drv.c
> > index 294214c..9216e6a 100644
> > --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> > +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> [...]
> > @@ -831,16 +832,20 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct
> > vmxnet3_tx_queue *tq,
> > if (ctx->ipv4) {
> > const struct iphdr *iph = ip_hdr(skb);
> >
> > - if (iph->protocol == IPPROTO_TCP)
> > - ctx->l4_hdr_size = tcp_hdrlen(skb);
> > - else if (iph->protocol == IPPROTO_UDP)
> > - ctx->l4_hdr_size = sizeof(struct
> > udphdr);
> > - else
> > - ctx->l4_hdr_size = 0;
> > - } else {
> > - /* for simplicity, don't copy L4 headers */
> > - ctx->l4_hdr_size = 0;
> > + protocol = iph->protocol;
> > + } else if (ctx->ipv6) {
> > + const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
> > +
> > + protocol = ipv6h->nexthdr;
> > }
> > +
> > + if (protocol == IPPROTO_TCP)
> > + ctx->l4_hdr_size = tcp_hdrlen(skb);
> > + else if (protocol == IPPROTO_UDP)
> > + ctx->l4_hdr_size = sizeof(struct udphdr);
> > + else
> > + ctx->l4_hdr_size = 0;
> > +
>
> I think the above is asking to be a 'switch (protocol)' instead.
>
> WBR, Sergei
>
>
Thanks for the review, Sergei. Would fix it, and resubmit the patch.
Thanks,
Shri
next prev parent reply other threads:[~2015-03-01 3:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 19:58 Shrikrishna Khare
2015-02-28 23:10 ` Sergei Shtylyov
2015-03-01 3:16 ` Shrikrishna Khare [this message]
2015-03-01 4:33 Shrikrishna Khare
2015-03-02 4:04 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.02.1502281846330.20149@shri-linux.eng.vmware.com \
--to=skhare@vmware.com \
--cc=banerjeea@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pv-drivers@vmware.com \
--cc=sbhatewara@vmware.com \
--cc=sergei.shtylyov@cogentembedded.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome