From patchwork Thu Nov 7 08:55:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xuan Zhuo X-Patchwork-Id: 13866017 X-Patchwork-Delegate: kuba@kernel.org Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20DA41DEFCC; Thu, 7 Nov 2024 08:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730969723; cv=none; b=ZdYbRv3D9xrK7QtTScqnkaHktdHcL+wwvIORXELXrYKVEd3qdQPEWtPOHbnThb3xRNjWulnOjwcquP11APjXp3PUazauBMDzDLFPR0V/S44TIPexNUWlV9gfLLpnbJKaqkLqsypOZKY4b/3vdB3m6Kv1G8Hlk/OAqC7G3S/taiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730969723; c=relaxed/simple; bh=Q+RRd8/pyUO2x2swViqjGo1CmNxpsZykn+S3KbWdI7k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KXGksgTBuxW0o1IIhD8C6vmSOJfzxqpoeHoHB2b5oKxx17Vusye6GeJ/4ufD9wbZhxHfzi/IoRWx5HN8Lf1JJDzVnZZWZ292wfUoHfdgPyoZ3SU4rRhPaiW/2JMVHbUZtZvbE18kRXXaO1CAqlrATrsiB45Gs1H6B9bV6ID5kRw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=LlBd3Kl3; arc=none smtp.client-ip=115.124.30.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="LlBd3Kl3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1730969719; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=RgaRTP7bUlX2Zvzk3cLriBy+2FR3FTfKA9b3rMHTeEU=; b=LlBd3Kl3aTszlRy+8YfSzqz46+dY7WkTevctEZBsnKW0UW0beuWMLj24sApMQHXhpzxPaZAcn7ccP+MdZnem9CQYrqs1qDbCP9XUjgbdAKl4fiSC6h4f3m/Q3klKqcKSnVdCdA93wO60wXb7+7x6EXWatQal9HanVhVH1jBYjME= Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0WIuulTy_1730969717 cluster:ay36) by smtp.aliyun-inc.com; Thu, 07 Nov 2024 16:55:18 +0800 From: Xuan Zhuo To: netdev@vger.kernel.org Cc: "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , virtualization@lists.linux.dev, bpf@vger.kernel.org Subject: [PATCH net-next v3 13/13] virtio_net: xdp_features add NETDEV_XDP_ACT_XSK_ZEROCOPY Date: Thu, 7 Nov 2024 16:55:04 +0800 Message-Id: <20241107085504.63131-14-xuanzhuo@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20241107085504.63131-1-xuanzhuo@linux.alibaba.com> References: <20241107085504.63131-1-xuanzhuo@linux.alibaba.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Git-Hash: 2634baada01d X-Patchwork-Delegate: kuba@kernel.org Now, we support AF_XDP(xsk). Add NETDEV_XDP_ACT_XSK_ZEROCOPY to xdp_features. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7cd6f1d74710..8438e210b00f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -6618,7 +6618,8 @@ static int virtnet_probe(struct virtio_device *vdev) dev->hw_features |= NETIF_F_GRO_HW; dev->vlan_features = dev->features; - dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT; + dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | + NETDEV_XDP_ACT_XSK_ZEROCOPY; /* MTU range: 68 - 65535 */ dev->min_mtu = MIN_MTU;