From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subash Abhinov Kasiviswanathan Subject: Re: [PATCH net-next RFC 7/8] udp: gro behind static key Date: Fri, 14 Sep 2018 21:37:24 -0600 Message-ID: References: <20180914175941.213950-1-willemdebruijn.kernel@gmail.com> <20180914175941.213950-8-willemdebruijn.kernel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, pabeni@redhat.com, steffen.klassert@secunet.com, davem@davemloft.net, Willem de Bruijn To: Willem de Bruijn Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:56692 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbeIOIyt (ORCPT ); Sat, 15 Sep 2018 04:54:49 -0400 In-Reply-To: <20180914175941.213950-8-willemdebruijn.kernel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On 2018-09-14 11:59, Willem de Bruijn wrote: > From: Willem de Bruijn > > Avoid the socket lookup cost in udp_gro_receive if no socket has a > gro callback configured. > > Signed-off-by: Willem de Bruijn > diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c > index 4f6aa95a9b12..f44fe328aa0f 100644 > --- a/net/ipv4/udp_offload.c > +++ b/net/ipv4/udp_offload.c > @@ -405,7 +405,7 @@ static struct sk_buff *udp4_gro_receive(struct > list_head *head, > { > struct udphdr *uh = udp_gro_udphdr(skb); > > - if (unlikely(!uh)) > + if (unlikely(!uh) || > !static_branch_unlikely(&udp_encap_needed_key)) > goto flush; > Hi Willem Does this need to be diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 6dd3f0a..fcd5589 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -407,7 +407,7 @@ static struct sk_buff *udp4_gro_receive(struct list_head *head, { struct udphdr *uh = udp_gro_udphdr(skb); - if (unlikely(!uh) || !static_branch_unlikely(&udp_encap_needed_key)) + if (unlikely(!uh) || static_branch_unlikely(&udp_encap_needed_key)) goto flush; /* Don't bother verifying checksum if we're going to flush anyway. */ I tried setting UDP_GRO socket option and I had to make this change to exercise the udp_gro_receive_cb code path. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project