lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206142716.GT2581@kernel.org>
Date: Fri, 6 Dec 2024 14:27:16 +0000
From: Simon Horman <horms@...nel.org>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: Florian Fainelli <florian.fainelli@...adcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Richard Cochran <richardcochran@...il.com>,
	Radu Pirea <radu-nicolae.pirea@....nxp.com>,
	Jay Vosburgh <j.vosburgh@...il.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	Nicolas Ferre <nicolas.ferre@...rochip.com>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	Willem de Bruijn <willemdebruijn.kernel@...il.com>,
	Jonathan Corbet <corbet@....net>,
	Horatiu Vultur <horatiu.vultur@...rochip.com>,
	UNGLinuxDriver@...rochip.com,
	Vladimir Oltean <vladimir.oltean@....com>, donald.hunter@...il.com,
	danieller@...dia.com, ecree.xilinx@...il.com,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	linux-doc@...r.kernel.org,
	Maxime Chevallier <maxime.chevallier@...tlin.com>,
	Rahul Rameshbabu <rrameshbabu@...dia.com>,
	Willem de Bruijn <willemb@...gle.com>,
	Shannon Nelson <shannon.nelson@....com>,
	Alexandra Winter <wintera@...ux.ibm.com>
Subject: Re: [PATCH net-next v20 4/6] net: ethtool: tsinfo: Enhance tsinfo to
 support several hwtstamp by net topology

On Wed, Dec 04, 2024 at 03:44:45PM +0100, Kory Maincent wrote:
> Either the MAC or the PHY can provide hwtstamp, so we should be able to
> read the tsinfo for any hwtstamp provider.
> 
> Enhance 'get' command to retrieve tsinfo of hwtstamp providers within a
> network topology.
> 
> Add support for a specific dump command to retrieve all hwtstamp
> providers within the network topology, with added functionality for
> filtered dump to target a single interface.
> 
> Signed-off-by: Kory Maincent <kory.maincent@...tlin.com>

...

> diff --git a/net/ethtool/ts.h b/net/ethtool/ts.h
> new file mode 100644
> index 000000000000..b7665dd4330d
> --- /dev/null
> +++ b/net/ethtool/ts.h
> @@ -0,0 +1,21 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef _NET_ETHTOOL_TS_H
> +#define _NET_ETHTOOL_TS_H
> +
> +#include "netlink.h"
> +
> +static const struct nla_policy
> +ethnl_ts_hwtst_prov_policy[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_MAX + 1] = {
> +	[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_INDEX] =
> +		NLA_POLICY_MIN(NLA_S32, 0),
> +	[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_QUALIFIER] =
> +		NLA_POLICY_MAX(NLA_U32, HWTSTAMP_PROVIDER_QUALIFIER_CNT - 1)
> +};

Hi Kory,

It looks like ethnl_ts_hwtst_prov_policy is only used in tsinfo.c and could
be moved into that file. That would avoid a separate copy for each file
that includes ts.h and the following warning flagged by gcc-14 W=1 builds
with patch 5/6 applied.

  CC      net/ethtool/tsconfig.o
In file included from net/ethtool/tsconfig.c:10:
net/ethtool/ts.h:9:1: warning: 'ethnl_ts_hwtst_prov_policy' defined but not used [-Wunused-const-variable=]
    9 | ethnl_ts_hwtst_prov_policy[ETHTOOL_A_TS_HWTSTAMP_PROVIDER_MAX + 1] = {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~

> +
> +int ts_parse_hwtst_provider(const struct nlattr *nest,
> +			    struct hwtstamp_provider_desc *hwprov_desc,
> +			    struct netlink_ext_ack *extack,
> +			    bool *mod);
> +
> +#endif /* _NET_ETHTOOL_TS_H */

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ