From patchwork Tue Apr 13 09:36:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 12199801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A8BC43460 for ; Tue, 13 Apr 2021 09:35:10 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E8FB61222 for ; Tue, 13 Apr 2021 09:35:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E8FB61222 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=aPAHbtCPNPdEVz8afZubX2DfVpFzcziy9UNcdbNKDhY=; b=eE2Mkytx95EDvo5qKMxWUdqXtS xBJTNtB8Xc+GD5qE6Uf2IKD3POpPU07K6JGZYD0CV+t/NFFCtueltam5Yw/ZvcOIc/9ga4KUh6IqH SzPZH3PrHc66sb17H2CBAeTdmfPoW8C/EtN+JLwWnCp2GggwcgZiJKn0EZ6qzfRREQE1G6oxFudO2 4TPBrfT7pubeLnMbGWZKahGK+VkKo0MYa/s3udlyewBX3XvtGQCbWqFHEfL2jriQGOUSJFufipDXk rNINJJFnFIBpSMoVAgQNvOfF5wTrdwInD354UtafIvhrZr4/vmVHc5HTSs5Z1YLjj7eov69iGYyUh 64Y+nV/A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWFPI-008ids-HQ; Tue, 13 Apr 2021 09:32:28 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWFP8-008icn-J9 for linux-arm-kernel@desiato.infradead.org; Tue, 13 Apr 2021 09:32:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=DvQkcbur4sbI+6rcKInfho4GIm/wEONeAdCADHvz46A=; b=sjIw1bWYblRShF3h+x7Oh/DRSl g/BNDiksh9VEBDt7/Rn9FvYv1SMi2owh9/Py8XQXpRUt7OPT9cDM1HcsJTc/YMAUjOGf+HEXCD4Kx Y76bReCiCVbTsdxtUDqr5QelrBg+Go3pxhol9e9xNPYp5ZwRxR1hK5FkMYSaFnt2/9i4p82hxi5pE MzE6fMUNjugURf0FSceN/DsJHt5XfrPFe3ztnwhRAwCc94tRNEg7rg0PvKNp6CLFZYzUWWYnKK0Iu j+WxGcqKPwY8eMpI5LMB6XO/iQjUFe+aE5j4g635wjTeMO9U3QihkhlthEYo2jI1rCmy7ok9Tyqx/ 3td3AJ9w==; Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWFP5-006sfw-Tn for linux-arm-kernel@lists.infradead.org; Tue, 13 Apr 2021 09:32:17 +0000 IronPort-SDR: Tf5fKVAenH3TXXvLvcla4/TyVR6lHGo1lygQQAn20OiW+X80RGciARFer0wChoAc6VJ+c85MaP ioHpfXrHTt2g== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="194489855" X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="194489855" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 02:32:14 -0700 IronPort-SDR: gbYVj5qwLtUIw5q8DrxLiv4BRR4jht7zSoRGbxrC5sHYn6kDuJ1GSxWWZB1Pi4NTQ9OKOit9Uv zUunE2UAFYpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="424178034" Received: from glass.png.intel.com ([10.158.65.59]) by orsmga008.jf.intel.com with ESMTP; 13 Apr 2021 02:32:08 -0700 From: Ong Boon Leong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Cc: alexandre.torgue@foss.st.com, Maxime Coquelin , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Ong Boon Leong Subject: [PATCH net-next v2 0/7] stmmac: add XDP ZC support Date: Tue, 13 Apr 2021 17:36:19 +0800 Message-Id: <20210413093626.3447-1-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_023216_037462_CADE153C X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This is the v2 patch series to add XDP ZC support to stmmac driver. Summary of v2 patch change:- 6/7: fix synchronize_rcu() is called stmmac_disable_all_queues() that is used by ndo_setup_tc(). ######################################################################## Continuous burst traffics are generated by pktgen script and in the midst of each packet processing operation by xdpsock the following tc-loop.sh script is looped continuously:- #!/bin/bash tc qdisc del dev eth0 parent root tc qdisc add dev eth0 ingress tc qdisc add dev eth0 root mqprio num_tc 4 map 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 queues 1@0 1@1 1@2 1@3 hw 0 tc filter add dev eth0 parent ffff: protocol 802.1Q flower vlan_prio 0 hw_tc 0 tc filter add dev eth0 parent ffff: protocol 802.1Q flower vlan_prio 1 hw_tc 1 tc filter add dev eth0 parent ffff: protocol 802.1Q flower vlan_prio 2 hw_tc 2 tc filter add dev eth0 parent ffff: protocol 802.1Q flower vlan_prio 3 hw_tc 3 tc qdisc list dev eth0 tc filter show dev eth0 ingress On different ssh terminal $ while true; do ./tc-loop.sh; sleep 1; done The v2 patch series have been tested using the xdpsock app: $ ./xdpsock -i eth0 -l -z From xdpsock poller pps report and dmesg, we don't find any warning related to rcu and the only difference when the script is executed is the pps rate drops momentarily. sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 436347 191361334 tx 436411 191361334 sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 254117 191615476 tx 254053 191615412 sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 466395 192081924 tx 466395 192081860 sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 287410 192369365 tx 287474 192369365 sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 395853 192765329 tx 395789 192765265 sock0@eth0:0 l2fwd xdp-drv pps pkts 1.00 rx 466132 193231514 tx 466132 193231450 ######################################################################## Based on the above result, the fix looks promising. Appreciate that if community can help to review the patch series and provide me feedback for improvement. Thanks, Boon Leong ------------------------------------------------------------------------ History of patch series as follow:- v1: https://patchwork.kernel.org/project/netdevbpf/list/?series=465747&state=* ------------------------------------------------------------------------ Ong Boon Leong (7): net: stmmac: rearrange RX buffer allocation and free functions net: stmmac: introduce dma_recycle_rx_skbufs for stmmac_reinit_rx_buffers net: stmmac: refactor stmmac_init_rx_buffers for stmmac_reinit_rx_buffers net: stmmac: rearrange RX and TX desc init into per-queue basis net: stmmac: Refactor __stmmac_xdp_run_prog for XDP ZC net: stmmac: Enable RX via AF_XDP zero-copy net: stmmac: Add TX via XDP zero-copy socket drivers/net/ethernet/stmicro/stmmac/stmmac.h | 24 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 1718 +++++++++++++---- .../net/ethernet/stmicro/stmmac/stmmac_xdp.c | 95 + .../net/ethernet/stmicro/stmmac/stmmac_xdp.h | 3 + 4 files changed, 1411 insertions(+), 429 deletions(-)