Subject: Re: [PATCH net-next RFC 7/8] udp: gro behind static key

From: Subash Abhinov Kasiviswanathan <[email-masked]>
Date: Fri, 14 Sep 2018 21:37:24 -0600

On 2018-09-14 11:59, Willem de Bruijn wrote:
> From: Willem de Bruijn <[email-masked]>
> 
> Avoid the socket lookup cost in udp_gro_receive if no socket has a
> gro callback configured.
> 
> Signed-off-by: Willem de Bruijn <[email-masked]>
> 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