diff options
author | Paolo Abeni <pabeni@redhat.com> | 2019-05-03 17:01:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-05 10:38:04 -0700 |
commit | f5737cbadb7d07c4f71fc5f073ccc7d8d8985a8f (patch) | |
tree | 9c6fc149d937c966be2681359cd3b39127e1c263 | |
parent | b52d031b8de496c39e0ba1b8cf5292ad8e4ae4fe (diff) | |
download | linux-f5737cbadb7d07c4f71fc5f073ccc7d8d8985a8f.tar.gz linux-f5737cbadb7d07c4f71fc5f073ccc7d8d8985a8f.tar.bz2 linux-f5737cbadb7d07c4f71fc5f073ccc7d8d8985a8f.zip |
net: use indirect calls helpers for ptype hook
This avoids an indirect call per RX IPv6/IPv4 packet.
Note that we don't want to use the indirect calls helper for taps.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 22f2640f559a..108ac8137b9b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4987,7 +4987,8 @@ static int __netif_receive_skb_one_core(struct sk_buff *skb, bool pfmemalloc) ret = __netif_receive_skb_core(skb, pfmemalloc, &pt_prev); if (pt_prev) - ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); + ret = INDIRECT_CALL_INET(pt_prev->func, ipv6_rcv, ip_rcv, skb, + skb->dev, pt_prev, orig_dev); return ret; } @@ -5033,7 +5034,8 @@ static inline void __netif_receive_skb_list_ptype(struct list_head *head, else list_for_each_entry_safe(skb, next, head, list) { skb_list_del_init(skb); - pt_prev->func(skb, skb->dev, pt_prev, orig_dev); + INDIRECT_CALL_INET(pt_prev->func, ipv6_rcv, ip_rcv, skb, + skb->dev, pt_prev, orig_dev); } } |