netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v6 2/2] net: ip, ipv6: handle gso skbs in forwarding path
Date: Mon, 24 Feb 2014 00:51:52 +0100	[thread overview]
Message-ID: <20140223235152.GF6598@order.stressinduktion.org> (raw)
In-Reply-To: <1392329352-31606-2-git-send-email-fw@strlen.de>

On Thu, Feb 13, 2014 at 11:09:12PM +0100, Florian Westphal wrote:
> +/* called if GSO skb needs to be fragmented on forward */
> +static int ip_forward_finish_gso(struct sk_buff *skb)
> +{
> +	struct dst_entry *dst = skb_dst(skb);
> +	netdev_features_t features;
> +	struct sk_buff *segs;
> +	int ret = 0;
> +
> +	features = netif_skb_dev_features(skb, dst->dev);
> +	segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);

While reviewing the skb->encapsulation logic I noticed that some drivers
(mlx4 and i40e, i40evf) already started to set skb->encapsulation = 1 in
the receive path.

Maybe it would be helpful to reset skb->encapsulation to zero before
segmentation happens so we don't miss to update the fragmentation ids and
offsets on udp packets?

> +	if (IS_ERR(segs)) {
> +		kfree_skb(skb);
> +		return -ENOMEM;
> +	}
> +
> +	consume_skb(skb);
> +
> +	do {
> +		struct sk_buff *nskb = segs->next;
> +		int err;
> +
> +		segs->next = NULL;
> +		err = dst_output(segs);
> +
> +		if (err && ret == 0)
> +			ret = err;
> +		segs = nskb;
> +	} while (segs);
> +
> +	return ret;
> +}
> +

Bye,

  Hannes

  parent reply	other threads:[~2014-02-23 23:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 22:09 [PATCH v2 1/2] net: core: introduce netif_skb_dev_features Florian Westphal
2014-02-13 22:09 ` [PATCH v6 2/2] net: ip, ipv6: handle gso skbs in forwarding path Florian Westphal
2014-02-13 22:17   ` David Miller
2014-02-23 23:51   ` Hannes Frederic Sowa [this message]
2014-02-13 22:17 ` [PATCH v2 1/2] net: core: introduce netif_skb_dev_features 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=20140223235152.GF6598@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=fw@strlen.de \
    --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).