lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 31 May 2019 17:02:05 -0700 From: Eric Dumazet <eric.dumazet@...il.com> To: Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <eric.dumazet@...il.com> Subject: Re: [PATCH net-next 1/4] net: use indirect calls helpers for ptype hook On 5/3/19 8:01 AM, Paolo Abeni wrote: > 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@...hat.com> > --- > net/core/dev.c | 6 ++++-- > 1 file 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); IPv4 has ip_list_rcv() and IPv6 has ipv6_list_rcv(), so the code invoking ->list_func() should run, meaning this part of the patch was not needed. if (pt_prev->list_func != NULL) pt_prev->list_func(head, pt_prev, orig_dev); Maybe you want instead have INDIRECT_CALL_INET() for the list_func() calls.
Powered by blists - more mailing lists