From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Pravin B Shelar <pshelar@nicira.com>,
Jiri Benc <jbenc@redhat.com>, Jesse Gross <jesse@nicira.com>
Subject: Re: [PATCH net] geneve: initialize needed_headroom
Date: Wed, 23 Dec 2015 16:35:13 +0100 [thread overview]
Message-ID: <567ABF31.8080306@stressinduktion.org> (raw)
In-Reply-To: <c891d011ef98267cd72157a5b01c78347ada8d8e.1450883640.git.pabeni@redhat.com>
On 23.12.2015 16:21, Paolo Abeni wrote:
> Currently the needed_headroom field for the geneve device is left
> to the default value.
>
> This patch set it to space required for basic geneve encapsulation,
> so that we can avoid the skb head re-allocation on xmit.
>
> This give a 6% speedup for unsegment traffic on geneve tunnel.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
(Sorry, just saw this.)
> ---
> drivers/net/geneve.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
> index c2b79f5..bb3e6ed 100644
> --- a/drivers/net/geneve.c
> +++ b/drivers/net/geneve.c
> @@ -1155,7 +1155,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
> struct geneve_net *gn = net_generic(net, geneve_net_id);
> struct geneve_dev *t, *geneve = netdev_priv(dev);
> bool tun_collect_md, tun_on_same_port;
> - int err;
> + int err, encap_len;
>
> if (!remote)
> return -EINVAL;
> @@ -1187,6 +1187,14 @@ static int geneve_configure(struct net *net, struct net_device *dev,
> if (t)
> return -EBUSY;
>
> + /* make enough headroom for basic scenario */
> + encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
> + if (remote->sa.sa_family == AF_INET)
> + encap_len += sizeof(struct iphdr);
> + else
> + encap_len += sizeof(struct ipv6hdr);
> + dev->needed_headroom = encap_len;
> +
We are missing one time ETH_HLEN or hard_header_len of the lower_dev (if
available) in here AFAIK.
Thanks,
Hannes
next prev parent reply other threads:[~2015-12-23 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 15:21 [PATCH net] geneve: initialize needed_headroom Paolo Abeni
2015-12-23 15:27 ` John W. Linville
2015-12-23 15:35 ` Hannes Frederic Sowa [this message]
2015-12-23 15:39 ` Paolo Abeni
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=567ABF31.8080306@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=davem@davemloft.net \
--cc=jbenc@redhat.com \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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 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).