All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Herbert <therbert@google.com>
To: Pravin B Shelar <pshelar@nicira.com>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] ip_tunnel: GSO: Add check for nested encap.
Date: Tue, 10 Jun 2014 08:34:07 -0700	[thread overview]
Message-ID: <CA+mtBx9aGBv0arWRdtZbDJpSuzBcan9FEJVRqW5NxJghJrCSVQ@mail.gmail.com> (raw)
In-Reply-To: <1401017972-1544-1-git-send-email-pshelar@nicira.com>

On Sun, May 25, 2014 at 4:39 AM, Pravin B Shelar <pshelar@nicira.com> wrote:
> Current networking stack can only handle single encap packet
> for GSO.  Following patch adds check for already encapsulated
> packet so that we can drop it.
>
We're going to need double encap to support UDP/GRE. The software
stack should be able to mostly work with multiple encapsulations (one
exception would be if there were multiple UDP encapsulations with
mixed enabling of checksums).  We could add GSO_SKB_SW for arbitrary
encapsulation combinations that  we know HW doesn't implement.

> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
> ---
>  net/ipv4/ip_tunnel_core.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
> index f4c987b..b150546 100644
> --- a/net/ipv4/ip_tunnel_core.c
> +++ b/net/ipv4/ip_tunnel_core.c
> @@ -122,12 +122,16 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb,
>  {
>         int err;
>
> -       if (likely(!skb->encapsulation)) {
> +       if (skb_is_gso(skb)) {
> +               if (unlikely(skb->encapsulation)) {
> +                       /* Current networking GSO stack can handle
> +                        * only one level of encapsulation. */
> +                       err = -ENOSYS;
> +                       goto error;
> +               }
>                 skb_reset_inner_headers(skb);
>                 skb->encapsulation = 1;
> -       }
>
> -       if (skb_is_gso(skb)) {
>                 err = skb_unclone(skb, GFP_ATOMIC);
>                 if (unlikely(err))
>                         goto error;
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-06-10 15:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25 11:39 [PATCH 1/2] ip_tunnel: GSO: Add check for nested encap Pravin B Shelar
2014-06-10 15:34 ` Tom Herbert [this message]
2014-06-12 15:32   ` Pravin Shelar
2014-06-12 17:48     ` Tom Herbert
2014-06-12 20:56       ` Pravin Shelar
2014-06-11  5:21 ` David Miller
2014-06-12 15:35   ` Pravin Shelar

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=CA+mtBx9aGBv0arWRdtZbDJpSuzBcan9FEJVRqW5NxJghJrCSVQ@mail.gmail.com \
    --to=therbert@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.