Re: [PATCH net-next v20 4/6] net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology
From: Kory Maincent
Date: Fri Dec 06 2024 - 09:37:46 EST
On Fri, 6 Dec 2024 14:27:16 +0000
Simon Horman <horms@xxxxxxxxxx> wrote:
> 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@xxxxxxxxxxx>
>
> ...
>
> > 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.
Oh indeed but the real issue is that it should be used in
ethnl_tsconfig_set_policy.
Thanks for the report!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com