netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] A few minor clean-ups to eth_type_trans
@ 2015-04-30 21:53 Alexander Duyck
  2015-04-30 21:53 ` [PATCH 1/3] etherdev: Avoid unnecessary byte swap in check for Ethertype Alexander Duyck
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Alexander Duyck @ 2015-04-30 21:53 UTC (permalink / raw)
  To: netdev; +Cc: davem

This series addresses a few minor issues I found in eth_type_trans that
that allow us to gain back something like 3 or more cycles per packet.  

The first change is to drop the byte swap since it isn't necessary.  On x86
we could just check the first byte and compare that against the upper 8
bits of the Ethertype to determine if we are dealing with a size value or
not.

The second makes it so that the value we read in to test for multicast can
be used for the address comparison.  This allows us to avoid a second read
of the destination address.

The final change is to avoid some unneeded instructions in computing the
Ethernet header pointer.  When we start the call the Ethernet header is at
skb->data, so we just use that rather than computing mac_header, and then
adding that back to skb->head.

---

Alexander Duyck (3):
      etherdev: Avoid unnecessary byte swap in check for Ethertype
      etherdev: Process is_multicast_ether_addr at same size as other operations
      etherdev: Use skb->data to retrieve Ethernet header instead of eth_hdr


 include/linux/etherdevice.h |   24 +++++++++++++++++++++++-
 net/ethernet/eth.c          |    7 ++++---
 2 files changed, 27 insertions(+), 4 deletions(-)

--

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-05-04  2:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-30 21:53 [PATCH 0/3] A few minor clean-ups to eth_type_trans Alexander Duyck
2015-04-30 21:53 ` [PATCH 1/3] etherdev: Avoid unnecessary byte swap in check for Ethertype Alexander Duyck
2015-04-30 23:03   ` Eric Dumazet
2015-04-30 23:24     ` Alexander Duyck
2015-05-01  0:13       ` Eric Dumazet
2015-05-01  0:41         ` Alexander Duyck
2015-04-30 21:53 ` [PATCH 2/3] etherdev: Process is_multicast_ether_addr at same size as other operations Alexander Duyck
2015-04-30 21:53 ` [PATCH 3/3] etherdev: Use skb->data to retrieve Ethernet header instead of eth_hdr Alexander Duyck
2015-04-30 22:35 ` [PATCH 0/3] A few minor clean-ups to eth_type_trans Alexei Starovoitov
2015-04-30 23:11   ` Alexander Duyck
2015-05-01 11:30     ` David Laight
2015-05-01 15:34       ` Alexander Duyck
2015-05-04  2:47 ` David Miller

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).