From patchwork Wed Apr 12 09:42:31 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: 13208695 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 1F28CC7619A for ; Wed, 12 Apr 2023 09:44:09 +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=yUKK/CsEOGrpjoygK5Cqd0PGqXceDb5tSIriYjkA6BM=; b=MoEc11tg8hgMQe 08fGC8AsWU73jKZq9NEHyj+REkSEUJlCc+wY0w2y9tLApkJytuItNgrs7s80U6Q1KjNtiIyANWEHt LdMdwV1ohmX34wZwZZGnuHqaHGHoBMNkfY7WqbucODZJR/jmJDzF8Y86s1lCViH2wCQaBT0k3D7zn B2v1mYRG035ZOBuEQIwattYk09XEsKNEdqWYaE0+KVPp4e41ZX/ALG7lXxQqjW/m7kIcwY4xWm+gw baIvFSIvRVLPxn+pghtZQjLd142+dM/YhT9KhjIRiQ9ziwLvPiSvEmZxOCTPupzGyVnrdp80ekz/g AAQBYOczqcpBFEDGR6YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmX0X-002RWx-24; Wed, 12 Apr 2023 09:43:17 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmX0U-002RW6-2m for linux-arm-kernel@lists.infradead.org; Wed, 12 Apr 2023 09:43:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681292594; x=1712828594; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jPs+CdsG5on+mgZJH/qHDWHeHVfbVe0iJzdrJeUiuEo=; b=MhYymyVw3Bt+Kj0dYMp/N4cO/knrHwrggE9X2psepyvGqcP9r+cn/e8M Pjy6Bf/DfKtTKdKxBFWkM1E95kuCmn+4HPyXqozfo8G9Sxf8WE6cyNi5v Rb+OD7VTuExX7oY2MebeXuxt5M4J+UJxEAnU2kzFnaQMkY/YN2qfo6ajj Kc9pkrtqGJmJyWC7J6WBsa6HsMXZR4Mx3Dw1XEAY8c3WI/ShEiepz+Wdl ol1toOanAN7ZbLqA8AQkZLDZtKhY5LDULV3xC1L0V2uJWgoW4B4Y1wCEl m/Dgk+U8xxli8AbqfdYrKVqs1e5wBg6V4HlZhv4Ajww/yYVCqVmg3IGqe g==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="346526314" X-IronPort-AV: E=Sophos;i="5.98,338,1673942400"; d="scan'208";a="346526314" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 02:43:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="682430883" X-IronPort-AV: E=Sophos;i="5.98,338,1673942400"; d="scan'208";a="682430883" Received: from p12ill20yoongsia.png.intel.com ([10.88.227.28]) by orsmga007.jf.intel.com with ESMTP; 12 Apr 2023 02:43:06 -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 , Ong Boon Leong 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 v3 0/4] XDP Rx HWTS metadata for stmmac driver Date: Wed, 12 Apr 2023 17:42:31 +0800 Message-Id: <20230412094235.589089-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-20230412_024314_945885_42440D09 X-CRM114-Status: UNSURE ( 6.95 ) 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 Changes since v2: * To reduce packet processing cost, get the Rx HWTS only when xmo_rx_timestamp() is called Changes since v1: * Add static to stmmac_xdp_metadata_ops declaration --- Ong Boon Leong (1): net: stmmac: restructure Rx hardware timestamping function 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 | 87 +++++++++++++++---- 2 files changed, 76 insertions(+), 18 deletions(-)