[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51f4c402-6a02-9bad-6dab-563ca72f431a@redhat.com>
Date: Wed, 28 Jun 2017 11:40:30 +0800
From: Jason Wang <jasowang@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] virtio-net: unbreak cusmed packet for small buffer
XDP
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@...hat.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
Powered by blists - more mailing lists