From: Joe Perches <joe@perches.com>
To: Ding Tianhong <dingtianhong@huawei.com>
Cc: Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>,
Julia Lawall <julia.lawall@lip6.fr>,
Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] vlan: slight optimization for vlan
Date: Tue, 04 Mar 2014 07:50:05 -0800 [thread overview]
Message-ID: <1393948205.20435.28.camel@joe-AO722> (raw)
In-Reply-To: <5315AF42.8030905@huawei.com>
On Tue, 2014-03-04 at 18:47 +0800, Ding Tianhong wrote:
> Ether_addr_equal_64bits is more efficient than ether_addr_equal, and
> can be used when each argument is an array within a structure that
> contains at least two bytes of data beyond the array, so it is safe
> to use it for vlan.
Perhaps I wasn't clear or perhaps you simply disagree,
(which is certainly your right), but I think that
ether_addr_equal_64bits should _only_ be used in
performance sensitive paths because using it requires
a person/script to analyze surrounding structures to
ensure 2 bytes exist after the address.
I don't think that vlan_dev_(open|stop|set_mac_address)
are performance sensitive paths.
vlan_do_receive, absolutely yes.
Is the vlan_device_event:NETDEV_CHANGEADDR:vlan_sync_address
path that frequent? Maybe.
> On a simple test by iperf, it reduces the CPU %system time from 14% to 12%.
> According Joe's suggestion, maybe it'd be faster to add an unlikely to
> the test for PCKET_OTHERHOST, so I add it and see whether the performance
> could be better, but the differences is so small and negligible, maybe my
> test case is not effective enough, but I still add the unlikely and wait to
> hear more opinions.:)
A separate patch for the unlikely would likely be better,
but I wonder what your test case is.
I presume a single stream of identical vlan PACKET_OTHERHOST
packets is atypical.
next prev parent reply other threads:[~2014-03-04 15:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 10:47 [PATCH net-next] vlan: slight optimization for vlan Ding Tianhong
2014-03-04 15:50 ` Joe Perches [this message]
2014-03-05 1:13 ` Ding Tianhong
2014-03-05 6:11 ` Ding Tianhong
2014-03-04 21:24 ` 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=1393948205.20435.28.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=dingtianhong@huawei.com \
--cc=julia.lawall@lip6.fr \
--cc=kaber@trash.net \
--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