From patchwork Fri Apr 14 05:26:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song, Yoong Siang" X-Patchwork-Id: 13210954 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F11BC77B70 for ; Fri, 14 Apr 2023 05:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=S9VBbC2scucopfMjkwgldbiL2kP02WFMfZeDcoI8Fjk=; b=bwuYurj8n8dToK +RdNQ0hwjaIf6qMn8SLsk69haim7VqYYohLLIXlYKSgkZ5R1Oim8t+l46+7Dyv1m77AoUNndD2QIW eBbk7aplt4nOPBNnoDOVovFPRJX5Zhf/6NBB+Ah4aC92U29fuxunrOTrdD3bm6UXTKuLDM3/wEyUQ i51m8J0R78ZxesA+4OB1sH5cjsBxZ3cxf+JTDeQUETnuvbKxCYsYxUCYQIeSBYhJEgnk1IKxxuWgI DC5LJV3AhE2nGc4K0huIoOww0Iv4IxLC374tsjr5Gn3MO/vVlb3rX7p1AHygG8Ytgoy+2+jb6w81D VYLVyI8N9qHylbAerzHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnByF-008MYN-1N; Fri, 14 Apr 2023 05:27:39 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnByC-008MXh-0T for linux-arm-kernel@lists.infradead.org; Fri, 14 Apr 2023 05:27:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681450056; x=1712986056; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5n/0mu42zjwQFiX1Bk2YBnMsraHX2+ZdlcxSeNpwlQA=; b=ddvHrH6tKC9KRQkieOKjBC6oI4sES3IfKfyn/GYisnFgbhKPnBBbTvbv 3W8kayIt+NZbMa7MVPFYDFNlUvMMLiRMOfW9seDZ2H8NPR2vOEh0E918Y exNXpSz5Giwsgxa3fmO//JCta38XtypCc4+SA7Itdt+zqiFn+O5z+K08B 8AgdbGzYhvDyfs4sf5mxtJSfEHbHPIRiyJ6fj/h2VgnouWeeuO+s+/wtB YxKMazjSjb5rcaJ99xKCMdOIwL6fY3+gR36RCaoDRmpDGOlKlmV9Fjlta vg4A43wVTqIrl8ta+d/wlfRkVEReVFupfAxf5ygYio3VgFTimSerd/oun A==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="333152658" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="333152658" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 22:27:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="692234132" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="692234132" Received: from p12ill20yoongsia.png.intel.com ([10.88.227.28]) by fmsmga007.fm.intel.com with ESMTP; 13 Apr 2023 22:27:28 -0700 From: Song Yoong Siang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Alexander Duyck , Jesper Dangaard Brouer , Ong Boon Leong , Jacob Keller Cc: 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, xdp-hints@xdp-project.net, Song Yoong Siang Subject: [PATCH net-next v5 0/3] XDP Rx HWTS metadata for stmmac driver Date: Fri, 14 Apr 2023 13:26:48 +0800 Message-Id: <20230414052651.1871424-1-yoong.siang.song@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_222736_252967_4EC65757 X-CRM114-Status: UNSURE ( 8.10 ) X-CRM114-Notice: Please train this message. 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 Implemented XDP receive hardware timestamp metadata for stmmac driver. This patchset is tested with tools/testing/selftests/bpf/xdp_hw_metadata. Below are the test steps and results. Command on DUT: sudo ./xdp_hw_metadata Command on Link Partner: echo -n xdp | nc -u -q1 9091 echo -n skb | nc -u -q1 9092 Result for port 9091: 0x55fdb5f006d0: rx_desc[3]->addr=1000000003bd000 addr=3bd100 comp_addr=3bd000 rx_timestamp: 1677762474360150047 rx_hash: 0 0x55fdb5f006d0: complete idx=515 addr=3bd000 Result for port 9092: found skb hwtstamp = 1677762476.320146161 changelog: v4 -> v5: remove zeroing operation on ctx variable v3 -> v4: directly retrieve Rx HWTS in stmmac_xdp_rx_timestamp(), instead of reuse stmmac_get_rx_hwtstamp() v2 -> v3: To reduce packet processing cost, get the Rx HWTS only when xmo_rx_timestamp() is called v1 -> v2: Add static to stmmac_xdp_metadata_ops declaration --- Song Yoong Siang (3): net: stmmac: introduce wrapper for struct xdp_buff net: stmmac: add Rx HWTS metadata to XDP receive pkt net: stmmac: add Rx HWTS metadata to XDP ZC receive pkt drivers/net/ethernet/stmicro/stmmac/stmmac.h | 7 ++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 80 ++++++++++++++++--- 2 files changed, 77 insertions(+), 10 deletions(-)