mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
gro: __napi_gro_receive() optimizations
compare_ether_header() can have a special implementation on 64 bit arches if CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is defined. __napi_gro_receive() and vlan_gro_common() can avoid a conditional branch to perform device match. On x86_64, __napi_gro_receive() has now 38 instructions instead of 53 As gcc-4.4.3 still choose to not inline it, add inline keyword to this performance critical function. Signed-off-by: Eric Dumazet <[email protected]> CC: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
250ad8f55c
commit
40d0802b3e
3 changed files with 29 additions and 8 deletions
|
|
@ -105,9 +105,12 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
|
|||
goto drop;
|
||||
|
||||
for (p = napi->gro_list; p; p = p->next) {
|
||||
NAPI_GRO_CB(p)->same_flow =
|
||||
p->dev == skb->dev && !compare_ether_header(
|
||||
skb_mac_header(p), skb_gro_mac_header(skb));
|
||||
unsigned long diffs;
|
||||
|
||||
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
|
||||
diffs |= compare_ether_header(skb_mac_header(p),
|
||||
skb_gro_mac_header(skb));
|
||||
NAPI_GRO_CB(p)->same_flow = !diffs;
|
||||
NAPI_GRO_CB(p)->flush = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue