From: Paolo Abeni <pabeni@redhat.com>
To: Yafang Shao <laoar.shao@gmail.com>,
edumazet@google.com, davem@davemloft.net
Cc: netdev@vger.kernel.org, inux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] ipv4: replace ip_hdr() with skb->data for optimization
Date: Tue, 05 Jun 2018 14:20:42 +0200 [thread overview]
Message-ID: <9ce783dc628699f02c45650c942f6735e93a18c4.camel@redhat.com> (raw)
In-Reply-To: <1528200262-11834-1-git-send-email-laoar.shao@gmail.com>
On Tue, 2018-06-05 at 08:04 -0400, Yafang Shao wrote:
> In ip receive path, when ip header hasn't been pulled yet, ip_hdr() and
> skb->data are pointing to the same byte.
>
> In ip output path, when ip header is just pushed, ip_hdr() and skb->data
> are pointing to the same byte.
>
> As ip_hdr() is more expensive than using skb->data, so replace ip_hdr()
> with skb->data in these situations for optimization.
IMHO this makes the code less readable and more error prone. Which kind
of performance improvement do you measure here?
Thanks,
Paolo
next prev parent reply other threads:[~2018-06-05 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 12:04 [PATCH net-next 1/2] ipv4: replace ip_hdr() with skb->data for optimization Yafang Shao
2018-06-05 12:04 ` [PATCH net-next 2/2] ipv6: " Yafang Shao
2018-06-05 12:20 ` Paolo Abeni [this message]
2018-06-05 12:29 ` [PATCH net-next 1/2] ipv4: " Yafang Shao
2018-06-05 15:08 ` 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=9ce783dc628699f02c45650c942f6735e93a18c4.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=inux-kernel@vger.kernel.org \
--cc=laoar.shao@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).