From patchwork Wed Mar 31 15:41:29 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: 12175617 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,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 39CE9C433B4 for ; Wed, 31 Mar 2021 15:39:16 +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 D573460FED for ; Wed, 31 Mar 2021 15:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D573460FED 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=o03oIbtSYX54DIZjM49U8Bj1ckPqOgDfX43RiUX8Q1g=; b=QXO+dtvqDH35pZFG+V/ykPtUUA g6hFahB/F9+HiHLBCItRvw0k2hErxb01+SJkXZXeYr1huN3LZeegxRHAOWCiXILYdCl608IXHZ1N0 D6xIxwxT5iE7kQCXBVGwHBzZqYdtx3yyXoJQJ1aLwUQnGrL+FkU0NQVhcI6K5hRJScXYduUUgXDx+ wowHrrS8O7fkDr24xX8TxSRdyCd2YRyrrVFEKyh0jVL5Y2VrP8iamCh//YXAEl1NLNoAVtXo+zllP I3Q5C+YhdUtM9Ey1q4GfJ8u+azBJrsViB0cCTWDaIXBgSQx8W9L6xPjhqqqJHhoY7IX1FdU9X6HS4 X9rPLAeA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRcuU-006vLL-AQ; Wed, 31 Mar 2021 15:37:34 +0000 Received: from mga02.intel.com ([134.134.136.20]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRcuO-006vKM-C9 for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 15:37:30 +0000 IronPort-SDR: lRgEgFZKru+cNkHSXaaBRIe6vtZ8Vqh2WLK6dUByVuerwPhMBuNf57jb4Hxyr57NbWFOXf9h7N NycKHy3mWTxg== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="179159146" X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="179159146" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 08:37:26 -0700 IronPort-SDR: bFLVobjcz36FiQAfEulhXkLO+PD+DqUOlkEpEmCQxJrLSR9BjRjPgUnK4afBfDx0Rdti0RG/UP kFByFLIJdbLg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="418729037" Received: from glass.png.intel.com ([10.158.65.59]) by orsmga008.jf.intel.com with ESMTP; 31 Mar 2021 08:37:20 -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: 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 v3 0/6] stmmac: Add XDP support Date: Wed, 31 Mar 2021 23:41:29 +0800 Message-Id: <20210331154135.8507-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-20210331_163728_745831_B9EB27D1 X-CRM114-Status: GOOD ( 13.82 ) 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 v3 patch series for adding XDP support to stmmac driver. Summary of the changes in v3 (per feedback from Jakub Kicinski):- 4/6: Factor in XDP buffer header and tail adjustment by XDP prog. 5/6: Added 'nq->trans_start = jiffies' to avoid TX time-out for XDP_TX. 6/6: Added 'nq->trans_start = jiffies' to avoid TX time-out for ndo_xdp_xmit. I retested this patch series on all the test steps listed in v1 and the results look good as expected. I also used xdp_adjust_tail test app in samples/bpf for checking out XDP head and tail adjustment introduced in 4/6 and the result below looks correct too. ######################################################################## DUT > root@intel-corei7-64:~ $ ./xdp_adjust_tail -i eth0 -P 400 -N ========================== icmp "packet too big" sent: 0 pkts icmp "packet too big" sent: 0 pkts icmp "packet too big" sent: 0 pkts icmp "packet too big" sent: 0 pkts icmp "packet too big" sent: 1 pkts icmp "packet too big" sent: 1 pkts icmp "packet too big" sent: 1 pkts icmp "packet too big" sent: 2 pkts icmp "packet too big" sent: 4 pkts icmp "packet too big" sent: 6 pkts icmp "packet too big" sent: 8 pkts icmp "packet too big" sent: 9 pkts icmp "packet too big" sent: 10 pkts icmp "packet too big" sent: 10 pkts LP > root@intel-corei7-64:~# ping 169.254.1.11 -s 300 PING 169.254.1.11 (169.254.1.11) 300(328) bytes of data. 308 bytes from 169.254.1.11: icmp_seq=1 ttl=64 time=1.17 ms 308 bytes from 169.254.1.11: icmp_seq=2 ttl=64 time=0.575 ms 308 bytes from 169.254.1.11: icmp_seq=3 ttl=64 time=0.582 ms 308 bytes from 169.254.1.11: icmp_seq=4 ttl=64 time=0.595 ms 308 bytes from 169.254.1.11: icmp_seq=5 ttl=64 time=0.585 ms 308 bytes from 169.254.1.11: icmp_seq=6 ttl=64 time=0.591 ms 308 bytes from 169.254.1.11: icmp_seq=7 ttl=64 time=0.599 ms --- 169.254.1.11 ping statistics --- 7 packets transmitted, 7 received, 0% packet loss, time 6103ms rtt min/avg/max/mdev = 0.575/0.670/1.166/0.202 ms LP > root@intel-corei7-64:~# ping 169.254.1.11 -s 500 PING 169.254.1.11 (169.254.1.11) 500(528) bytes of data. From 169.254.1.11 icmp_seq=1 Frag needed and DF set (mtu = 436) From 169.254.1.11 icmp_seq=2 Frag needed and DF set (mtu = 436) From 169.254.1.11 icmp_seq=3 Frag needed and DF set (mtu = 436) From 169.254.1.11 icmp_seq=4 Frag needed and DF set (mtu = 436) From 169.254.1.11 icmp_seq=5 Frag needed and DF set (mtu = 436) From 169.254.1.11 icmp_seq=6 Frag needed and DF set (mtu = 436) ######################################################################## History of the previous patch series: v2: https://patchwork.kernel.org/project/netdevbpf/list/?series=457757 v1: https://patchwork.kernel.org/project/netdevbpf/list/?series=457139 It will be great if community can help to test or review the v3 patch series on your platform and provide me any new feedback if any. Thank you very much. Boon Leong Ong Boon Leong (6): net: stmmac: set IRQ affinity hint for multi MSI vectors net: stmmac: make SPH enable/disable to be configurable net: stmmac: arrange Tx tail pointer update to stmmac_flush_tx_descriptors net: stmmac: Add initial XDP support net: stmmac: Add support for XDP_TX action net: stmmac: Add support for XDP_REDIRECT action drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac.h | 35 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 529 +++++++++++++++--- .../net/ethernet/stmicro/stmmac/stmmac_xdp.c | 40 ++ .../net/ethernet/stmicro/stmmac/stmmac_xdp.h | 12 + 5 files changed, 537 insertions(+), 80 deletions(-) create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.h