Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8133302imu; Tue, 4 Dec 2018 03:34:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/UfNu81iyAQi7FP0CbC89idopY6lhg1/GFx4gVbKONyo9R+6FF/HZ//U0u0fPqzs9VWjgnS X-Received: by 2002:a63:5455:: with SMTP id e21mr16619831pgm.316.1543923298650; Tue, 04 Dec 2018 03:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923298; cv=none; d=google.com; s=arc-20160816; b=oen6JpDZchwJoE9/nH6Cx+b7WzIsdwsOh5biYngA3CqR8oD1KCghCe+adA3EU5nAmX 3I/B3bSVzXtctTD/AaXflPyTzJpg0O6X4defr0RDD1UPB9t6Le6y8wxa7Mdqgr5SmMlx ywknt3Fr9dMuRk7tpEMj2GFAbt/ei8eqnDNuYc9SVz2IuwGsjj8zXpYRvn2R11ZtqtTi j0a6bjUqCOkV6vUyqqEneOtMx+llbxhofqFB0XpbAR+Ea0kpG4kALDubFL6u7+S+aXb/ HvcB31AwqWUxpp3CfjbbLVAvOyPDjQnSTlgXVt3sd/7MAIlc7JMMU7W2BYaN5Dx/xH4Z 15Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=44vM8sWpiKqWqBVUkm2Zw0Pze+ti52sDlQyMEF4eI1U=; b=qSRlF+HPw2zfrOv8YXgYrTyqIn34EtQA3DI26AxYnsZrCjqrLFPR0bCwE4L2TmJT2F 1AUkf+GinDGhs6ZHDVmHJLGbsTHzNI5Hf9nEyNbW0Ndfo/ETJcladc6iEQQYkccP/BQv XhnTz4wSD4n7MxVpbDTWUUSJqRZO8Xcve2SHZGu14AHCkJumDShrSoOARr1hGp2EKibi X69qHxGtzUPmsB2I4rdXoawcBKLqSnC0z6C7MqXnQi8aEXjamNBv7NRTxulqxl4rVf6Q AwYhC6OfDElx+6jkA4ZLDBM2R+b+Gw86zsOZT4DvO5H3qkFdw+UmIwjthVek57/YOddN +0ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1L0RH8SS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf17si7021235plb.52.2018.12.04.03.34.43; Tue, 04 Dec 2018 03:34:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1L0RH8SS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726481AbeLDLdA (ORCPT + 99 others); Tue, 4 Dec 2018 06:33:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:38784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbeLDKzu (ORCPT ); Tue, 4 Dec 2018 05:55:50 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76D53214C1; Tue, 4 Dec 2018 10:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920949; bh=vVPQDdKE8QH6QCVxNu0Eyzli/Rvqyjgjn79B0xotVO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1L0RH8SShzH0m9YlzrZev9PkOUVmS0a8UB82oaoHuOO7RpWXdl8W6pDjUGckWcD7O 9QbArgtjulGKlItXG1PYHYdpIK+nF94NGb/Xaiv9Aff9FZLGbHDT2P/Q9sfOySckAY yFjFo+8W22tis/BBijZSYYCTstu9e1bQgTwddDDA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Dangaard Brouer , Pavel Popa , David Ahern , Jason Wang , "David S. Miller" Subject: [PATCH 4.19 022/139] virtio-net: fail XDP set if guest csum is negotiated Date: Tue, 4 Dec 2018 11:48:23 +0100 Message-Id: <20181204103650.889401339@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Wang [ Upstream commit 18ba58e1c234ea1a2d9835ac8c1735d965ce4640 ] We don't support partial csumed packet since its metadata will be lost or incorrect during XDP processing. So fail the XDP set if guest_csum feature is negotiated. Fixes: f600b6905015 ("virtio_net: Add XDP support") Reported-by: Jesper Dangaard Brouer Cc: Jesper Dangaard Brouer Cc: Pavel Popa Cc: David Ahern Signed-off-by: Jason Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2312,8 +2312,9 @@ static int virtnet_xdp_set(struct net_de && (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || - virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO))) { - NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO, disable LRO first"); + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { + NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); return -EOPNOTSUPP; }