From: Or Gerlitz <ogerlitz@mellanox.com>
To: Tom Herbert <therbert@google.com>
Cc: Jerry Chu <hkchu@google.com>, Eric Dumazet <edumazet@google.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
Linux Netdev List <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Yan Burman <yanb@mellanox.com>,
"Shlomo Pongratz" <shlomop@mellanox.com>
Subject: Re: [PATCH net-next V3 1/3] net: Add GRO support for UDP encapsulating protocols
Date: Thu, 9 Jan 2014 08:25:38 +0200 [thread overview]
Message-ID: <52CE40E2.7040408@mellanox.com> (raw)
In-Reply-To: <CA+mtBx9yKSW5GFz-zrFSDdkshAmGmdVhds5wgwQKJd0SDEdBCw@mail.gmail.com>
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
next prev parent reply other threads:[~2014-01-09 6:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 20:34 [PATCH net-next V3 0/3] net: Add GRO support for UDP encapsulating protocols Or Gerlitz
2014-01-08 20:34 ` [PATCH net-next V3 1/3] " Or Gerlitz
2014-01-08 20:39 ` Or Gerlitz
2014-01-08 21:58 ` Tom Herbert
2014-01-09 6:25 ` Or Gerlitz [this message]
2014-01-09 7:09 ` Tom Herbert
2014-01-09 7:14 ` Or Gerlitz
2014-01-08 20:34 ` [PATCH net-next V3 2/3] net: Export gro_find_by_type helpers Or Gerlitz
2014-01-08 20:34 ` [PATCH net-next V3 3/3] net: Add GRO support for vxlan traffic Or Gerlitz
2014-01-08 22:09 ` Eric Dumazet
2014-01-09 6:28 ` Or Gerlitz
2014-01-08 22:11 ` Eric Dumazet
2014-01-09 6:32 ` Or Gerlitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52CE40E2.7040408@mellanox.com \
--to=ogerlitz@mellanox.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=hkchu@google.com \
--cc=netdev@vger.kernel.org \
--cc=shlomop@mellanox.com \
--cc=therbert@google.com \
--cc=yanb@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).