netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Stringer <joestringer@nicira.com>
To: Or Gerlitz <gerlitz.or@gmail.com>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCHv2 net 1/4] net: Add vxlan_gso_check() helper
Date: Mon, 17 Nov 2014 16:26:00 -0800	[thread overview]
Message-ID: <201411171626.00771.joestringer@nicira.com> (raw)
In-Reply-To: <CAJ3xEMhwq2Cuiw8sjY3DHFBEdmgKieNZgxWhGsfZ=Rtz41KhTQ@mail.gmail.com>

On Sunday, November 16, 2014 01:35:52 Or Gerlitz wrote:
> On Fri, Nov 14, 2014 at 2:38 AM, Joe Stringer <joestringer@nicira.com> 
wrote:
> > Most NICs that report NETIF_F_GSO_UDP_TUNNEL support VXLAN, and not
> > other UDP-based encapsulation protocols where the format and size of the
> > header differs. This patch implements a generic ndo_gso_check() for
> > VXLAN which will only advertise GSO support when the skb looks like it
> > contains VXLAN (or no UDP tunnelling at all).
> > 
> > Implementation shamelessly stolen from Tom Herbert:
> > http://thread.gmane.org/gmane.linux.network/332428/focus=333111
> > 
> > Signed-off-by: Joe Stringer <joestringer@nicira.com>
> > ---
> > v2: Merge helpers for be2net, mlx4, qlcnic
> > 
> >     Use (sizeof(struct udphdr) + sizeof(struct vxlanhdr))
> > 
> > v1: Initial post
> > ---
> > 
> >  drivers/net/vxlan.c |   13 +++++++++++++
> >  include/net/vxlan.h |    2 ++
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> > index fa9dc45..6b65863 100644
> > --- a/drivers/net/vxlan.c
> > +++ b/drivers/net/vxlan.c
> > @@ -1571,6 +1571,19 @@ static bool route_shortcircuit(struct net_device
> > *dev, struct sk_buff *skb)
> > 
> >         return false;
> >  
> >  }
> > 
> > +bool vxlan_gso_check(struct sk_buff *skb)
> > +{
> > +       if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
> > +           (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
> > +            skb->inner_protocol != htons(ETH_P_TEB) ||
> > +            (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
> > +             sizeof(struct udphdr) + sizeof(struct vxlanhdr))))
> > +               return false;
> > +
> > +       return true;
> > +}
> > +EXPORT_SYMBOL_GPL(vxlan_gso_check);
> 
> Joe, any chance you can make the extra step and inline that in
> vxlan.h? this is fast path call... you will only need to move struct
> vxlanhdr there too.

Thanks for looking this over, I sent a patch.

  reply	other threads:[~2014-11-18  0:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14  0:38 [PATCHv2 net 0/4] Implement ndo_gso_check() for vxlan nics Joe Stringer
2014-11-14  0:38 ` [PATCHv2 net 1/4] net: Add vxlan_gso_check() helper Joe Stringer
2014-11-16  9:35   ` Or Gerlitz
2014-11-18  0:26     ` Joe Stringer [this message]
2014-11-14  0:38 ` [PATCHv2 net 2/4] be2net: Implement ndo_gso_check() Joe Stringer
2014-11-14  9:43   ` Sathya Perla
2014-11-14  0:38 ` [PATCHv2 net 3/4] net/mlx4_en: " Joe Stringer
2014-11-16  9:32   ` Or Gerlitz
2014-11-14  0:38 ` [PATCHv2 net 4/4] qlcnic: " Joe Stringer
2014-11-14  5:08   ` Shahed Shaikh
2014-11-14 22:13 ` [PATCHv2 net 0/4] Implement ndo_gso_check() for vxlan nics David Miller
2014-11-17 17:50   ` Joe Stringer

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=201411171626.00771.joestringer@nicira.com \
    --to=joestringer@nicira.com \
    --cc=gerlitz.or@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).