From: Jason Wang Subject: Re: [PATCH net 1/2] virtio-net: disable guest csum during XDP set Date: Mon, 26 Nov 2018 12:03:39 +0800 Message-ID: References: <20181122063631.14452-1-jasowang@redhat.com> <20181123.120119.2279234989819941118.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, brouer@redhat.com, pashinho1990@gmail.com, dsahern@gmail.com To: David Miller Return-path: In-Reply-To: <20181123.120119.2279234989819941118.davem@davemloft.net> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 2018/11/24 上午4:01, David Miller wrote: > From: Jason Wang > Date: Thu, 22 Nov 2018 14:36:30 +0800 > >> We don't disable VIRTIO_NET_F_GUEST_CSUM if XDP was set. This means we >> can receive partial csumed packets with metadata kept in the >> vnet_hdr. This may have several side effects: >> >> - It could be overridden by header adjustment, thus is might be not >> correct after XDP processing. >> - There's no way to pass such metadata information through >> XDP_REDIRECT to another driver. >> - XDP does not support checksum offload right now. >> >> So simply disable guest csum if possible in this the case of XDP. >> >> Fixes: 3f93522ffab2d ("virtio-net: switch off offloads on demand if possible on XDP set") >> Reported-by: Jesper Dangaard Brouer >> Cc: Jesper Dangaard Brouer >> Cc: Pavel Popa >> Cc: David Ahern >> Signed-off-by: Jason Wang > Applied and queued up for -stable. > > We really should have a way to use the checksum provided if the XDP > program returns XDP_PASS and does not modify the packet contents > or size. Yes, I think this may require the assistance of BPF verifier to set a flag or other. Then we can assume the metadata is safe to use. Thanks