mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] virtio-net: unbreak cusmed packet for small buffer XDP
Date: Tue, 4 Jul 2017 20:20:00 +0800	[thread overview]
Message-ID: <4de0c8e7-a9b6-7477-691a-a2ed0f317106@redhat.com> (raw)
In-Reply-To: <20170703195752-mutt-send-email-mst@kernel.org>



On 2017年07月04日 01:03, Michael S. Tsirkin wrote:
> On Wed, Jun 28, 2017 at 08:05:06PM +0800, Jason Wang wrote:
>>
>> On 2017年06月28日 12:01, Michael S. Tsirkin wrote:
>>> On Wed, Jun 28, 2017 at 11:40:30AM +0800, Jason Wang wrote:
>>>> On 2017年06月28日 11:31, Michael S. Tsirkin wrote:
>>>>> On Wed, Jun 28, 2017 at 10:45:18AM +0800, Jason Wang wrote:
>>>>>> On 2017年06月28日 10:17, Michael S. Tsirkin wrote:
>>>>>>> On Wed, Jun 28, 2017 at 10:14:34AM +0800, Jason Wang wrote:
>>>>>>>> On 2017年06月28日 10:02, Michael S. Tsirkin wrote:
>>>>>>>>> On Wed, Jun 28, 2017 at 09:54:03AM +0800, Jason Wang wrote:
>>>>>>>>>> We should allow csumed packet for small buffer, otherwise XDP_PASS
>>>>>>>>>> won't work correctly.
>>>>>>>>>>
>>>>>>>>>> Fixes commit bb91accf2733 ("virtio-net: XDP support for small buffers")
>>>>>>>>>> Signed-off-by: Jason Wang<jasowang@redhat.com>
>>>>>>>>> The issue would be VIRTIO_NET_HDR_F_DATA_VALID might be set.
>>>>>>>>> What do you think?
>>>>>>>> I think it's safe. For XDP_PASS, it work like in the past.
>>>>>>> That's the part I don't get. With DATA_VALID csum in packet is wrong, XDP
>>>>>>> tools assume it's value.
>>>>>> DATA_VALID is CHECKSUM_UNCESSARY on the host, and according to the comment
>>>>>> in skbuff.h
>>>>>>
>>>>>>
>>>>>> "
>>>>>>     *   The hardware you're dealing with doesn't calculate the full checksum
>>>>>>     *   (as in CHECKSUM_COMPLETE), but it does parse headers and verify
>>>>>> checksums
>>>>>>     *   for specific protocols. For such packets it will set
>>>>>> CHECKSUM_UNNECESSARY
>>>>>>     *   if their checksums are okay. skb->csum is still undefined in this case
>>>>>>     *   though. A driver or device must never modify the checksum field in the
>>>>>>     *   packet even if checksum is verified.
>>>>>> "
>>>>>>
>>>>>> The csum is correct I believe?
>>>>>>
>>>>>> Thanks
>>>>> That's on input. But I think for tun it's output, where that is equivalent
>>>>> to CHECKSUM_NONE
>>>>>
>>>>>
>>>> Yes, but the comment said:
>>>>
>>>> "
>>>> CKSUM_NONE:
>>>>    *
>>>>    *   The skb was already checksummed by the protocol, or a checksum is not
>>>>    *   required.
>>>>    *
>>>>    * CHECKSUM_UNNECESSARY:
>>>>    *
>>>>    *   This has the same meaning on as CHECKSUM_NONE for checksum offload on
>>>>    *   output.
>>>>    *
>>>> "
>>>>
>>>> So still correct I think?
>>>>
>>>> Thanks
>>> Hmm maybe I mean NEEDS_CHECKSUM actually.
>>>
>>> I'll need to re-read the spec.
>>>
>> Not sure this is an issue. But if it is, we can probably checksum the packet
>> before passing it to XDP. But it would be a little slow.
>>
>> Thanks
>
>
> Right. I confused DATA_VALID with NEEDS_CHECKSUM.
>
> IIUC XDP generally refuses to attach if checksum offload
> is enabled.

Any reason to do this? (Looks like I don't see any code for this)

>
> Could you pls explain how to reproduce the issue you are seeing?
>

Using small buffer, all csumed packets will be dropped.

Thanks

  reply	other threads:[~2017-07-04 12:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28  1:54 Jason Wang
2017-06-28  2:02 ` Michael S. Tsirkin
2017-06-28  2:14   ` Jason Wang
2017-06-28  2:17     ` Michael S. Tsirkin
2017-06-28  2:45       ` Jason Wang
2017-06-28  3:31         ` Michael S. Tsirkin
2017-06-28  3:40           ` Jason Wang
2017-06-28  4:01             ` Michael S. Tsirkin
2017-06-28 12:05               ` Jason Wang
2017-07-03 17:03                 ` Michael S. Tsirkin
2017-07-04 12:20                   ` Jason Wang [this message]
2017-07-06  0:07                     ` Michael S. Tsirkin

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=4de0c8e7-a9b6-7477-691a-a2ed0f317106@redhat.com \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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

all inboxes | Powered by JetHome®