From patchwork Wed Mar 15 04:10:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xuan Zhuo X-Patchwork-Id: 13175282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35F14C76196 for ; Wed, 15 Mar 2023 04:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230500AbjCOEK6 (ORCPT ); Wed, 15 Mar 2023 00:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230472AbjCOEKx (ORCPT ); Wed, 15 Mar 2023 00:10:53 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DABE048E2D; Tue, 14 Mar 2023 21:10:46 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R811e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VduWS3-_1678853443; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0VduWS3-_1678853443) by smtp.aliyun-inc.com; Wed, 15 Mar 2023 12:10:43 +0800 From: Xuan Zhuo To: netdev@vger.kernel.org Cc: "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , virtualization@lists.linux-foundation.org, bpf@vger.kernel.org Subject: [RFC net-next 0/8] virtio_net: refactor xdp codes Date: Wed, 15 Mar 2023 12:10:34 +0800 Message-Id: <20230315041042.88138-1-xuanzhuo@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f MIME-Version: 1.0 X-Git-Hash: a046238c058f Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical relationships. In addition, the supporting to AF_XDP that I want to submit later will also need to reuse the logic of XDP, such as the processing of actions, I don't want to introduce a new similar code. In this way, I can reuse these codes in the future. This patches are developed on the top of another patch set[1]. I may have to wait to merge this. So this patch set is a RFC. Please review. Thanks. [1]. https://lore.kernel.org/netdev/20230315015223.89137-1-xuanzhuo@linux.alibaba.com/ Xuan Zhuo (8): virtio_net: mergeable xdp: put old page immediately virtio_net: mergeable xdp: introduce mergeable_xdp_prepare virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp virtio_net: separate the logic of freeing xdp shinfo virtio_net: separate the logic of freeing the rest mergeable buf virtio_net: auto release xdp shinfo virtio_net: introduce receive_mergeable_xdp() virtio_net: introduce receive_small_xdp() drivers/net/virtio_net.c | 615 +++++++++++++++++++++++---------------- 1 file changed, 357 insertions(+), 258 deletions(-) --- 2.32.0.3.g01195cf9f