From patchwork Mon Apr 10 15:57:18 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: 13206472 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 03278C76196 for ; Mon, 10 Apr 2023 15:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbjDJP6q (ORCPT ); Mon, 10 Apr 2023 11:58:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjDJP6p (ORCPT ); Mon, 10 Apr 2023 11:58:45 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1E830D6; Mon, 10 Apr 2023 08:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681142287; x=1712678287; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HQO9M9sithh3L+t6OFXblJMgLNG8pcMkpCqPjnjf5T4=; b=fdiLwiVrexEMzH+5HEpFBXD3GujFgYv3V/e7Mey/gAXiJyVypQk3qkkc EfvgJC7xzM7OJ0qwdbh57dpe3g/IBZVa6y9NPoezhnOnBft1+UzxN0RjB +Q+evhoIecRFDbs+PL0QeEBiSuIoNdq9iIfzuNe73XQcQnq6Jp7jbXmgr dFXFcIzCmdrhktnnMG/NEMOOYMZNMAgSIdOGLGhJTkNyRl3PxkDU2vYT1 Dy6M/vPK1Ms5bdHyAui8VSRRonu3DI0M0fwmaaRO4V6rEg2BcCME/UBNN tMqnxW624amEY5jILdSx1IzRNC+tki/7vxO6TkkB9WaCD37jj6h+zfWGU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="343391636" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="343391636" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 08:57:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="777601681" X-IronPort-AV: E=Sophos;i="5.98,333,1673942400"; d="scan'208";a="777601681" Received: from p12ill20yoongsia.png.intel.com ([10.88.227.28]) by FMSMGA003.fm.intel.com with ESMTP; 10 Apr 2023 08:57:47 -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 v2 0/4] XDP Rx HWTS metadata for stmmac driver Date: Mon, 10 Apr 2023 23:57:18 +0800 Message-Id: <20230410155722.335908-1-yoong.siang.song@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.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 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 | 5 ++ .../net/ethernet/stmicro/stmmac/stmmac_main.c | 88 ++++++++++++++----- 2 files changed, 73 insertions(+), 20 deletions(-)