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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52CE40E2.7040408@mellanox.com>
Date:	Thu, 9 Jan 2014 08:25:38 +0200
From:	Or Gerlitz <ogerlitz@...lanox.com>
To:	Tom Herbert <therbert@...gle.com>
CC:	Jerry Chu <hkchu@...gle.com>, Eric Dumazet <edumazet@...gle.com>,
	"Herbert Xu" <herbert@...dor.apana.org.au>,
	Linux Netdev List <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	Yan Burman <yanb@...lanox.com>,
	"Shlomo Pongratz" <shlomop@...lanox.com>
Subject: Re: [PATCH net-next V3 1/3] net: Add GRO support for UDP encapsulating
 protocols

On 08/01/2014 23:58, Tom Herbert wrote:
>> +static struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
>> >+{
>> >+       struct list_head *ohead = &udp_offload_base;
>> >+       struct udp_offload *poffload;
>> >+       struct sk_buff *p, **pp = NULL;
>> >+       struct udphdr *uh, *uh2;
>> >+       unsigned int hlen, off;
>> >+       int flush = 1;
>> >+
>> >+       if (NAPI_GRO_CB(skb)->udp_mark ||
>> >+           (!skb->encapsulation && skb->ip_summed != CHECKSUM_COMPLETE))
>> >+               goto out;
>> >+
>> >+       /* mark that this skb passed once through the udp gro layer */
>> >+       NAPI_GRO_CB(skb)->udp_mark = 1;
>> >+
>> >+       off  = skb_gro_offset(skb);
>> >+       hlen = off + sizeof(*uh);
>> >+       uh   = skb_gro_header_fast(skb, off);
>> >+       if (skb_gro_header_hard(skb, hlen)) {
>> >+               uh = skb_gro_header_slow(skb, hlen, off);
>> >+               if (unlikely(!uh))
>> >+                       goto out;
>> >+       }
>> >+
>> >+       rcu_read_lock();
>> >+       list_for_each_entry_rcu(poffload, ohead, list) {
>> >+               if (poffload->port != uh->dest || !poffload->callbacks.gro_receive)
> Is gro_receive == NULL ever valid? Maybe we can assert on registration instead of checking on every packet.

I see your point, however, the offload structure contains entries for 
both gro and  gso, asserting on registration could somehow limit the use 
cases, isn't that?


> Maybe make this poffload->port == uh->dest and goto "flush = 0". Check below that list end was reached becomes unnecessary.

Sure, will use goto "flush = 0" and if we didn't  go there we'll go to 
out_unlock



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ