]> git.baikalelectronics.ru Git - kernel.git/commit
etherdev: Use skb->data to retrieve Ethernet header instead of eth_hdr
authorAlexander Duyck <alexander.h.duyck@redhat.com>
Thu, 30 Apr 2015 21:53:59 +0000 (14:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2015 02:30:36 +0000 (22:30 -0400)
commit62661c59f8fb7aa04a692e8d485483ff828a39b8
tree3f5fe450644b92d062c9e6f52a56e9e50bcec8f5
parent172aa6eebd064582252cfa832d1778ab1c374a99
etherdev: Use skb->data to retrieve Ethernet header instead of eth_hdr

Avoid recomputing the Ethernet header location and instead just use the
pointer provided by skb->data.  The problem with using eth_hdr is that the
compiler wasn't smart enough to realize that skb->head + skb->mac_header
was the same thing as skb->data before it added ETH_HLEN.  By just caching
it off before calling skb_pull_inline we can avoid a few unnecessary
instructions.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethernet/eth.c