mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
net: use indirect calls helpers at early demux stage
So that we avoid another indirect call per RX packet, if early demux is enabled. Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
0e219ae48c
commit
97ff7ffb11
4 changed files with 10 additions and 4 deletions
|
|
@ -309,6 +309,8 @@ drop:
|
|||
return true;
|
||||
}
|
||||
|
||||
INDIRECT_CALLABLE_DECLARE(int udp_v4_early_demux(struct sk_buff *));
|
||||
INDIRECT_CALLABLE_DECLARE(int tcp_v4_early_demux(struct sk_buff *));
|
||||
static int ip_rcv_finish_core(struct net *net, struct sock *sk,
|
||||
struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
|
|
@ -326,7 +328,8 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,
|
|||
|
||||
ipprot = rcu_dereference(inet_protos[protocol]);
|
||||
if (ipprot && (edemux = READ_ONCE(ipprot->early_demux))) {
|
||||
err = edemux(skb);
|
||||
err = INDIRECT_CALL_2(edemux, tcp_v4_early_demux,
|
||||
udp_v4_early_demux, skb);
|
||||
if (unlikely(err))
|
||||
goto drop_error;
|
||||
/* must reload iph, skb->head might have changed */
|
||||
|
|
|
|||
Loading…
Reference in a new issue