From patchwork Tue Sep 24 01:32: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: 13810034 X-Patchwork-Delegate: kuba@kernel.org Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) (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 B730A17579; Tue, 24 Sep 2024 01:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.97 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727141547; cv=none; b=FslnJ27zjvMn1Ts9/oF83GXpYRjGx80UFiunvQzZIOAgd9UWlercwuIG1S/lCldjajjIB11ZumOiKtcWX0YRqdcNSsxLJHcUK1+LH8i9CDdHdR5WIRYdrEhnQPp1dPbf+P5fE4i9t68IGWQkgw4eL5qkyJbnFZKmNTezIMBJqEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727141547; c=relaxed/simple; bh=6AucyNtivTnScZz7ltd0pC9UhwGBpDJB5+mw/CykqpE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qX0Y5RdA7GJUL2e2XkqpxtS3j+pd3HkDYrWQb8wotFerQWYjEzzHzK705TkHEQ0arkG22P5M+g2zYwyeoyjDEliKwRCFhy4pNE0kPlglXS57PYVmTuuRFPn5/ovEYwc2sFjyUQ4DvBhku7zDy6peRZ/gIMDfn29WX4C1pXp7uWE= 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=uPHN1DnW; arc=none smtp.client-ip=115.124.30.97 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="uPHN1DnW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1727141538; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=2BHkuN+s9X+aLlQr4SanE0NIc8ilrJLdzZC9WMhEijk=; b=uPHN1DnWkFSencj0/t9iT4HQMs4agol+dZxBiCy6w6+SWKdA2y2mE2dj+BbuRqBDD0Wm4PC00GG2DNxzvqAd0PdCEF7LBCMc9AkjhSwVckcmhsAzHYuW+L7cZDJl6V3pZSorufrTVInky7wSwmTB50i78KHNtIdNbd//L0d7yno= Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0WFdvTvj_1727141535) by smtp.aliyun-inc.com; Tue, 24 Sep 2024 09:32:15 +0800 From: Xuan Zhuo To: netdev@vger.kernel.org Cc: "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , "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: [RFC net-next v1 12/12] virtio_net: xdp_features add NETDEV_XDP_ACT_XSK_ZEROCOPY Date: Tue, 24 Sep 2024 09:32:04 +0800 Message-Id: <20240924013204.13763-13-xuanzhuo@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20240924013204.13763-1-xuanzhuo@linux.alibaba.com> References: <20240924013204.13763-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: 83bb687d4b73 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 a1ef0277c550..0995b4e1a1c8 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -6605,7 +6605,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;