netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jerry Chu <hkchu@google.com>
To: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Or Gerlitz <or.gerlitz@gmail.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Yan Burman <yanb@mellanox.com>,
	Shlomo Pongratz <shlomop@mellanox.com>
Subject: Re: [PATCH net-next V2 1/3] net: Add GRO support for UDP encapsulating protocols
Date: Wed, 8 Jan 2014 19:12:00 -0800	[thread overview]
Message-ID: <CAPshTChSSB8mycXMXSJ656tpBGDqyjUF37+V2S2eAPQs47gJ2A@mail.gmail.com> (raw)
In-Reply-To: <52CD0626.9030001@mellanox.com>

On Wed, Jan 8, 2014 at 12:02 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
> On 08/01/2014 00:11, Jerry Chu wrote:
>>
>> On Tue, Jan 7, 2014 at 12:37 PM, Or Gerlitz <or.gerlitz@gmail.com> wrote:
>>>
>>> On Tue, Jan 7, 2014 at 10:32 PM, Eric Dumazet <eric.dumazet@gmail.com>
>>> wrote:
>>>>
>>>> On Tue, 2014-01-07 at 22:19 +0200, Or Gerlitz wrote:
>>>>>
>>>>> On Tue, Jan 7, 2014 at 6:33 PM, Eric Dumazet <eric.dumazet@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> On Tue, 2014-01-07 at 17:29 +0200, Or Gerlitz wrote:
>>>>>>>
>>>>>>> +
>>>>>>> +#define MAX_UDP_PORT (1 << 16)
>>>>>>> +extern const struct net_offload __rcu *udp_offloads[MAX_UDP_PORT];
>>>>>>
>>>>>> Thats 512 KB of memory.
>>>>>> This will greatly impact forwarding performance of UDP packets with
>>>>>> random ports, and will increase kernel memory size for embedded
>>>>>> devices.
>>>>>
>>>>> Re forwarding, are you referring to the case where the forwarded
>>>>> packets are encapsulated? packets which are not encapusalted will be
>>>>> flushed in the gro receive handler (this went out by mistake in V2 but
>>>>> exists in V1)  if skb->encapsulation isn't set.
>>>>>
>>>> How do you know encapsulation must be tried for a given incoming
>>>> packet ? NIC do not magically sets skb->encapsulation I think...
>>>
>>> So here's the thing, per my understanding we want to GRO only received
>>> **encapsulated** packets whose checksum status is != CHECKSUM_NONE
>>
>> What's wrong with GRO'ing pkts whose csum == CHECKSUM_NONE?
>
>
> I am not sure, intuitively it sounds a bit wrong to me, empirically, it
> doesn't work for udp encapsulated  / vxlan
> traffic, I got drops from the tcp stack in tcp_rcv_established() -- if
> GRO-ed packets carry CHECKSUM_NONE
> we arrive to the csum_error label, which means that
> tcp_checksum_complete_user() failed for them

This is odd because if pkts have been aggregated successfully,
tcp4_gro_receive() should've skb_checksum() and turned CHECKSUM_NONE
into CHECKSUM_UNNECESSARY. (I think i've already tested this
case with my GRE-GRO patch on a NIC that sends up pkts w/ CHECKSUM_NONE.

But granted there are a lot of csum related bugs in the current code. I just
spent half a day scratching my head on a very low thruput number with
my GRE patch over a GRE tunnel w/ csum flag on. I just tracked it down
to be buggy TSO/GRE code that will produce bad csum on the tx side.

>
>
>
>> Also "udp_offload" is a little misleading - you are not trying to GRO UDP
>> pkts where UDP is the real transport. You are only trying to GRO UDP
>> encapped TCP pkts.
>
>
> Indeed -- however, I just plugged into what was there for GSO, e.g stack
> will not do GSO for plain UDP
> packets, only for those who encapsulate something the code that does this is
> udp_offloads.c -- any suggestion
> how to phrase/frame the change you envision?

There is already udpv4_offload for real udp gso (ufo) offload. How about
"udp_encap_offload" for your stuff?

>
>
>>
>

  reply	other threads:[~2014-01-09  3:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 15:29 [PATCH net-next V2 0/3] net: Add GRO support for UDP encapsulating protocols Or Gerlitz
2014-01-07 15:29 ` [PATCH net-next V2 1/3] " Or Gerlitz
2014-01-07 16:33   ` Eric Dumazet
2014-01-07 20:19     ` Or Gerlitz
2014-01-07 20:32       ` Eric Dumazet
2014-01-07 20:37         ` Or Gerlitz
2014-01-07 21:38           ` Eric Dumazet
2014-01-08  8:04             ` Or Gerlitz
     [not found]               ` <1389182291.26646.79.camel@edumazet-glaptop2.roam.corp.google.com>
2014-01-08 12:15                 ` Or Gerlitz
2014-01-07 22:11           ` Jerry Chu
2014-01-08  8:02             ` Or Gerlitz
2014-01-09  3:12               ` Jerry Chu [this message]
2014-01-09  6:35                 ` Or Gerlitz
2014-01-09  7:19                 ` Or Gerlitz
2014-01-07 18:44   ` Tom Herbert
2014-01-07 20:21     ` Or Gerlitz
2014-01-07 23:04       ` Tom Herbert
2014-01-08 16:11         ` Or Gerlitz
2014-01-08 16:29           ` Tom Herbert
2014-01-08 16:31             ` Or Gerlitz
2014-01-07 21:19   ` David Miller
2014-01-07 21:40     ` Tom Herbert
2014-01-07 15:29 ` [PATCH net-next V2 2/3] net: Export gro_find_by_type helpers Or Gerlitz
2014-01-07 15:29 ` [PATCH net-next V2 3/3] net: Add GRO support for vxlan traffic Or Gerlitz
2014-01-07 16:34   ` Eric Dumazet
2014-01-07 19:43     ` Or Gerlitz
2014-01-07 20:04       ` Eric Dumazet
2014-01-07 20:10         ` Or Gerlitz
2014-01-07 18:08   ` Tom Herbert
2014-01-07 19:43     ` Or Gerlitz
2014-01-07 20:02       ` Eric Dumazet
2014-01-07 20:12         ` Or Gerlitz
2014-01-07 21:09           ` Tom Herbert
2014-01-08  9:45             ` Or Gerlitz
     [not found]     ` <CAJZOPZLsMvmHwmMjhsuKb__2HncMXMm=p6UFnT4XX5d8hZnGxw@mail.gmail.com>
2014-01-07 19:52       ` Tom Herbert
2014-01-07 16:45 ` [PATCH net-next V2 0/3] net: Add GRO support for UDP encapsulating protocols Eric Dumazet

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=CAPshTChSSB8mycXMXSJ656tpBGDqyjUF37+V2S2eAPQs47gJ2A@mail.gmail.com \
    --to=hkchu@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=or.gerlitz@gmail.com \
    --cc=shlomop@mellanox.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).