From patchwork Fri Feb 23 19:24:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569879 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 646251448FF; Fri, 23 Feb 2024 19:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716451; cv=fail; b=HmOdSlWe0FZgyymJflSzgeQbJn6YSTl6Oce6zaTfVVv4XAssVTSCSL4SmzQVE3WPM9ZAxIcv0UPRhXJIvs7bhANyrHzludOoUqP/rPFm2BE/RUQmLTFIfOzLnqBc9ruo3MNpvREUzvpCtUykrKlLz1AfVHP53Kh1EPKgywJJ9NU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716451; c=relaxed/simple; bh=8feHoYxZ3rNCGgZZnsZp9789s2w9BBLP2QJSpFPp+3Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=taV/rKewHloqkjgQ/9mX1WfVD4IAN68xAXSSoJk3qQr5zkVftuKX81vnHcIpCR4RrOosFFnkxEPAU/eReM+d8Jxk8APR/kUaPMNl48blwJBxNmozrpepjDBzl41pTuGW/sJDAx7Fk2AZq9kToK1PWJDyeCWu/IZcvXWI3XhtTto= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=UY3hKYOc; arc=fail smtp.client-ip=40.107.92.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="UY3hKYOc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsCsAl+MIRYFQDLHUJrqpZGY11WXD5jevSP3R3sBIMg/xDHjVtI+VSMoL5IzCJ3A5MRyY/TewRFvyXvTop0d7KlvI1dr9kUVtUw5T4u3rGglh3/aYNQCoq25PNSClZARnFrZqJOb924oOKAL+mZr02rKH5IRp6IGGMlBdIlxHcPSoRHn6nCjXrQp+1giZ8tYXgQNIDKYpRda5bDqZXUUWwt0O7XaH1sk704g1TX3lcnLfsTBce+ilic9ebw7pZUgWxSUsEtWRFHbA41Q05jnL3kXqlwPrTNEIf6X8rh3HrKHM2z5I4yNdnu9Q3U/1TvH1IGBA04CgAVuNEB5oEr7YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dY4V+/ZWqhCEoAtnGgwFCeXOMeEt8vzUV5T+ws0Os3A=; b=QEY9OizVbAPrv3YecGppTYV0lQi9zz4jaQ1jNwRa80Z8fL7KJEizpTChta2JgvsjHHcKToofZqEOdKLh3Z8Jsv58tSLidVsa5us371RVI1L1EDReg6ZCyDGq3xwVHCCy2KPWGDF2Fb+Nk1GAd+zPFrvt9abddqNP3rt8ICDDNjMtwy0ZRhc2g4HqXYEhE02MQB1WEG/i63lKsAf0FWLTkSv9Ctbj/Ag8PV+mzCn0rA17veYIrpS6s8gyVy7f817tcdTYJDrG/0dnWyluCqECq89VgUSbPSSsnLtwnMq4QRdMB+znAHg9BH6TRQOtLjGmUAhltTHdFlkWb3CPzwJY1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dY4V+/ZWqhCEoAtnGgwFCeXOMeEt8vzUV5T+ws0Os3A=; b=UY3hKYOcXTEp6yTQvg3wubEXkhErXbPC6FrsShgiPYQfQ76PYms4nAcjbzAPPEfpmbpCrLNFl9lRSymXBNYW+KHYEZMkR0EbfTmUwK9fbvQNYzaRIokgO7nHQ2O8HluWqDfuiXa/B+WT1eJ8IIRgHA+JkqLkzPwatu4bfmx4H2zmAmQEY9zljeOEn5K7CqbbOxWAtR+rGmvEhoD2i7f4RGI//TSOucdJFckeHVx/61rQlwPbPx84QNrYfG7SXPziCMix7Ic7aGiuWohleZ7ZUgkokw/5o+S7oybSbO1xFrIrEU0GlNpKh8qD3gvl+GeJia9jWORkQ9EPaQjeFB8CMw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SJ0PR12MB6831.namprd12.prod.outlook.com (2603:10b6:a03:47d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Fri, 23 Feb 2024 19:27:18 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:18 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 1/6] ethtool: add interface to read Tx hardware timestamping statistics Date: Fri, 23 Feb 2024 11:24:45 -0800 Message-ID: <20240223192658.45893-2-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR13CA0041.namprd13.prod.outlook.com (2603:10b6:a03:2c2::16) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SJ0PR12MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: 9905dc9c-8e0a-4f7c-795b-08dc34a572ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: II2DtvgiUm/1V82zgAyawl48ynWKP6lwQlAMYRaV4gZOB4HiFuYlksRRq/6C9ZnC6JZAnK9nrHLkgt2dDK8pZsQY6dZG/hxRRBbwPI8dj0L4QOJNQnqIxjG4RvfHgQkd8vkvbMLOH9gGJ7DaO6+FPMJEILCnyQ6tRRGfd4eG19t1mtLg15LmQQNZk3712SkJCx2p6YTpDr2kYOmV3v1K0kUq2TOIsMNJ9XmvY9zOKmI3nc2WMQafbamjctxj+dw6Pyl684oxywEaphrWJeGMXfmT8njAQF9BNx9jTcQtC04URIys/JlFulr8BMj/NIZqw32eqD0ZJuUUp4du5/0fvm8HfTvMcObyyGzUnymS7Rm8updlLEN1P1K1+X7UEjib0Pv9RhG8p1ifQa7uoyVBxzDlXHbBTLpittIYUZpVfvP+AbP4t36WlfADqAOJYDNsKyv9AI8ejTKp/b2YAGxwHkrCcrFrmyK4uTuvgrLQmMPdhymzfSKE3c7rrGZRvM3EOeoKZNX6CsLTWaFAEOQo/a5p35a9Fa1EiiwYfO8Lhexapp9C9+b+A5GbDqL9vzYkz+U73feyONFPGkGcW0al0YiD3+i3vmOl8lmAJxkE4GM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: axrlAjToC0YPhqIQVE3xF3RkieH4b6Ug/iPXYtrWZROXw4wHNZYCh8kUyy1d/p0+mKaokQbiiD6UFp5eZBH2OCflnl9BjzSL/uePJXkFGM8gzXpgUPF+CMW3vm+GtfigTuAyegxE5ZmpV92Z3BOjGpYqKvQ79Su6ROhSxxE3fMwmkte5sNrobesa80r+/l4irztpG7R+nRMa9LD8r1xynnv2fXEC7uhtAECz9wb73wbWKCZWaZxzr9XGfz/AqgYTiOVeUHVDNt2GIDkwQF5m9HOSNEmBjiSwOj7MojU05b4rAaRNGThg5wrHMvZ4ATPvbtAQmp9Sr74DWGqlB7supUH3erCdaKSMLZAsAtthH1l1cOyHqIvOPXMDlroecibms3afYDGgjgyWjeddSjaXg9POtPlNCSzziUicbaGKDXRoXJc1pVn0Q9zwgnwQ9Ewxy0C6BDbZuqN1qBBqKUztGXk1qw9wThIDRPID+X6LCln/RGlpxOGuYUTY43PzPqVLzxgTXiXE9e5mJ+2j1znNZFTaqF+oHTrgDyjMhK9IVYSSE3jjF3smfk5VuuGUGxDqp6tKtZ+4+PklfMxgfoHRqnOodT/rkKQ1MaAsdjjWe4J3/7u8vyiEltFCvH+DSxwMy+/VARQl74z+nTCaKzoJRB/jyzQbfH9RiuCXfvNooPsJ4oSs6CB21hbwkjPYd57+Bp2Q9ZUN3ZsSK/VZhIajm+98sDdxER9fy8OgDVdsDnn5pU6IhjUGvjxaoBt4X934VT/0ItTPuHnIsIhqHktVrflAcFFEebUWEw70If8nTAMSg/Ajffrbh6GWUzdbBj4POzlmQWtsu/jxvshcLoyL0jJclHy62jWmaB2odLqjc/uUWx9zllfjnVD+o9sXJ4VaCuYwI/4U22q28Fz6ySMWTjYLP8PT4aLGEijJ81NyarBuyf6KvkrwcxtWzZuZ6Bdk1n5TnHqdo7KEjqr+yqbU9eCxPZpqxbru9sfx9S+oo4Z8Rq7q0XRyd2wxgxJt7+IUkEMoHkj/+Fp9PZuvX2573r7mkJB80DCJDdVAkwIhmzlT4Y5eVbqxQLzrAls9v+XOaffmXu04WoqjBo7eFr8gsdLqvN97zIi1XuE99bj+Ux1gCpe1KhQH/qkJdiIpcbe9B1rth1Z9v9dgajn67d8H38IKy36oyEpKghYKnVNRHZdi3CNbzn44hPxtNTL5nBN8qqdk6qrmjVd1hc7npTuJhF2+4WF3ilKKr9gCVutrZfdhG1L7h4KwqkFtEC0TqlSXPhtTspSa9LnaMAELrcEvS7vXud1fIji1dbIyTaRObUYP6/3odJy/deK2B+NGpLaSaeKeZurRdQ7VoqcGonAi/NRoCz/FzT97o5eCBkK5hzwNLL2LXNxDggLBNDpuolBEWYgoNIxjYymgwCGdbCvzr2mx7t0E1IlVfNl6rBrFJdk6WR84WkU3dm/++fWxkAL+HND/Y/Mgjrdy8ih+CKpRT2axYjuSqgxSPXthTvs6zQ3mb1xXeF/s6SRUNk4xhumxdGHurnLyxo15tc2vd62o6LVpuuBqy66AsRWTp0ihW8EmmaZhqg/4aEJ6HnG+5UWHxNbZUPEkaL2rjt6q/6KDUg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9905dc9c-8e0a-4f7c-795b-08dc34a572ae X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:17.9473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pjpl8+e8rmjyKUhCQvkZ5XCgkESO98dqz4q39Q+alx7AosbaF5JMZvGZu2w2h5xLep1QASgoevdZMd44uwqPxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6831 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Multiple network devices that support hardware timestamping appear to have common behavior with regards to timestamp handling. Implement common Tx hardware timestamping statistics in a tx_stats struct_group. Common Rx hardware timestamping statistics can subsequently be implemented in a rx_stats struct_group for ethtool_ts_stats. Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- include/linux/ethtool.h | 28 +++++++++++++++ include/uapi/linux/ethtool.h | 20 +++++++++++ include/uapi/linux/ethtool_netlink.h | 17 +++++++++ net/ethtool/netlink.h | 3 +- net/ethtool/stats.c | 53 +++++++++++++++++++++++++--- net/ethtool/strset.c | 5 +++ 6 files changed, 120 insertions(+), 6 deletions(-) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b90c33607594..1cc1010afaca 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -483,6 +483,31 @@ struct ethtool_rmon_stats { ); }; +/** + * struct ethtool_ts_stats - HW timestamping statistics + * @layer: input field denoting whether stats should be queried from the DMA or + * PHY timestamping layer. Defaults to the active layer for packet + * timestamping. + * @tx_stats: struct group for TX HW timestamping + * @pkts: Number of packets successfully timestamped by the queried + * layer. + * @lost: Number of packet timestamps that failed to get applied on a + * packet by the queried layer. + * @late: Number of packet timestamps that were delivered by the + * hardware but were lost due to arriving too late. + * @err: Number of timestamping errors that occurred on the queried + * layer. + */ +struct ethtool_ts_stats { + enum ethtool_ts_stats_layer layer; + struct_group(tx_stats, + u64 pkts; + u64 lost; + u64 late; + u64 err; + ); +}; + #define ETH_MODULE_EEPROM_PAGE_LEN 128 #define ETH_MODULE_MAX_I2C_ADDRESS 0x7f @@ -807,6 +832,7 @@ struct ethtool_rxfh_param { * @get_eth_ctrl_stats: Query some of the IEEE 802.3 MAC Ctrl statistics. * @get_rmon_stats: Query some of the RMON (RFC 2819) statistics. * Set %ranges to a pointer to zero-terminated array of byte ranges. + * @get_eth_ts_stats: Query the device hardware timestamping statistics. * @get_module_power_mode: Get the power mode policy for the plug-in module * used by the network device and its operational power mode, if * plugged-in. @@ -943,6 +969,8 @@ struct ethtool_ops { void (*get_rmon_stats)(struct net_device *dev, struct ethtool_rmon_stats *rmon_stats, const struct ethtool_rmon_hist_range **ranges); + void (*get_ts_stats)(struct net_device *dev, + struct ethtool_ts_stats *ts_stats); int (*get_module_power_mode)(struct net_device *dev, struct ethtool_module_power_mode_params *params, struct netlink_ext_ack *extack); diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 06ef6b78b7de..39edae554fc5 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -681,6 +681,7 @@ enum ethtool_link_ext_substate_module { * @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics * @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics * @ETH_SS_STATS_RMON: names of RMON statistics + * @ETH_SS_STATS_TS: names of hardware timestamping statistics * * @ETH_SS_COUNT: number of defined string sets */ @@ -706,6 +707,7 @@ enum ethtool_stringset { ETH_SS_STATS_ETH_MAC, ETH_SS_STATS_ETH_CTRL, ETH_SS_STATS_RMON, + ETH_SS_STATS_TS, /* add new constants above here */ ETH_SS_COUNT @@ -1462,6 +1464,24 @@ struct ethtool_ts_info { __u32 rx_reserved[3]; }; +/** + * enum ethtool_ts_stats_layer - layer to query hardware timestamping statistics + * @ETHTOOL_TS_STATS_LAYER_ACTIVE: + * retrieve the statistics from the layer that is currently feeding + * hardware timestamps for packets. + * @ETHTOOL_TS_STATS_LAYER_DMA: + * retrieve the statistics from the DMA hardware timestamping layer of the + * device. + * @ETHTOOL_TS_STATS_PHY: + * retrieve the statistics from the PHY hardware timestamping layer of the + * device. + */ +enum ethtool_ts_stats_layer { + ETHTOOL_TS_STATS_LAYER_ACTIVE, + ETHTOOL_TS_STATS_LAYER_DMA, + ETHTOOL_TS_STATS_LAYER_PHY, +}; + /* * %ETHTOOL_SFEATURES changes features present in features[].valid to the * values of corresponding bits in features[].requested. Bits in .requested diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h index 3f89074aa06c..55f2a3c8caa0 100644 --- a/include/uapi/linux/ethtool_netlink.h +++ b/include/uapi/linux/ethtool_netlink.h @@ -749,6 +749,7 @@ enum { ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */ ETHTOOL_A_STATS_SRC, /* u32 */ + ETHTOOL_A_STATS_LAYER, /* u32 */ /* add new constants above here */ __ETHTOOL_A_STATS_CNT, @@ -760,6 +761,7 @@ enum { ETHTOOL_STATS_ETH_MAC, ETHTOOL_STATS_ETH_CTRL, ETHTOOL_STATS_RMON, + ETHTOOL_STATS_TS, /* add new constants above here */ __ETHTOOL_STATS_CNT @@ -875,6 +877,21 @@ enum { ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1) }; +enum { + /* hwTimestampingTxPkts */ + ETHTOOL_A_STATS_TS_TX_PKT, + /* hwTimestampingTxLost */ + ETHTOOL_A_STATS_TS_TX_LOST, + /* hwTimestampingTxLate */ + ETHTOOL_A_STATS_TS_TX_LATE, + /* hwTimestampingTxErrors */ + ETHTOOL_A_STATS_TS_TX_ERRORS, + + /* add new constants above here */ + __ETHTOOL_A_STATS_TS_CNT, + ETHTOOL_A_STATS_TS_MAX = (__ETHTOOL_A_STATS_TS_CNT - 1) +}; + /* MODULE */ enum { diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index 9a333a8d04c1..962ecd62aeea 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -429,7 +429,7 @@ extern const struct nla_policy ethnl_tunnel_info_get_policy[ETHTOOL_A_TUNNEL_INF extern const struct nla_policy ethnl_fec_get_policy[ETHTOOL_A_FEC_HEADER + 1]; extern const struct nla_policy ethnl_fec_set_policy[ETHTOOL_A_FEC_AUTO + 1]; extern const struct nla_policy ethnl_module_eeprom_get_policy[ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS + 1]; -extern const struct nla_policy ethnl_stats_get_policy[ETHTOOL_A_STATS_SRC + 1]; +extern const struct nla_policy ethnl_stats_get_policy[__ETHTOOL_A_STATS_CNT]; extern const struct nla_policy ethnl_phc_vclocks_get_policy[ETHTOOL_A_PHC_VCLOCKS_HEADER + 1]; extern const struct nla_policy ethnl_module_get_policy[ETHTOOL_A_MODULE_HEADER + 1]; extern const struct nla_policy ethnl_module_set_policy[ETHTOOL_A_MODULE_POWER_MODE_POLICY + 1]; @@ -454,5 +454,6 @@ extern const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING extern const char stats_eth_mac_names[__ETHTOOL_A_STATS_ETH_MAC_CNT][ETH_GSTRING_LEN]; extern const char stats_eth_ctrl_names[__ETHTOOL_A_STATS_ETH_CTRL_CNT][ETH_GSTRING_LEN]; extern const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN]; +extern const char stats_ts_names[__ETHTOOL_A_STATS_TS_CNT][ETH_GSTRING_LEN]; #endif /* _NET_ETHTOOL_NETLINK_H */ diff --git a/net/ethtool/stats.c b/net/ethtool/stats.c index 912f0c4fff2f..e4333d77fb31 100644 --- a/net/ethtool/stats.c +++ b/net/ethtool/stats.c @@ -8,6 +8,7 @@ struct stats_req_info { struct ethnl_req_info base; DECLARE_BITMAP(stat_mask, __ETHTOOL_STATS_CNT); enum ethtool_mac_stats_src src; + enum ethtool_ts_stats_layer layer; }; #define STATS_REQINFO(__req_base) \ @@ -20,6 +21,7 @@ struct stats_reply_data { struct ethtool_eth_mac_stats mac_stats; struct ethtool_eth_ctrl_stats ctrl_stats; struct ethtool_rmon_stats rmon_stats; + struct ethtool_ts_stats ts_stats; ); const struct ethtool_rmon_hist_range *rmon_ranges; }; @@ -32,6 +34,7 @@ const char stats_std_names[__ETHTOOL_STATS_CNT][ETH_GSTRING_LEN] = { [ETHTOOL_STATS_ETH_MAC] = "eth-mac", [ETHTOOL_STATS_ETH_CTRL] = "eth-ctrl", [ETHTOOL_STATS_RMON] = "rmon", + [ETHTOOL_STATS_TS] = "ts", }; const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING_LEN] = { @@ -76,18 +79,27 @@ const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN] = { [ETHTOOL_A_STATS_RMON_JABBER] = "etherStatsJabbers", }; -const struct nla_policy ethnl_stats_get_policy[ETHTOOL_A_STATS_SRC + 1] = { - [ETHTOOL_A_STATS_HEADER] = - NLA_POLICY_NESTED(ethnl_header_policy), - [ETHTOOL_A_STATS_GROUPS] = { .type = NLA_NESTED }, - [ETHTOOL_A_STATS_SRC] = +const char stats_ts_names[__ETHTOOL_A_STATS_TS_CNT][ETH_GSTRING_LEN] = { + [ETHTOOL_A_STATS_TS_TX_PKT] = "hwTimestampingTxPkts", + [ETHTOOL_A_STATS_TS_TX_LOST] = "hwTimestampingTxLost", + [ETHTOOL_A_STATS_TS_TX_LATE] = "hwTimestampingTxLate", + [ETHTOOL_A_STATS_TS_TX_ERRORS] = "hwTimestampingTxErrors", +}; + +const struct nla_policy ethnl_stats_get_policy[__ETHTOOL_A_STATS_CNT] = { + [ETHTOOL_A_STATS_HEADER] = NLA_POLICY_NESTED(ethnl_header_policy), + [ETHTOOL_A_STATS_GROUPS] = { .type = NLA_NESTED }, + [ETHTOOL_A_STATS_SRC] = NLA_POLICY_MAX(NLA_U32, ETHTOOL_MAC_STATS_SRC_PMAC), + [ETHTOOL_A_STATS_LAYER] = + NLA_POLICY_MAX(NLA_U32, ETHTOOL_TS_STATS_LAYER_PHY), }; static int stats_parse_request(struct ethnl_req_info *req_base, struct nlattr **tb, struct netlink_ext_ack *extack) { + enum ethtool_ts_stats_layer layer = ETHTOOL_TS_STATS_LAYER_ACTIVE; enum ethtool_mac_stats_src src = ETHTOOL_MAC_STATS_SRC_AGGREGATE; struct stats_req_info *req_info = STATS_REQINFO(req_base); bool mod = false; @@ -104,9 +116,12 @@ static int stats_parse_request(struct ethnl_req_info *req_base, return -EINVAL; } + if (tb[ETHTOOL_A_STATS_LAYER]) + layer = nla_get_u32(tb[ETHTOOL_A_STATS_LAYER]); if (tb[ETHTOOL_A_STATS_SRC]) src = nla_get_u32(tb[ETHTOOL_A_STATS_SRC]); + req_info->layer = layer; req_info->src = src; return 0; @@ -118,6 +133,7 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base, { const struct stats_req_info *req_info = STATS_REQINFO(req_base); struct stats_reply_data *data = STATS_REPDATA(reply_base); + enum ethtool_ts_stats_layer layer = req_info->layer; enum ethtool_mac_stats_src src = req_info->src; struct net_device *dev = reply_base->dev; int ret; @@ -144,6 +160,7 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base, data->mac_stats.src = src; data->ctrl_stats.src = src; data->rmon_stats.src = src; + data->ts_stats.layer = layer; if (test_bit(ETHTOOL_STATS_ETH_PHY, req_info->stat_mask) && dev->ethtool_ops->get_eth_phy_stats) @@ -158,6 +175,9 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base, dev->ethtool_ops->get_rmon_stats) dev->ethtool_ops->get_rmon_stats(dev, &data->rmon_stats, &data->rmon_ranges); + if (test_bit(ETHTOOL_STATS_TS, req_info->stat_mask) && + dev->ethtool_ops->get_ts_stats) + dev->ethtool_ops->get_ts_stats(dev, &data->ts_stats); ethnl_ops_complete(dev); return 0; @@ -194,6 +214,10 @@ static int stats_reply_size(const struct ethnl_req_info *req_base, nla_total_size(4)) * /* _A_STATS_GRP_HIST_BKT_HI */ ETHTOOL_RMON_HIST_MAX * 2; } + if (test_bit(ETHTOOL_STATS_TS, req_info->stat_mask)) { + n_stats += sizeof(struct ethtool_ts_stats) / sizeof(u64); + n_grps++; + } len += n_grps * (nla_total_size(0) + /* _A_STATS_GRP */ nla_total_size(4) + /* _A_STATS_GRP_ID */ @@ -370,6 +394,22 @@ static int stats_put_rmon_stats(struct sk_buff *skb, return 0; } +static int stats_put_ts_stats(struct sk_buff *skb, + const struct stats_reply_data *data) +{ + if (stat_put(skb, ETHTOOL_A_STATS_TS_TX_PKT, + data->ts_stats.pkts) || + stat_put(skb, ETHTOOL_A_STATS_TS_TX_LOST, + data->ts_stats.lost) || + stat_put(skb, ETHTOOL_A_STATS_TS_TX_LATE, + data->ts_stats.late) || + stat_put(skb, ETHTOOL_A_STATS_TS_TX_ERRORS, + data->ts_stats.err)) + return -EMSGSIZE; + + return 0; +} + static int stats_put_stats(struct sk_buff *skb, const struct stats_reply_data *data, u32 id, u32 ss_id, @@ -423,6 +463,9 @@ static int stats_fill_reply(struct sk_buff *skb, if (!ret && test_bit(ETHTOOL_STATS_RMON, req_info->stat_mask)) ret = stats_put_stats(skb, data, ETHTOOL_STATS_RMON, ETH_SS_STATS_RMON, stats_put_rmon_stats); + if (!ret && test_bit(ETHTOOL_STATS_TS, req_info->stat_mask)) + ret = stats_put_stats(skb, data, ETHTOOL_STATS_TS, + ETH_SS_STATS_TS, stats_put_ts_stats); return ret; } diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c index c678b484a079..ce1e193076c3 100644 --- a/net/ethtool/strset.c +++ b/net/ethtool/strset.c @@ -105,6 +105,11 @@ static const struct strset_info info_template[] = { .count = __ETHTOOL_A_STATS_RMON_CNT, .strings = stats_rmon_names, }, + [ETH_SS_STATS_TS] = { + .per_dev = false, + .count = __ETHTOOL_A_STATS_TS_CNT, + .strings = stats_ts_names, + }, }; struct strset_req_info { From patchwork Fri Feb 23 19:24:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569876 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08F1A143C78; Fri, 23 Feb 2024 19:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716443; cv=fail; b=cKjMuVA10PX2H200GiAZZZUCqPJ1rvHLsD9qW9kNgIvBTJfTIxpXIVmpJP4ugeCThdRnQbTxj0ZLEo9Vbvb3opDDEVKOCNxjzeQE1CgmKGu6d6aFnThKEBvS8UQhXd45BHB91vJwbC9vngJN/vfsKlVv+c7zZW4pWSXdQovOoB0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716443; c=relaxed/simple; bh=7fd+Kgu4uLN39161xBgBH39m6WuN6GvXrp5Ez1zQIlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lLS8a0xbhw+67ywG6/z3x2SZjzrZkLJElkdzPguQohBk1pgi0478tii3eK3WHRUX/zjZIMgUasxapDG9Zj5tP+vljPP28qOrQce9D/d2Q6Y9AZusbDVrJqln7pKygVd53uGWcjq+KtU3ABVCarknSDy4QI/UiyIKrxWdZnuBk8I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=P2fTBvfS; arc=fail smtp.client-ip=40.107.92.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="P2fTBvfS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JuGlzlpdFJdJ093Mp91JrGylEp1+lY/1d+5aV0HPsQCipXnh3eB546oZKQjOEqdnoAMZjZOxOcDPJlgxyWjcWDe+6LGXp7f835YVMGuOt8a/QxAZ5PmUnguhceJuynX/SQlAq/dihiACsoiuZRvuW47Z2+4jD1N3QckzOblR7rTP+dgwQ7W2dKr3psSFn2QEuQdTpifypcipFzJREhCpdKCYDcHkTN0OCX47bUnt9emnNHgTl0/ptAPx2Dz9+hIAsQWl1PDaYHUALCLMfazmjUi5wlonMu6iM6rw2tgyfgrBdFTKzGRZdYITA+atEKNyCgZFITMUwLfZDRo0wt1QxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wOufzfcYPeiRdHi9Ovu02DHwY43No8jQr1B4aPT+z20=; b=aIaZ0Mxy50zmh31H6IAYmv60mIU49LZGVeJ7DIQ88T8/IUh9bHFWK6LSia6SWlSwMTjqJgHNJP4I89WuR9Y14f5K5RFPEmhE0c9ztbz4RsVYM9EvQr9+cVf18yXgzTQsh3H32mFKg+8AJtAwc9UJpT1k10Lb00E4zPJiZ++UxSVyG2n6YsPyfoBtjNDzer+4s/qtRR+WLjEn5qIflh/fQv/fVqXz84SEAJflpqawHrEoQFhVA3U30cpjvbRcwmAM4G5cfxRzbMv9LsORz1iA2oMmKigM7Cmpe/ue04aMfKpcjFQUNNHVIM4YCspSxt3kRDYbwf1kXa/gGTqIkX7rvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wOufzfcYPeiRdHi9Ovu02DHwY43No8jQr1B4aPT+z20=; b=P2fTBvfSidJcruuXz4vvQZxYZIzeg90hkGBAg3FN6KKx9eWPRhdBS2xUv9tx1ZneQNJU3QJ0l75cup/6FMnWVALNcdAJ+3A9LJy4YGaXJHMPp80+aAIfL/YimOgdRECBrQNHqB9WVB+oRACHv2C2zjEqKjSj1uZMefCHyJWJJF4VHBRnvmocZD9Ki6HA/gU5GvSVMB430ZkbflmCyL7dnwRj7ipNbEDM5f/ZCLTvJtBFrHHPjbW+goxYPsWCQlmmXGLsZucekvlgc/E7BssPv30g4ZAROwrbfUG1rW+qJCEdjWkqGbJdXxERuCI05SAy9Tbb4aHwFMGm4Hc5aY5XaA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by BN9PR12MB5226.namprd12.prod.outlook.com (2603:10b6:408:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.27; Fri, 23 Feb 2024 19:27:18 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:18 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu , Saeed Mahameed Subject: [PATCH RFC net-next v1 2/6] net/mlx5e: Introduce lost_cqe statistic counter for PTP Tx port timestamping CQ Date: Fri, 23 Feb 2024 11:24:46 -0800 Message-ID: <20240223192658.45893-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: BYAPR01CA0057.prod.exchangelabs.com (2603:10b6:a03:94::34) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|BN9PR12MB5226:EE_ X-MS-Office365-Filtering-Correlation-Id: 005d94bf-537b-48ab-7fbd-08dc34a57319 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TPgfWhwFXbLzDe4d7hPmbT4PxG0p6SV7eT6Tp/EKtjp6HWb1QwyTowgDKFu0Q4+XhUSD8Qy+sT9Nrm80t88PBgO4d4niaRKMwxfziWnxcEe4XL9L684FeiLXhXk7gvyWxDdgPn/oqKfzKLx49Ru7vRYs+UZbYDzuY8bypLVHxI5RNCm4lQnabt6Bl/4SH/UJPYxeHuPaZLXCvd0aZv7k1DJsDh/M179chuNqooESkE6Gx0Vczwe4mEaahQ3NqA9gmcVh8t4D2iCX75AqfojvUALA+fFc2ZHS9VrwB+X+1Qca/P9ZzIUai3PfCkPJ60VyWRZhTH6fqcS+UW33PGH2vfJC6sZiBxStStOmc+JJO0hgT7RXykS9UYzCecBbtT8fyUmW5d0UYf6x698uCkISkMGiaVZVL+pCYKZVmNgp8Lt+gvpVvrBk5xJkBTvKp99FaAxkYQQzYSvjw8La9iAu3Cr+ICKJwg1IRNsix1j5QT22Q5hMYv2fAQUO9/3EKbX5jik2ucq07bD20Y61DbXn9mA3cp47SsIeMXmMVSYQT8OVvnltRIKxeGoUVAI4WM5EzTWptv5DnbTHbQEDrcmLZwgo9wUFj110UcwbWfwYPK4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n0ysmiqtDacUArw2aFFE+McfQ1OgVK5XM1tqebK4eIm3VEcZw/cVonuX+DX31alb+HYHL+/P9lyXdb1k0t7OJ0Fh1idDrs5TGBcYHtqmVa481STuIHsO22QX15URWEs/5SKnmQRH/TUjaV2JuVqd1xN/5CukouCC//oau6dEKY3nCBAIZRWh4Fujt4fE4L3GuxHgC57mRC6sIa6Ma9QzcyBZ1qniNUVxg/BxeEX7wPLX8A7RIrzfAZfNrisHVvZFHuhYkWdANtKuEVuvwwRBVI96Yrn1PegLNa9TeXaReaEIseRNm3f9de2GMzjbLcOdAX7wBeQexILNyic0b7m5EHdauIUtYxOIy7kA76wlAO9QZUQFIUT7up74SJi3HX9AEGAkbhIO9BshQsHoz4Ehs6iMlT8G1NvQbZ77E7FOUPIIVbGfJwf/EZ+OsIma7XeNfWvuQicE4HUzUFGtLnCEpx24k/pkV/O9/p1dSWbyuK2xCGFLKO09Zxn0gfRcgKXRqzMLmwAMapx9733QjLTfNC55QNGWdr/nSqIItEf8nL7z4mLNU3htyb9wU1LY0IyItgnWMI1wPMlJvihouw9cTPVJQEtjedHn9dvHahZvTwTRkDDTbYgYAgU5Pv8LjieDvViEmo2UqM+6GV0HMrj7dAuE3x9Zst/dM/fw7E/RlONCmoxUw8psug3xnik0n3N/jVZm4VXFnVWdBspX43uFLF4PRBGbmc+uVgRYvqpbUWGehtpFNIIhIivt1j4o+xvodreFRSoRVljYrntx4rg7EC/05fov8NScchtQcEa1/N3/7ccA2hPwNSuOPaifDXq2wkfz/VoliwP961eeUYh9+IbIy8UBxIiCjP01tY4+irA8hinFqIfJr4KS60BJKE5gX1k0mR0fqxfimo+Bwe/a4eeE3FRXUh+2mQ1L8aTnviu8m3yXbJ8EjzvzWz2bbHbC7vmOqSAC3I7aSAwLMiEXFp2Y6FDPfoQasSXyixz0rLUG4YCHHqknHAvTKN+plvXEy6bY030RyQ8iUXfDATGGwS1H9N1Kummn/1wJ++LlKlaX8/f6UKUMrMGeWJKHjYkxxJwhhhhVfEwofaSbB9PU5FG0+jfd79Cz5dOb6LwQDF3Lhu7u+kw7qWCu0jXGt+OPrYXB968meMiXh7Osm3WwxUh05CU02O+DhasCHa+Y9z8mBQYlztSyUWm4BXrFYT2V5iIpcyh23mu7huUWnwnf669kbyrhYd9btCjgp5KzUPCe888x4YnPH6Odg5BUcMdM2/abWjgtDhgCw56mvNVVORySWlK1J/CTbU1iezsYaF6ARRj72Y3ImrIX2grFAzufzWt7Ba3CiUysPoT01lA8T1/lx/XEDUld223F36GNF+A3wzN/pNHkcgibwgW34buDImnHjt+gYqiULqTSB2h2XEAhguoT+ZRIRfDhv5owOvH8liNSNKxIfYc7I4ud+WyvEdus9xeVhm2W+4eO3nG0yWc/+I8Zvr4AnevQmGt6HGBnrHl7Q67Md2kqWS8xFman1dCXC7522cKtO4fR0SljjtLlBjZuF6vuJnYGZgqjVXutt4F6+gGvDcc/7zgkeyFS94dOo/hRCs64LrhuFh0sRw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 005d94bf-537b-48ab-7fbd-08dc34a57319 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:18.6723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w5D8LlTMd6iFLaf9faTXN/hya2FAkKbZUQ4M/RpO8EcpXl7z6ZYBRyKhPmmDf/0zy6H4+u8NSNuu6vsUCN6Tfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5226 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Track the number of times a CQE was expected to not be delivered on PTP Tx port timestamping CQ. A CQE is expected to not be delivered if a certain amount of time passes since the corresponding CQE containing the DMA timestamp information has arrived. Increment the late_cqe counter when such a CQE does manage to be delivered to the CQ. Signed-off-by: Rahul Rameshbabu Reviewed-by: Tariq Toukan Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed --- .../device_drivers/ethernet/mellanox/mlx5/counters.rst | 6 ++++++ drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 1 + 4 files changed, 9 insertions(+) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index f69ee1ebee01..5464cd9e2694 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -702,6 +702,12 @@ the software port. the device typically ensures not posting the CQE. - Error + * - `ptp_cq[i]_lost_cqe` + - Number of times a CQE is expected to not be delivered on the PTP + timestamping CQE by the device due to a time delta elapsing. If such a + CQE is somehow delivered, `ptp_cq[i]_late_cqe` is incremented. + - Error + .. [#ring_global] The corresponding ring and global counters do not share the same name (i.e. do not follow the common naming scheme). diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c index fd4ef6431142..1dd4bf7f7dbe 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c @@ -169,6 +169,7 @@ static void mlx5e_ptpsq_mark_ts_cqes_undelivered(struct mlx5e_ptpsq *ptpsq, WARN_ON_ONCE(!pos->inuse); pos->inuse = false; list_del(&pos->entry); + ptpsq->cq_stats->lost_cqe++; } spin_unlock(&cqe_list->tracker_list_lock); } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 4b96ad657145..7e63d7c88894 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -2158,6 +2158,7 @@ static const struct counter_desc ptp_cq_stats_desc[] = { { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort) }, { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, abort_abs_diff_ns) }, { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, late_cqe) }, + { MLX5E_DECLARE_PTP_CQ_STAT(struct mlx5e_ptp_cq_stats, lost_cqe) }, }; static const struct counter_desc ptp_rq_stats_desc[] = { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 12b3607afecd..03f6265d3ed5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -461,6 +461,7 @@ struct mlx5e_ptp_cq_stats { u64 abort; u64 abort_abs_diff_ns; u64 late_cqe; + u64 lost_cqe; }; struct mlx5e_rep_stats { From patchwork Fri Feb 23 19:24:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569878 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 175AC143C6A; Fri, 23 Feb 2024 19:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716445; cv=fail; b=b1rpNl85Vvf0oXESHxz7Pz7Bzxtcn5TKBijyFkPtRA6VpAXEVzL4OQynYjwZtvW8n0frKyqtp1Owl4WU6K/kFhenXOrBgyH4ldGcoDtTpwRG6youaKtUt827xmZAC+6+s6Ab7GpzNkMxwp82AKSG75KCQm0YxyR58spvENwgisU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716445; c=relaxed/simple; bh=fkIWIxg7q00NWXu2983DMgOaMBHbu2OR9505vsIKCbw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Eqt8eHPrqNexBoYv7giYHtQuk/NVunFXRCejHc0JT06qqun42gMVacn+EgrAYHXsmXvhtnW69k1w4Jhcv78VV9M3qPRjE6FdA/73TAwK+O8HMPN0KK0UVyTNDQ5zAIUt7D8jhRYoGhLSwpFEEqA99MCh10n28YcK5nlDqhfM4l4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=OGlgupts; arc=fail smtp.client-ip=40.107.92.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="OGlgupts" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ohzl99EeDvyxGQZIfAYqvoDEVdf57D7HDuE8yx/0gtX5ZHVkG2XhTmH37xCTWWLUtfczod75gFPxjnHBKNGvadD6tN2vcQMhTXOWcXErrBfxL98tsULrAzm1eNZGaRm+YF0pJPcH/d3h1hm5G6/sjOnLz9XKI+NjM7zDoANM2F+J+a7AQBMbS4qLKbxHGnAqc66bFoYTL6gJ8R9iLCkiqjwX2ALgu8cWF6u7AmIY1vzRVyFtgF7p97rnYBUcuTHNqF+w44DuoQtvx9Z9Xpm1efzzecbkHefXNwkiepd8Qp9QRVihxN+JARZEPh44N/NgOnv73ja2IeCBdwTB8jOIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RfVkymu7Gl6vN5rHt/lbJFfwQungApT9WPWAslGor8g=; b=DEveQ4JGpK/uSl1rvR57/vbp6jLugIHlu8U6vp2OX9sLPN1AHOgSEaHxRLfJwrZmhSuT7sltKmC6zzCD/BQJZoxJlnf5cv348xRrd7QW/BQepT+p52Fu52kXR117DdAyTa4n+lGE3ROAQcUIVoEaBxAWpvlQHjIErxOf73yLFocKldd3LdPIFr1D3V6oKGfoikTz8lC1Hj782r4ZMtzmjrshCiKKTA4NXYIZOFnoXPKJd9m5FrvQHDnaFUyABMGMZM8gNB5TYoibvktALAVz2QKfSFDWoOji0PP605gAmfh7PlgKHYlmQrIGDGo/OgNK3sfdUk/NY0jBPHpMHvcUTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RfVkymu7Gl6vN5rHt/lbJFfwQungApT9WPWAslGor8g=; b=OGlgupts6FZ3CRZZNeUDUqFrK/c0PMC9ORYy2c65LnMg1AOdY/bmc/c4aZf1o3DZLJHK/kCe0vJKfYOPLkub1SFQeSriYtZZu1Drc7FJB125hdi8o7XSPZm4hPVKDSbqILTqBUt2POf4s7M8xbW8/sBv9McErMv4824zNuTsBzilnyx8feO19R9gXNjLcgEkCGBCqKMIXV1NclU63h/rekSWUcJtn/QR2RXF6WjmEWCpV7GCbLLtFwYzLgcTjbim0WO5WXKEtATclwiCb5+1kZoZy3Y5qZIJ3XJutQUiBPFnZq7luYkw8Jj96Nz9vX92snFwDXdQ8uHAAqHO3DCIgw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by BN9PR12MB5226.namprd12.prod.outlook.com (2603:10b6:408:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.27; Fri, 23 Feb 2024 19:27:20 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:20 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 3/6] net/mlx5e: Introduce timestamps statistic counter for Tx DMA layer Date: Fri, 23 Feb 2024 11:24:47 -0800 Message-ID: <20240223192658.45893-4-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR13CA0060.namprd13.prod.outlook.com (2603:10b6:a03:2c2::35) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|BN9PR12MB5226:EE_ X-MS-Office365-Filtering-Correlation-Id: 690cbf36-19b2-4467-2dac-08dc34a5742e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WSS/gpwl3aftD8UWckIAfDospyLt022LjL38AEoNkQcyIYZxaGfRgbmq39mKeCEGFTNV+OGDdHqVD3M5/6t2FYhnWas1ZvNxtneFAs9CvEtosCyThAuY2ThtRNzT/BqeqzdYl8U1ibVmphZhgxCq0yspQPei8wyREo6Up84SyoOhH3Wej0Aroiw63dN3VKNqxFETigXeqlifMRwTxR+6bN765qLRrQseyoX5Bc9xxgmfpgsLwKpSRsDMK595jy86XcYcIKoDDH4MrAWr+lB3LV2WGqSiwfKuEVVZNASLjJNCX/dX4eGNJcdPrw+2M5umNP9VXqnY+5gV5G+GHg0jEp6e/8FzRYqsALuGFn9sZA7UH6JnmIIbm3A42+YuhmlVHJlRPjkIessOGm3asZ5Gw4TIMVTetLvUMG8PRklBD/aACruUnzGiqQp77aZ/aQdqPdHhLYzDBvqjMgetDmKrPMjMa6dreK4/prQTdZGx57g7YRpL+i+uswfoy5YLHtBZkytSyr2jVVXJZEi5xwWve2MWiVYRLOxFfavt30+3kOt0M0UwJyujp8Oc5PBqEL4qmchzo7tlJFITm5pOsbERo1YWI9KTXV5exlXrO7+Gt+o= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PXri+onAtEK51YujLJoaxPvBwQkl5gs0yBEfEm45VUW1nlE27hkPNgRVYoGGvfSeA7NzcCRwDkpcg+wJ4l7foFU/T8OlZnJIpNT9b9bEu/zXnkLeXU8BKZlmmQ3ddJMyP0W4blUjwEa4Feg67JKknP8HcVgt9m1k5b0w4ZEfACH7ljKgX1u2u4TI28vP7RI3jMvwBbIcb/rABolTFzukWUap1JebH17y0IjXOWCk/iC3FRICybY334fSERCjqz1oLVR8dlUOaJ34xRFQtI2rayGQ95DDbYQGYnsUF7XZdgsD3SepGPcOtd3wc5gnALWo1v5RZUqynr5zyZb18UOAtPwL/8OFrW8pXoyawkLw8GNX0kTUMNB71Vfiy8obpJMtRDug2AdsVdbTuGLFMJ4LgS5Uo/kxndZ89iBk0Qf7H3HdLYZFFmeyPkSO9iWgQdQVxQ/vmEjl26rETguMOGXr6Qe3ywvHMUKB2jJ230u4N+iU8f2UOh1X988FVsInK3oZZVaMgnlrWnzhvNzklB77If10fI6eBng7uNU2mdVuLL/XBItOdmxjgoq1tH9VbzWjKroT647ioD9vufVbckfA8QgUZiDmRGaU8VJ6r2RE1LcePYRDhdy+F1mmX2Uc62mOJZRtNMz9gwAuFaGQNzEez9gRDZF0UK9B4I+OuMC/eIfesiRO0ZlyM52zYlDbkTMfjsNac3U/HuJE8IXjzkPurPsU95LW5zLk80NBPHsicpw5bHs/kqmVczp0tE4Ty2RgHqgZgnJ6zdGK+PVvc6YNKG+J4/+rdiiTeISh4fjVjnNtuMWefWtRNCdNkhHDoors737CBBoin64KcbonJJJq485g0yR/Wvl2ZUvz+RLK1T7WWuB+jqAG2DmVWXZyvjQ/Xnkq7bxUthHBZzOUfL/J9xqTyRBI2OTlaqU+9MKAnWOBirmsdztjnIUi2Vicdt9OzNUqv0Jyx/qlTefzhimhwFCpgp7xLaMwTgQ+UTsLBZJWR0Q+BHKtpFRyoH/6UceqiURO4/Ih+/Jzr9vgphMWnmPF14J6GyZTQ2AnptN0Ill4DSmJVLoyUCwsTgFuhW576ksbe5Iy+PbVR5WNT+klzAu9v3d2tfsBAIkeLmMFEXkchJehVmafri53PoWgzZN37VT6G/+hDOOG56ZHU3FVqwhfvj3fbO4fOkg4AGZN9Hg9sdOs2X0bs2vUpD4wQpyKKhIHi/pZfRILKJNPlvZaABFi/SRrVl45jrElaZsrZOQZeBxQBjGURZlJrFYDMuvaAkhpf2jTIxWAVubrFb0fFf7mK6NLiPaX0Sd5IA/rqs+63KvUC/BfWXerYvh3AQcYdYnHzlB364F/bFyIr3eSsA8DdENBCvJwyifkV7k1aozjPTUb1Yke0vvnpUhXqgvrkly0WN+VEkhljhLPme8sRK4tvnb2KthYGJGyPRPpKjpMg4wiIIumUWHNIrmAfOJuSGMobwgxSgYJfOs2LuIPwWdSGqievpC/TJff43C5g+TlOSSYdFcC2JczHfVGIgUzH330PAjHOgO5P7OfAshJZN2h4WIb5izENM2ygiprzbZ8GteWa7fsq6tPeokH+HJArfpCHMBer1ZlpI+przo6lw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 690cbf36-19b2-4467-2dac-08dc34a5742e X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:20.4540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RlePfRoye8BCm5ZNtmuZKalWR+S3c+jQ9zbhNhgi5FmY4ENf79uOGxs2e9iSCbrZMMOhCgm64Ti7gN3zbnzz+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5226 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Count number of transmitted packets that were hardware timestamped at the device DMA layer. Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- .../device_drivers/ethernet/mellanox/mlx5/counters.rst | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 ++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 6 ++++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst index 5464cd9e2694..fed821ef9b09 100644 --- a/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst +++ b/Documentation/networking/device_drivers/ethernet/mellanox/mlx5/counters.rst @@ -300,6 +300,11 @@ the software port. in the beginning of the queue. This is a normal condition. - Informative + * - `tx[i]_timestamps` + - Transmitted packets that were hardware timestamped at the device's DMA + layer. + - Informative + * - `tx[i]_added_vlan_packets` - The number of packets sent where vlan tag insertion was offloaded to the hardware. diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 7e63d7c88894..bc31196d348a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -2046,6 +2046,7 @@ static const struct counter_desc sq_stats_desc[] = { { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, csum_partial_inner) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, added_vlan_packets) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, nop) }, + { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, timestamps) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, mpwqe_blks) }, { MLX5E_DECLARE_TX_STAT(struct mlx5e_sq_stats, mpwqe_pkts) }, #ifdef CONFIG_MLX5_EN_TLS @@ -2198,6 +2199,7 @@ static const struct counter_desc qos_sq_stats_desc[] = { { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, csum_partial_inner) }, { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, added_vlan_packets) }, { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, nop) }, + { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, timestamps) }, { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, mpwqe_blks) }, { MLX5E_DECLARE_QOS_TX_STAT(struct mlx5e_sq_stats, mpwqe_pkts) }, #ifdef CONFIG_MLX5_EN_TLS diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 03f6265d3ed5..3c634c5fd420 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -429,6 +429,7 @@ struct mlx5e_sq_stats { u64 stopped; u64 dropped; u64 recover; + u64 timestamps; /* dirtied @completion */ u64 cqes ____cacheline_aligned_in_smp; u64 wake; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 5c166d9d2dca..5acba323246e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -748,11 +748,13 @@ static void mlx5e_consume_skb(struct mlx5e_txqsq *sq, struct sk_buff *skb, u64 ts = get_cqe_ts(cqe); hwts.hwtstamp = mlx5e_cqe_ts_to_ns(sq->ptp_cyc2time, sq->clock, ts); - if (sq->ptpsq) + if (sq->ptpsq) { mlx5e_skb_cb_hwtstamp_handler(skb, MLX5E_SKB_CB_CQE_HWTSTAMP, hwts.hwtstamp, sq->ptpsq->cq_stats); - else + } else { skb_tstamp_tx(skb, &hwts); + sq->stats->timestamps++; + } } napi_consume_skb(skb, napi_budget); From patchwork Fri Feb 23 19:24:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569880 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D678146E94; Fri, 23 Feb 2024 19:27:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716462; cv=fail; b=f2o3Ffxq0J0jFBDjToP+EFm5pp0o1tF4ibr2b+B5bDNyG06AatQBvqqCozYdNgIHZIp2MvaZSSy/rBCE/lgvNSiwP2PpAVViDjXmCsaLgi0rif/riRBapLSi4An2FLbURZHk2h4lA83OzkWiy73Yw3NzNhTez8nGKnUxy+8BTHA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716462; c=relaxed/simple; bh=zEalXwMXF988KW6AK0KPkvwHHZgauo3I3dbY018ghw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ODdNTWkk492g8yT40UyGt6cdSXcpRxfCDI506E0JHxsNomRHXLVUICOplo9AqP65cxsiQBC8NRD37R5fcDjTENil83L8eUPQBanivldN94iUnjxxJWaBbjx46Pps3zt8ZlXE1BlB1YiV32SLYafxvFr6yCOKlrhg7bvNNaaI/8c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=gclZmedw; arc=fail smtp.client-ip=40.107.92.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="gclZmedw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZDQ4RI2b2kBHspAFs0+L7CQKCbCDAYnSuePri500ELo4Yr2e4wm09NbS9coJuAT8dy0kPuCHRRTPyW3nDHU8nosE/bU/5xqNNHqWkwRaim+QCIt65dg3vwByoDZVi25EEiKn2CIdkgyONuOSC3PTajCg7x+Ac1muAiEwWo2rxXDUOlwKaRqo1VcTd9pUHpNxqpPvBx16DZN15JGF5nWxYYgpXR9k0DVR9LQ5Sfb2nf0jPddYJxTYayqiPuDA2DFrWrghEmrQE4yrOdlWFyD0/XITbZKbEKLgxsmRlHQC/LGeEZZVShLWC217W+yz1KaQRosz/PBVGGUbpISj1bcDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QGLWjcx/NU3aS4NX9pHAeBP/j3MDW8Nr3/+jL/WsanE=; b=bgPGPLbwvW26YVnElGLBEHm6TG5TI9cXSe3l55LVTU2m1Wel6y1N0xkGw8RDeHhC9pD8ZVPRMXQiI+TgKpzDo3uF6M1UuK9cSc9AnaECAH1OmUbanBwfcaMmi4SswaryjBC1cy8djcallrX3vBG+4BBaIYHLO7IebGCUk8LvaRKyb9pGcSHnqloisIc/FZnAtE6cMu3Xn/10WkZRXh5Yu3/j+e6ZVH94Qua8Q0jYN9yM2ttk0OPnXdSGjRpJ0atvcPQkr46gCIgVpQ7Svm/AxDK2cV3PwJg1rrevdvORNtwJvvuWeLrAIY9y+l+AkBcETdPMNXUOp5fbu/sBlDEKgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QGLWjcx/NU3aS4NX9pHAeBP/j3MDW8Nr3/+jL/WsanE=; b=gclZmedwVI1vgJAiDm4H1W5RdTt9/t85xAFR7dSbyLbOiXcJ0lnuvUVbpZrqioFH63E7g/NWI2V1mDrnbYmhDIt968IUVh5Lr2Z+yt8U81D9H7gUmG+85Kj5goK+EniJBLYmJrmVaZNGQ09Ut7QDnIvJ1L9uVn2g+J4ASyI0WPTrJuYfa5mweXtnywsnw9ThkNgdXqriGAg22X662vv/ErK2ThbLMVp70cfqXKaaCeuNJjHaNAUJlQEzvDOh6LkoEMEjKFBcpmk/SSz4ruG/dZHTjmw4kUGi44Tkcqz2zHhXSqYBMYb6IhUwial/zaO6A2AD2hK0uXZf8luEDA1eyQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SJ0PR12MB6831.namprd12.prod.outlook.com (2603:10b6:a03:47d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Fri, 23 Feb 2024 19:27:21 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:21 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 4/6] net/mlx5e: Implement ethtool hardware timestamping statistics Date: Fri, 23 Feb 2024 11:24:48 -0800 Message-ID: <20240223192658.45893-5-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR13CA0043.namprd13.prod.outlook.com (2603:10b6:a03:2c2::18) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SJ0PR12MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: 20fcb873-fedd-43cc-ec32-08dc34a574d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iG76255/AvNJvrf49aRRbHrP4IXJwGqZpA4TE5nAPZzGg/vOU5UoU6kfs7YUw3mRBZCAiM42ODK8U95O8lAlWDu8MN8X26atoUErYV5emHgz/SjWpdqMzK0gUIqThwaedUkcriU1v6M/PAx7N7dC8pWqTNtMIL5QowmgU8phd3EJxFCrHoh3x8jyPAi8qYrTRzAXJ+3lwyMntkgjWLYrIGX6fbvfUzBkp75Jt+1VcD9p50saY2Edz80CmNFerfaPFoFii0LHtOA5QZIeCe71n121bqyGUSuDSWhzyMPS9kzOH6owKShQGneMrqeQkYd/afWuwL+e+6EfqGtikPVE9i5r1D9XdMDU0RPyur9fad3mTYsBArQuk/5HpNoWYiVy1+ooiDhDY7nJkNTLZaivOSHNnN9Dp4EZ44dnpnpmOw25U9KVwYSIRENcwC+nmgLRZHNiTUGrvmFi6BX/WoSh4djQNCPhMmzWMwwsJ9fNT6fuZuP5CCthzfB97YEVhPnlSiSLG5EZxJIWHDo3y8tgBo1h5wpNsWJQIOZfd1JEhKBclNF5kvesXgoy0QOPMjQaAgmLECC7JYyMju2aRs1LSm2uZIEZF9UZTVmb1EhVRKw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 31xSnhBdjgpB8+qsLJcHXZ40pZnHSJ2Sv9Pe1vPERiUu4k+fp27hEXqS0FwTqvfVGO9JeRWR7fCKrjKIj1uHnzdVKGKYXv+uqNBiQ8+I18dzLW3ebWx7PyUOC6JsJ5qKXZSqhlVGd9FKylQcyuLot8Bqp421IlT3H6ExkGJRhdCxRLGx+u1v7RJZsq7ikNhXx2Npc8rtdCx7PyrhS7gJpiE2RW7Y2YVgdtwJiNW16tDAM7q3hHgq/pLQd9pvHSlhqiOafcXoDguVn3fJwpjJFWrBL32Eu5wM6qKkCvQ4pLCPMvTRehgN9+294BvGySpx6B8Pk9wJnyTCS4u2mqi6vZeGhgB2/qNxJYSEN15Zu26sI+SLErwNzZytbtx2LeDP+vszzP6CnlnvwMZBK60F/RuhNb8xE9evKM69Vho/XeBDZUdL0TR6pG/hIJeZepGbt3B6SbYZcgzWBEcem0ksYl2rLL6iy/MI1gQuLlMhpNTUvUMzrE42hgd1HSxnmMyw/TPQ75mSnYGHd32IZXBxTf2ybV86vG9X1f/UeRV3GEgoQxA23MG2x242LV17G8meK1humSpALL32YOrUhQL80mGnhbjMIIRKUkocnkTc5/B/+9+OFZ/+o/PfgaubqhNzFH1GvIgO6odAQ00grOxvuz9m4b+KkTC+Tq2EQI2hwVnO9svRQlp0bancvqWzUAG8pGlov+a5OmirW5t0YDOxxbrE9nQaqZh36cUhEAOKr1nndV9ODDGkRRPJzU2WFkchkGsCPGXF4ZsADKa1tkoxwXh5i+shnB7p23HQcXfpkRvGWr+E9A6sO8S4q2WYDPQgAXwf+Qp7SAfelR1fVzg/dWk83qfid+epbmPwu4eV7EAnHp0uze4wz+MHlDFqgpol0UuHfvKXbq6nUlOezmOkxbhrY2uhXoYMItlc9GzPOneiCqnxxN7XCGi8iLSrY3EXMHkBPDP0coS0OUWUthtIGL7EoSni+USvvLeIJLaY2eHyP1t2ts2gviHM0sBWG+cvXIXq1TmtmtHq/FVnR9G8usgWeUTKkinM7goTbiJd6zjdiqeguUyOpj2GZHYHETb3hU3B6/mznryl7z9WD1EtWttQoVcnMOXW2+oGaJkEXBXKh4gX+zkIi9ItQEr0hK145V+H/8/6L8W3mrYkN7/rD4vWbAoszGI+r80NY7wgLC3NRvtCO2yiT5oV7us4FKUJvski3M3OyTMqaX/o0MNsfZcGe6zqYsF1TShYKJDCilEzehZDryiMaV0Y1yIH39QNln7FcphQ7hRSPVhekIFNSM93inTDTt3/05arQqpZkLSIqA+T1sE8Ip/L1WMv9zjLfH8+po8rYDSdRy9XhaLp3B13/mWPAypI34tiGc9Tl2lJqOXL9ENs0j0jL/lOOAWKamvjNuDaSlsh8f/qlEmSklh+fBHEo5sIKxRP6hGND4JJlCVjrECX4DZ9ozWFlJdFBjzZmGw+zD1BU/4G2K8T2G6M3+xwFpOEMrpUBqSYArBX0Qyaq+kX/vuL8f2u5BFeZvsLhw0O2aGLay7J8U5QDmq+QcZAFDnXksZ2O5kfXTp9f7YwTN4cpjLbabY+ZnzDoVwsQVutDs8sJvT+eqfH1Q== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20fcb873-fedd-43cc-ec32-08dc34a574d0 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:21.5497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BSgxeBfujNAzSnpmzD4q+Zbn5hEELeTosjR1v/Av9tD7azuLW8OHSiVm9f8WPQuoTIGpXF7LF7wCqA8GjwCWDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6831 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Feed driver statistics counters related to hardware timestamping to standardized ethtool hardware timestamping statistics group. Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 9 +++ .../ethernet/mellanox/mlx5/core/en_stats.c | 68 +++++++++++++++++++ .../ethernet/mellanox/mlx5/core/en_stats.h | 2 + 3 files changed, 79 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index cc51ce16df14..d3b77054c30a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -2381,6 +2381,14 @@ static void mlx5e_get_rmon_stats(struct net_device *netdev, mlx5e_stats_rmon_get(priv, rmon_stats, ranges); } +static void mlx5e_get_ts_stats(struct net_device *netdev, + struct ethtool_ts_stats *ts_stats) +{ + struct mlx5e_priv *priv = netdev_priv(netdev); + + mlx5e_stats_ts_get(priv, ts_stats); +} + const struct ethtool_ops mlx5e_ethtool_ops = { .cap_rss_ctx_supported = true, .supported_coalesce_params = ETHTOOL_COALESCE_USECS | @@ -2430,5 +2438,6 @@ const struct ethtool_ops mlx5e_ethtool_ops = { .get_eth_mac_stats = mlx5e_get_eth_mac_stats, .get_eth_ctrl_stats = mlx5e_get_eth_ctrl_stats, .get_rmon_stats = mlx5e_get_rmon_stats, + .get_ts_stats = mlx5e_get_ts_stats, .get_link_ext_stats = mlx5e_get_link_ext_stats }; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index bc31196d348a..836198445726 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -1155,6 +1155,74 @@ void mlx5e_stats_rmon_get(struct mlx5e_priv *priv, *ranges = mlx5e_rmon_ranges; } +void mlx5e_stats_ts_get(struct mlx5e_priv *priv, + struct ethtool_ts_stats *ts_stats) +{ + enum ethtool_ts_stats_layer layer; + struct mlx5e_ptp *ptp; + bool tx_ptp_opened; + int i, j; + + mutex_lock(&priv->state_lock); + + tx_ptp_opened = priv->tx_ptp_opened; + + /* NOTE: this needs to be changed whenever ethtool timestamping + * layer selection is implemented. + */ + if (ts_stats->layer == ETHTOOL_TS_STATS_LAYER_ACTIVE) + layer = tx_ptp_opened ? ETHTOOL_TS_STATS_LAYER_PHY : + ETHTOOL_TS_STATS_LAYER_DMA; + else + layer = ts_stats->layer; + + switch (layer) { + case ETHTOOL_TS_STATS_LAYER_PHY: + if (!tx_ptp_opened) + return; + + ptp = priv->channels.ptp; + + ts_stats->pkts = 0; + ts_stats->err = 0; + ts_stats->late = 0; + ts_stats->lost = 0; + + /* Aggregate stats across all TCs */ + for (i = 0; i < ptp->num_tc; i++) { + struct mlx5e_ptp_cq_stats *stats = ptp->ptpsq[i].cq_stats; + + ts_stats->pkts += stats->cqe; + ts_stats->err += stats->abort + stats->err_cqe; + ts_stats->late += stats->late_cqe; + ts_stats->lost += stats->lost_cqe; + } + break; + case ETHTOOL_TS_STATS_LAYER_DMA: + /* DMA layer will always successfully timestamp packets. Other + * counters do not make sense for this layer. + */ + ts_stats->pkts = 0; + + /* Aggregate stats across all SQs */ + mutex_lock(&priv->state_lock); + for (j = 0; j < priv->channels.num; j++) { + struct mlx5e_channel *c = priv->channels.c[j]; + + for (i = 0; i < c->num_tc; i++) { + struct mlx5e_sq_stats *stats = c->sq[i].stats; + + ts_stats->pkts += stats->timestamps; + } + } + break; + default: + break; + } + + mutex_unlock(&priv->state_lock); +} + #define PPORT_PHY_STATISTICAL_OFF(c) \ MLX5_BYTE_OFF(ppcnt_reg, \ counter_set.phys_layer_statistical_cntrs.c##_high) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 3c634c5fd420..7b3e6cf1229a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -126,6 +126,8 @@ void mlx5e_stats_eth_ctrl_get(struct mlx5e_priv *priv, void mlx5e_stats_rmon_get(struct mlx5e_priv *priv, struct ethtool_rmon_stats *rmon, const struct ethtool_rmon_hist_range **ranges); +void mlx5e_stats_ts_get(struct mlx5e_priv *priv, + struct ethtool_ts_stats *ts_stats); void mlx5e_get_link_ext_stats(struct net_device *dev, struct ethtool_link_ext_stats *stats); From patchwork Fri Feb 23 19:24:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569881 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F36014533C; Fri, 23 Feb 2024 19:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716473; cv=fail; b=KiOfDhM0D5a/XmI68rRd/2YIzHHc9Mw2kxjn3wN5UjcwY0oH72HTxQ/ndAos2piR+ZEWadP42Dz3rf4UtEJHd6z3xa1Nurytnh4hp1pQJz1ZNxqmDL+oVdNaVQvjBLWiUliTxa8nIBbVAAyOXgmqvgo1TY5Rv8iiLvsetlIrw1Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716473; c=relaxed/simple; bh=CNAzUr4GyhhisfblkF/c2qTSaiAj6DN7DqMBTN+YdJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lmhvP1bh3uWTrE2tFvBS/+A6mIJGDsK78dAnxbYVIa0KNJKndbIC59u0j2tkL86v2NBwjsxwuESHkiLQGTJgok2j1IZxflW5o7sZ5ikoqhfo1aN6tN/bad0FuMVVRQszoSCREzuiiNoW4iEOBqfMaP1kMLZK+Us3c02qSF6D6+Y= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=jnOuPH3u; arc=fail smtp.client-ip=40.107.92.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jnOuPH3u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N/P/xtqDxQSNEEOJ4+kzbifOoBKTx1CCZyL0FXVLZcELtAKhVYKbjrsyI/f7F54qLmSTEwDhy6TZh2hA9O/WMatIi3v+/RZaVhSMY9Ffw6VFEg4K70O3xI93njGlmA8zd8oexeSzK37oZW4dJUCimqVcuqOFUUkl158KDHA/+3RbuGgmdcaLiFiUNmPRCXPEPIaPtv+JzKRPXS8WzK6rdEf7FaSEAUB1dDwoThpDjtv9rWGeO2k8rHRaJF9B1Ntgvndssq4dncNY4fq5cWLtZByALzuW3HgvRQRXgBM0lo1A8qDE59J57iLhpQwxLDkfycQRpWZADBzuV0b+Fr761Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yXZtvN1TXjwbqsyoBsYP95PkqT7reIHbTJbL59LhaDE=; b=ibxz5FiN3B/X16df6rxR0ScUX/kSRx1pVfPsdHbPCZb6N/VwRp/GRU1DS1eNyFF9nr7FUp/seE84SwfJUwpkifuUefuAuBjU9agWW4nPMLonerg/zBYZ7YeVAH0DUuceg1N2FzWllerwAbyAR/9eZh84VhHcR5tAf5Y7U5wAeaUxLA+ugLJryoCxFc0e1Ea4f8sxairO/NHFEpEtPzcyCHTDONpC9YgaHge9gt+6x+spUhirw1hGidibPCE0aSaSPQr5GYodGGRMLrbcgvXM3CJrzejPAcbBAWfntADHXRHvyNT650QfWZnAezPmGQgpvPWzbTfU2Mqy3jefgT8+5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yXZtvN1TXjwbqsyoBsYP95PkqT7reIHbTJbL59LhaDE=; b=jnOuPH3ujxaxMxCPoPu3ezNHNCvDa8ljPBW5PtKM+zyQCMk9unacFmdSSCdPLFLXczv6JFJMO1kJyuuKdVBBZvebzI6bBWa+NMoHzUVsqkuhK+N5WMk5X/n9blEYPTfNtUCT2SkBYOsUS2HzBBEW2ecXCJW+Ij42/F5cB7TqNbaYo4wCI+EaJ+lXkuYKcti/M237s8KexrLaLJ+kklm6KKbw/T4wGZORRdK8bZFMhpfoB93XCWmjnAK+J3rAMf/WXoJXIsgS9duQsx8mbsVprznlZHnylk96QTqmWJyZRQ1QxRqUZiHJfhznTMkQ3LKcpI7Bam0X0aeEetmVV2XYEQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SJ0PR12MB6831.namprd12.prod.outlook.com (2603:10b6:a03:47d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Fri, 23 Feb 2024 19:27:23 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:23 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 5/6] tools: ynl: ethtool.py: Make tool invokable from any CWD Date: Fri, 23 Feb 2024 11:24:49 -0800 Message-ID: <20240223192658.45893-6-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR13CA0050.namprd13.prod.outlook.com (2603:10b6:a03:2c2::25) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SJ0PR12MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: c4945d52-3b49-48fa-3a85-08dc34a575aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vLLYZBJCaf0Hz5LXtJPQNNER5lNS3x5XvG8k2nDbgik85POITuDOT08MkfQAXlo5ctBOTlVSWNX6oop6ekpoEsbFaDfXZub8r2RFTiStP76td+uGP/+hwtSfv6gF7vnZiU6gKw+OHFyudRNRs7JrMRVnZw7OQ0P0QgEvfd9wmwuUXhw3WhrQtfK90jWGvujxlqGH3Af3sRiO9lptCjrHqddO3F2bfToKTGJtY1EdE2RR4fZD/HUUKeXmiHtFBUyJ+BuAsbEmH3MTvwVDGbka3xIAeOwWnFDNg9Khqgu0hlBZd+VdTfQ+nhIL/Fqgyp7EA7drFkKSN2TvTp4mPa1rCGMER5tjx3plJ4R4trGbTiOTzWOk5cI+JjH/vgHRWoecf5Tg8wM0xN1kJjzszo+akspYwZdpj6/QCQibYSB0tYp29KoFPakuSGLwh+vWVhneWeFg3mDZkz5TXgdGI+2V8RFbK+ksGQ/n5p961K/+XE7Ym8H319YESPiTGTAsmItL3xwB0XOayeu04MxCGFfYrjhSR9VPfVvwr5rb2TNdmJpBAdAY/+oZDFyjwFjRxmlahPOc2W1fvUUkm+wAeXfaHwRt+PiwhypwxA9CZ5cV4Xk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pQ/Rpc6ALawX3sCLXjmlK9TXMBdh1C7Y3HhvXW55BECzH/JpuXfoWZmv2yXDBnlWMmBM1YOw5wXvisIN/CZAJyo3A/niXBjQ/ZKTCLw9HnZ3WzTtOrCY8lc5aOnFkPAmc9+MR0wkeaOBrc4MKHcR61H4zYL2NKHXrem9oVflFZ0vApwhWiuuOnq6yqpYSGUOyIuOpcp1IH2A9t7UfhLoqcmIRPzRB7ZAK9tFMxbd7BfXXtXM4sazXsfC6nHOSD6vUx27IbWq/01xC+kiBbSRG8M1dUM5QgsVa00yqp8DjHpR2LuQOn5KMba2iJ6dSwwLF7r9FzntrSj4pIEpHyDgix+swXDRTA04IVJbD2R9MBrbzNHopbwHAA8vW1i3X5qcBGr04XCv3BO32mvXluSWQMRWPxz/mFXmWwrDoCzH4HpAIAB+8Qn1PzQ7zra1DZYiJXD/ijvmQ3UbkiCiVnNX7PQRIUcRwD6RlQLrPAAM3f8/hc/0h9FkwlB+3ftY4q8T1tRiGUcFcHxWgxTupWqWVUp3jVbDmTEZo8Xkw/3JiAJSGdFimKEYLGBNNUEPRuZxwh7Sk3/yZeTKV260PkHvG78ia3khKMLbMZR2qxGvoo/LK7W/K0xPaOk0fxOxn4wncZ5vLw47LwNq6jG1mu4V7rsgvcmCkjB8QFQXyYrR0Q8MMBy+rh+6TFyqXJXb7Oe7oLxCqnFklIEddog+Z+8A7iVqs68qw7Biqh4dDj5RLrsN8vdBtNr9/7KZENLt2KkQrtI6T3Cj0EIamJ2x4URzaJ2HTjc2xjZEu69444hy/7O+Ai/LrD2UI+IxlZV/yIcnZBBjL9TKt9kcwBJPz3MRqKqSDwV1cZ9QH2A53fPgtgicc5Hrq2nVwgNTeFdWqzuYnVIcNzzf+rOr3HIFVQP4ZrpRT8a4zYY92JV5h5YMmbE6WirZb7xXWtqfAnVcQMzmPjXXI2bFReXjjLls+/KYjKISMq81Bg0zxTgz/jr+mYiUOjskGqRsIKpUxfN/YNncneaW3OjPaEf77qqEL57TdVXB/XG8fJ2IeO1KTG8+zYLv6Ndy+cFrA2E6gkv0PNdQwmwtx6kk89VtWyDkMt9p3MM3eRVTW3hALMnrc5n/ENsA4stlG4KbMQjf97/xM33QaAhZaGLc+JBtNQ2GHzeEakMp+RtftZqpB1Lje13t4AN7EwLCRmCklRg0VBx23Y+Zf31onHFMwixsBDj9xyBKOzyd1xsjXcZx0zieTI07RemkLQTDgqpKZfmTu7TgAPLpNdP6Yvj5Ra1yP5oEch4H/bcj1YfVDo0vJzgbLczelYZB7JerLelZ77xTHpBM4ifGWpQVlKVq/e/rRi07aOlHwQ0ek1EHSMQvGDc3k/EuYpOyp/fSMJWAO9RVn6Ucz1p6qCbP0YW6ZOsTCGFGqp+YOCURHMQcgkkEWpCm3LUbMHNhD8H/c4v7Ni1qY8wNTTJ/TyoYZmoOy45Mux3fXQXxo8KbfTXqL0akTIkQPtshqHTm3DQjTGy52XdVWod+x+Gn8nybzEZ4cHN+J/xLvQ58B5JHwoJ3xxkS7lrcbGvHb3uJdLSHyqOucjZ0f6w7DBX2a612uDLgTEJxAIOTVdNoHw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4945d52-3b49-48fa-3a85-08dc34a575aa X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:22.9743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +tEeavq0ocEnyhQcvYDECXfrUax80HQX5z7KopjkhAFp5LL1iq9S6wJT4Hcl/U7Eyr/xaSv4H0tET0jxlEhLaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6831 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC ethtool.py depends on yml files in a specific location of the linux kernel tree. Using relative lookup for those files means that ethtool.py would need to be run under tools/net/ynl/. Lookup needed yml files without depending on the current working directory that ethtool.py is invoked from. Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- tools/net/ynl/ethtool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/ethtool.py index 6c9f7e31250c..44ba3ba58ed9 100755 --- a/tools/net/ynl/ethtool.py +++ b/tools/net/ynl/ethtool.py @@ -6,6 +6,7 @@ import json import pprint import sys import re +import os from lib import YnlFamily @@ -152,8 +153,11 @@ def main(): global args args = parser.parse_args() - spec = '../../../Documentation/netlink/specs/ethtool.yaml' - schema = '../../../Documentation/netlink/genetlink-legacy.yaml' + script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0])) + spec = os.path.join(script_abs_dir, + '../../../Documentation/netlink/specs/ethtool.yaml') + schema = os.path.join(script_abs_dir, + '../../../Documentation/netlink/genetlink-legacy.yaml') ynl = YnlFamily(spec, schema) From patchwork Fri Feb 23 19:24:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13569882 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C4201493A4; Fri, 23 Feb 2024 19:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716491; cv=fail; b=Hh0NzxW5F5z8tPKCEN851o4dBv4gfo+3pNjcAvY8vVHloOI45k6ClKnYWZ5WWT04c9Kojko8nx3JPurFAzhtZKqxrNhl4IFmgFntAs7dNFFEnAEhDEmozgKHnZQuzXhM4RBLrr3kNauJI9CPCIBMmpuBSspUncrqONNhZdkNkio= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708716491; c=relaxed/simple; bh=FdKtC2xeLuvnFo1OAMsfhSvhgOj1atR0mwxgyBqVKCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=NLzCWwEWETcOx20JHNEzvXbXj4S9sSk4Igxe7uE83zbLhvXJXWzbBDty3NaqvQfBHJdrVaaJ9DFbeCWrNmsocjEeyUEqOHpHNtOhZg/ZlhCw/WyN4KNjlu8Cr2di5BVcCfBUMHiasxmh3v/7jN81h0d/Bh834nNO/tmk0/ejx94= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=cZaKutPU; arc=fail smtp.client-ip=40.107.92.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="cZaKutPU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Azo2ZUTbiHabM2YVpAxIfEBmIp/KXQhABcvCrqcOW2RGptfzYClvrwqbjAeYKJWLG46S8te4teIT2MZ0gMlRYgKYTvB0ftJl43zxERMxt+EMXJCLgyaNnIhP1EG3kYQVi6HZyQhWTfub685MI3e8rqgMETeGGWcH0Tk+0wbIBsCEqm01xZg7DVSM+mCPZOKFMMNVwpYAjcrbuE199TWrRBBZqa7Lb1XJqBbeDZ3kTolfaak5G4ytqMMXoGVfaSkBzBIWOKh8xuYMtrYWLYergI17M/rVr4xbXRxM3hrJWbe+2pE9aXgdSCAPEV0Td+2fHxeC8KCAfu7LDwaqZsizug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H19rLmz575sVJWqGExnyBhaIQJlHq4JmgjnCV36zkNE=; b=ijNu/HtLjnvkhEgjt9QjDJNkSj/LBQ7gQvQboK9Mlf2XkA7EzpED6w/QcWDUR3P3dGOsIuWLgKI4olEIIl1gxKyOIuNkdMWUve+eHMrmDodt06kuod+QDqxjcH14lYem52syiyIdAIuNkdBi7WzPT7V/VXtZAoC3yckqy10t82amdp6JE2GYxgoQHiTN+Iu3jftn4Yxt/BmnRqvyg5f1aYoOfV/CyR000xIWcJ1wwJ72/a7wwhV4x/3X8KthxtRu2ZthdNXCdHSXT6S1fZTfFJIPy9IuBbdcNTyXi587OeQreBSl4UpenygGWatPRCyMl/ych1HK7C0rKRPhV5gUWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H19rLmz575sVJWqGExnyBhaIQJlHq4JmgjnCV36zkNE=; b=cZaKutPUFgYs66V8Rb8B+zqzuR+O9JTrLnpq4H85Z8cNGhoT8yco2FjJW6fd9pFb72HZfeWtl6QYuMhcvjzrUAYauOsvrzSP0rxk/wGrgEiC+7C3yj3UqQWsmygzrooZT5F+tJ//GrUNwnzYDL+jnPi18RO82IzAMsuH0pU9YiL28GeorwLB+3DOHQfgXLec/foJTsTdXLWY9FINIL7K9rpleJdTeP25nZqbiTq4cyonXkERkJQLEjL4iMiuWZknoXS3c19rul7Z7PKYgD/s3aDjMdtThKOhbGZui1zK/I4L0soNvCYglzSYVM6k+TYeAK0uv2eqMIxU/IX1qMQvfg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SJ0PR12MB6831.namprd12.prod.outlook.com (2603:10b6:a03:47d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Fri, 23 Feb 2024 19:27:24 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::459b:b6fe:a74c:5fbf%6]) with mapi id 15.20.7316.023; Fri, 23 Feb 2024 19:27:24 +0000 From: Rahul Rameshbabu To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Cochran , Tariq Toukan , Gal Pressman , Vadim Fedorenko , Andrew Lunn , Heiner Kallweit , Przemek Kitszel , Ahmed Zaki , Alexander Lobakin , Hangbin Liu , Paul Greenwalt , Justin Stitt , Randy Dunlap , Maxime Chevallier , Kory Maincent , Wojciech Drewek , Vladimir Oltean , Jiri Pirko , Jacob Keller , Alexandre Torgue , Jose Abreu , Dragos Tatulea Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH RFC net-next v1 6/6] tools: ynl: ethtool.py: Add ts ethtool statistics group Date: Fri, 23 Feb 2024 11:24:50 -0800 Message-ID: <20240223192658.45893-7-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223192658.45893-1-rrameshbabu@nvidia.com> References: <20240223192658.45893-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0016.namprd03.prod.outlook.com (2603:10b6:a03:33a::21) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SJ0PR12MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cec468d-018d-46d7-5999-08dc34a5764f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TIDLJKvqEXeAPuyPbHYEtO38CASajNdQaVGpYIJ38H6MokuoTcmkBZfx8tE988dxRsnl/2A0wq7odyLDNjcWLIs7gfOJoXDTHOy4LK8yMveW/K/uuWMMnxqDUv1F7RRMd7DNNcaG9rQWzcckEUYlxNUQK3k4SAgYvw+ZGe+c+87OichhPknH23dM4ij67VamYrf2cugIdpmZ/RkvQAjMT2SpPCqlbRqmtEUQ40JR9Bd4TPotnZSxHb7UNpFpOTHtuNGER0Y0eE2ZLvDq94EaLBu2lrp4KZ06bnx/y/WAejMsVFXNryQAactlRdkijZg8n5gO1EWSAWzQ/5qWE5105FjWZ0OeG87IMUmLsbaSDAmTOvS3Ytk7rRY07B9n2PTocZkSBHGy+MyiSTxgQg+w8NumPXt0UyXEg/MTH/ogPiktkPEPAVpL+6UypxePPdORy77nK2puBwZhbOdHwk7Ic2tfOdkaTsaI5j3/le+H6ZDDPPUjtdPG39RsMkeo6f8WIHXo500SjaSBNE5dL/pDQXIDvRxRDUfEbMymdlCNwwhnlxR5JwI5Way6mONqmcN6WlmsWm3rV9gXDmdqBrVm9YH60LbaERRv7FfEUlgGxuQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C4oPmNDvhgM1PMC8iy+jjVRmt2lcUyGIorx3stcvgk5VVq1YhRya7xiMws7LCq4EqNPpsdxy2Rr46Afa/puJy/nGI44uc+BzspulWZBFJW74IC35HBHhJiWqG5kuX95EVrIA+1vdutBLvXt9WPcc6ZbsrJpJOpzpkXpQDnj/SIQHor2Y10TtDEG9TR7DJehF8lYNOsl5qoo1NGVmb/MwFTlqN8fPq0o8404lDq4LAj5Q1r+NkUm1G00sG0JCrrLSTJdQdolnzmS4ttXgWPpiLpUlszheHkGF9HH70Ceg/lXcaI9z460ZMrXqqdUjCBxmYkQE27QNFbNAGs5HS/D5wvy9j4mSHaIdgVgCKRBUEv9yL1H+zSux0P+stvc8F5KmNZ60kpFXgxlBXmljh7Qn2l1JShAAOudX7qzwUeelFcbvyGyGKFGWp2JJ61MglXxyyK7Rbu5W8RwNaoOK5LO9vy+QG7Psuw7iMr8IqoRhS/it0XYWRwhLJVX+c1PUM19VW0Y+Td7qHmzIuqpKSUBtzyEkxE/TVaeJ8zaINmZS/AEWyrSUH0O4XxuKhTi8ydYpLXuKlb+jfvn2tEjPILCb/i6o7s4yXXkTMx1sz11f38SjIGVh+iqpta+LBDID1LuG2pJQpE64tg+onx+dfm8yA4/TonEAANXQVU5FUUfYLZse6CGYlJZel+ZvhvFbRj81ALgYFrGIL1OjqrKVgAkk2JLTBHTPpCTf7oP6rtxSpg7YtJq7Nr1R5cRPeaRoNuXQ2L+GhXqA3vTQsN37sQSSdQPQHD0NstFH9YymnaXVkwsYqrxknffjDJY953IC4MG3YYfgmi27q39BxU8tclSI73eRQvofIHZtugSUOZouCDDxpj+RBMG5wdAa+p3Zzz70yerZA/cnpJlsuV/FVrREKsOjVYsB0Dseu0pMyND0uOZBu8z/KnCzVqRkkThkDN4QyUiLTZ6YZ9QUCTDLv45jrBFg+rhKQGOnJOVlXgIbXwpLW2SCL28Hh8ebhukTt1K7fgaqNwBp/qfjyLbjRcpNF/yP2Gk6vHvGbl2Jf62cUh1iqgNTyrtJc0MsdCfkMqYUy4h0dkuHJ/U2LvI6e4ahNyMt+3hloUDaYRn08nBVIm4oCZXvs2CdVLlyJQUWEgBXtQhgmUZOriVkmLtz9EfzU0/2KOylKX+OmXRURr7ADNI/ci6PZ4OH5CEZKj65mcfdgyt7Tay6UjYE8yHI9BF1n2Eq872kKNjsQwfBrEOitGbh1+n13Lj72ZxH0u2t+y7C7ap8y4twxt0eULh1Lgv06kPWhy6ImobMyfEQyCBTOIMIyGoj1yqDzrjCNWeFpRuNT4+8ecv37OsXUCANByTorixKK9W/rT1D5FamatSYOhAvzBcbLsYQdSShGTJ/HpHGkfZFT/4+HKNdfJfdbAZgCj8OgZJHSm5xowe3MmEgHUUKuxU8iDl8ZJFSi41JFXGY89wQrxNPDmvvBKRG5KT4DaopojsTcTv+64bIHuMC7qEQJl6JqiM3KQEyXOW3G6aY1EyZLdEPiDBzzY6WtS95usx4Y4NZwX9JcrIiKOngc9s/F9gSfFlxJ7/oSwbzxxNI8syDv4tL1tqNYZ4PP0TLtA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cec468d-018d-46d7-5999-08dc34a5764f X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 19:27:24.0894 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c/HQcqMp5rvL3ZoHl9KZnDX/ooZxiK0FHN/cUk2AYoNnyqSOedoto1BpL72x3DUkHhKIaKsbHkxOS8qpk9Wt8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6831 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Add placeholder for hardware timestamping statistics group for testing stats-get ethtool netlink family operation. Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea --- tools/net/ynl/ethtool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/ethtool.py index 44ba3ba58ed9..d3bf3690d3a5 100755 --- a/tools/net/ynl/ethtool.py +++ b/tools/net/ynl/ethtool.py @@ -314,6 +314,7 @@ def main(): { 'name': 'eth-mac', 'value': True }, #{ 'name': 'eth-ctrl', 'value': True }, #{ 'name': 'rmon', 'value': True }, + #{ 'name': 'ts', 'value': True }, #], }, },