From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811AbdF1CRW (ORCPT ); Tue, 27 Jun 2017 22:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57740 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753295AbdF1CRP (ORCPT ); Tue, 27 Jun 2017 22:17:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 655D07EBDA Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 655D07EBDA Date: Wed, 28 Jun 2017 05:17:13 +0300 From: "Michael S. Tsirkin" To: Jason Wang 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 Message-ID: <20170628051555-mutt-send-email-mst@kernel.org> References: <1498614843-8163-1-git-send-email-jasowang@redhat.com> <20170628050057-mutt-send-email-mst@kernel.org> <7068053c-50da-6779-5ff2-6588e01e616d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7068053c-50da-6779-5ff2-6588e01e616d@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 28 Jun 2017 02:17:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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. > For XDP_TX, we > zero the vnet header. Again TX offload is disabled, so packets will go out with an invalid checksum. > For adjusting header, XDP prog should deal with csum. > > Thanks That part seems right. > > > > > --- > > > The patch is needed for -stable. > > > --- > > > drivers/net/virtio_net.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > > index 143d8a9..499fcc9 100644 > > > --- a/drivers/net/virtio_net.c > > > +++ b/drivers/net/virtio_net.c > > > @@ -413,7 +413,7 @@ static struct sk_buff *receive_small(struct net_device *dev, > > > void *orig_data; > > > u32 act; > > > - if (unlikely(hdr->hdr.gso_type || hdr->hdr.flags)) > > > + if (unlikely(hdr->hdr.gso_type)) > > > goto err_xdp; > > > xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; > > > -- > > > 2.7.4