Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp71189rwe; Thu, 13 Apr 2023 22:28:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YU5pYcgLQ4DZ5HuK3ui5rifYYdXl1sUD/gjtvJW7Zu1YwwYx7M0KVEN/T1vCVdNbMP/+Xg X-Received: by 2002:a17:902:d4d0:b0:1a6:9906:1eb7 with SMTP id o16-20020a170902d4d000b001a699061eb7mr2106559plg.35.1681450124110; Thu, 13 Apr 2023 22:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681450124; cv=none; d=google.com; s=arc-20160816; b=U/5xDrRfNbPcb/Txd3XfoanqtdfjrT65NJvlLCfm/tuNe+J8f6FyyOmSNyqs8hv/ga QXkeQ8g+FtfbWsbVPbVO59/Kou/SJdRpOO0DGPJ4dAcDHViGDozRJIYXxvweEFlKNe1I pQ42lA4obBHbRzVRjaQAMvliOHPgbPFb9ZJFKkk7+xTO7pSDRa8jUmdsh0jWzJJoJWnz i/u5RAWBYELhAs6nUwJYOy3gaFWdqdEhfkS8/YSLsg1X2+Al47c6o1Mlz8a05Y25pTLM RkRGdNq0iXv9sgOULOtCg5H/+ThvesysIxN8ewugYQ552JGnOgWRK1iH7DxwU/ijWQ4K Pcxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=S/VRV/yGaJv/EFLoTAFQJkjLL59UNTumoyqh+PdYcEs=; b=ac/NqKvwdDScF2VoT6eSvuNLzo7sl25N5Dsu9sxKYtMlQPJqkdT6y/6xfA07VpJzxj 0Snj2B8i7V6Q3ocBXLijrcROEYWtVFrl35cubBxH1rILQopDFXYpWceRaj5uCpGlEag3 qROEfe5dOxyWZd00mKW/ReRgRLM/nJ55oO7p797AXdlqTCFa1DFOdoFSRT4Cd4we1UGY Q46mPOkfpSPKETVjoZZq08YEQCDxfx1hOuH9dfiVcv5uU23SS8vZVJKqb20RrxyN/AY2 KEAdH+lp02EqnfFWSur4F31h/9cR9MJ7CbLfKnjSw7wSZNvtF0i43EhBaGbNVbunSU1b X7eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GDQODF+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a170902ce8c00b001a5298ca6d5si4064118plg.453.2023.04.13.22.28.30; Thu, 13 Apr 2023 22:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GDQODF+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229540AbjDNF1j (ORCPT + 99 others); Fri, 14 Apr 2023 01:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjDNF1h (ORCPT ); Fri, 14 Apr 2023 01:27:37 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C9D1BE8; Thu, 13 Apr 2023 22:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681450055; x=1712986055; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5n/0mu42zjwQFiX1Bk2YBnMsraHX2+ZdlcxSeNpwlQA=; b=GDQODF+IB4c7PWaOy+wICacgxDdbDCvHTt6rIp6ykLNf421zZ8bamOvF CGk3iM5Co5+PYe82SMHF5HAwzKEbLOehSoYeuHdIirTA221DyO2wGB1AI 0DXF30Ddg5agvCjTim2KKL5Ep+a4gFCJkJsv4b31owHxvZBV1T82uy6ah 8c2TXYGASSUpd0jNDIdoyqe5qJI0wNqcVkm9L7Q0mLcDH2msTv3rtrI1h +zUYp++fMKbAKcLxhKj9TYsvUIMLffisLzhkTOsYPlBAMFd/BD+v/FU6K fPmXkgJztjgCSAp07hDTlcanh2GtgdCnY40w7YWnZ5pgc0k97+Y7OFtJn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="333152648" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="333152648" 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 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(-) -- 2.34.1