Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5737cba authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller
Browse files

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: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b52d031b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);
		}
}