* [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
@ 2025-05-08 11:43 Vladimir Oltean
2025-05-08 20:31 ` Vadim Fedorenko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Vladimir Oltean @ 2025-05-08 11:43 UTC (permalink / raw)
To: netdev
Cc: Köry Maincent, Wei Fang, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Claudiu Manoil, Simon Horman, Richard Cochran, linux-kernel
New timestamping API was introduced in commit 66f7223039c0 ("net: add
NDOs for configuring hardware timestamping") from kernel v6.6. It is
time to convert the ENETC driver to the new API, so that the
ndo_eth_ioctl() path can be removed completely.
Move the enetc_hwtstamp_get() and enetc_hwtstamp_set() calls away from
enetc_ioctl() to dedicated net_device_ops for the LS1028A PF and VF
(NETC v4 does not yet implement enetc_ioctl()), adapt the prototypes and
export these symbols (enetc_ioctl() is also exported).
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/freescale/enetc/enetc.c | 45 ++++++++-----------
drivers/net/ethernet/freescale/enetc/enetc.h | 15 +++++++
.../net/ethernet/freescale/enetc/enetc_pf.c | 2 +
.../net/ethernet/freescale/enetc/enetc_vf.c | 2 +
4 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index 3ee52f4b1166..0eb87964f292 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -3262,16 +3262,14 @@ void enetc_set_features(struct net_device *ndev, netdev_features_t features)
}
EXPORT_SYMBOL_GPL(enetc_set_features);
-static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
+int enetc_hwtstamp_set(struct net_device *ndev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack)
{
struct enetc_ndev_priv *priv = netdev_priv(ndev);
int err, new_offloads = priv->active_offloads;
- struct hwtstamp_config config;
- if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
- return -EFAULT;
-
- switch (config.tx_type) {
+ switch (config->tx_type) {
case HWTSTAMP_TX_OFF:
new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
break;
@@ -3290,13 +3288,13 @@ static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
return -ERANGE;
}
- switch (config.rx_filter) {
+ switch (config->rx_filter) {
case HWTSTAMP_FILTER_NONE:
new_offloads &= ~ENETC_F_RX_TSTAMP;
break;
default:
new_offloads |= ENETC_F_RX_TSTAMP;
- config.rx_filter = HWTSTAMP_FILTER_ALL;
+ config->rx_filter = HWTSTAMP_FILTER_ALL;
}
if ((new_offloads ^ priv->active_offloads) & ENETC_F_RX_TSTAMP) {
@@ -3309,42 +3307,35 @@ static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
priv->active_offloads = new_offloads;
- return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
- -EFAULT : 0;
+ return 0;
}
+EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
-static int enetc_hwtstamp_get(struct net_device *ndev, struct ifreq *ifr)
+int enetc_hwtstamp_get(struct net_device *ndev,
+ struct kernel_hwtstamp_config *config)
{
struct enetc_ndev_priv *priv = netdev_priv(ndev);
- struct hwtstamp_config config;
- config.flags = 0;
+ config->flags = 0;
if (priv->active_offloads & ENETC_F_TX_ONESTEP_SYNC_TSTAMP)
- config.tx_type = HWTSTAMP_TX_ONESTEP_SYNC;
+ config->tx_type = HWTSTAMP_TX_ONESTEP_SYNC;
else if (priv->active_offloads & ENETC_F_TX_TSTAMP)
- config.tx_type = HWTSTAMP_TX_ON;
+ config->tx_type = HWTSTAMP_TX_ON;
else
- config.tx_type = HWTSTAMP_TX_OFF;
+ config->tx_type = HWTSTAMP_TX_OFF;
- config.rx_filter = (priv->active_offloads & ENETC_F_RX_TSTAMP) ?
- HWTSTAMP_FILTER_ALL : HWTSTAMP_FILTER_NONE;
+ config->rx_filter = (priv->active_offloads & ENETC_F_RX_TSTAMP) ?
+ HWTSTAMP_FILTER_ALL : HWTSTAMP_FILTER_NONE;
- return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
- -EFAULT : 0;
+ return 0;
}
+EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
{
struct enetc_ndev_priv *priv = netdev_priv(ndev);
- if (IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)) {
- if (cmd == SIOCSHWTSTAMP)
- return enetc_hwtstamp_set(ndev, rq);
- if (cmd == SIOCGHWTSTAMP)
- return enetc_hwtstamp_get(ndev, rq);
- }
-
if (!priv->phylink)
return -EOPNOTSUPP;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
index 4ad4eb5c5a74..5c2f4e9f68fa 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
@@ -481,6 +481,21 @@ int enetc_setup_bpf(struct net_device *ndev, struct netdev_bpf *bpf);
int enetc_xdp_xmit(struct net_device *ndev, int num_frames,
struct xdp_frame **frames, u32 flags);
+#if IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)
+
+int enetc_hwtstamp_get(struct net_device *ndev,
+ struct kernel_hwtstamp_config *config);
+int enetc_hwtstamp_set(struct net_device *ndev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack);
+
+#else
+
+#define enetc_hwtstamp_get(ndev, config) NULL
+#define enetc_hwtstamp_set(ndev, config, extack) NULL
+
+#endif
+
/* ethtool */
extern const struct ethtool_ops enetc_pf_ethtool_ops;
extern const struct ethtool_ops enetc4_pf_ethtool_ops;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index 203862ec1114..e3bbe6916a29 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -728,6 +728,8 @@ static const struct net_device_ops enetc_ndev_ops = {
.ndo_setup_tc = enetc_pf_setup_tc,
.ndo_bpf = enetc_setup_bpf,
.ndo_xdp_xmit = enetc_xdp_xmit,
+ .ndo_hwtstamp_get = enetc_hwtstamp_get,
+ .ndo_hwtstamp_set = enetc_hwtstamp_set,
};
static struct phylink_pcs *
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
index 3768752b6008..16f311567e47 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
@@ -121,6 +121,8 @@ static const struct net_device_ops enetc_ndev_ops = {
.ndo_set_features = enetc_vf_set_features,
.ndo_eth_ioctl = enetc_ioctl,
.ndo_setup_tc = enetc_vf_setup_tc,
+ .ndo_hwtstamp_get = enetc_hwtstamp_get,
+ .ndo_hwtstamp_set = enetc_hwtstamp_set,
};
static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-08 11:43 [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
@ 2025-05-08 20:31 ` Vadim Fedorenko
2025-05-09 3:15 ` Wei Fang
2025-05-09 18:37 ` kernel test robot
2 siblings, 0 replies; 5+ messages in thread
From: Vadim Fedorenko @ 2025-05-08 20:31 UTC (permalink / raw)
To: Vladimir Oltean, netdev
Cc: Köry Maincent, Wei Fang, Clark Wang, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Claudiu Manoil, Simon Horman, Richard Cochran, linux-kernel
On 08/05/2025 12:43, Vladimir Oltean wrote:
> New timestamping API was introduced in commit 66f7223039c0 ("net: add
> NDOs for configuring hardware timestamping") from kernel v6.6. It is
> time to convert the ENETC driver to the new API, so that the
> ndo_eth_ioctl() path can be removed completely.
>
> Move the enetc_hwtstamp_get() and enetc_hwtstamp_set() calls away from
> enetc_ioctl() to dedicated net_device_ops for the LS1028A PF and VF
> (NETC v4 does not yet implement enetc_ioctl()), adapt the prototypes and
> export these symbols (enetc_ioctl() is also exported).
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Again, extack can be potentially used to provide some info in case of
enetc_hwtstamp_set() fail, but in this case it's more obvious.
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-08 11:43 [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
2025-05-08 20:31 ` Vadim Fedorenko
@ 2025-05-09 3:15 ` Wei Fang
2025-05-09 10:24 ` Vladimir Oltean
2025-05-09 18:37 ` kernel test robot
2 siblings, 1 reply; 5+ messages in thread
From: Wei Fang @ 2025-05-09 3:15 UTC (permalink / raw)
To: Vladimir Oltean, netdev@vger.kernel.org
Cc: Köry Maincent, Clark Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Claudiu Manoil,
Simon Horman, Richard Cochran, linux-kernel@vger.kernel.org
> -static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
> +int enetc_hwtstamp_set(struct net_device *ndev,
> + struct kernel_hwtstamp_config *config,
> + struct netlink_ext_ack *extack)
> +EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
>
> -static int enetc_hwtstamp_get(struct net_device *ndev, struct ifreq *ifr)
> +int enetc_hwtstamp_get(struct net_device *ndev,
> + struct kernel_hwtstamp_config *config)
> +EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
The definitions of enetc_hwtstamp_set() and enetc_hwtstamp_set()
should also be wrapped with:
#if IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)
#endif
Otherwise, there will be some compilation errors when
CONFIG_FSL_ENETC_PTP_CLOCK is not enabled.
> +#if IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)
> +
> +int enetc_hwtstamp_get(struct net_device *ndev,
> + struct kernel_hwtstamp_config *config);
> +int enetc_hwtstamp_set(struct net_device *ndev,
> + struct kernel_hwtstamp_config *config,
> + struct netlink_ext_ack *extack);
> +
> +#else
> +
> +#define enetc_hwtstamp_get(ndev, config) NULL
> +#define enetc_hwtstamp_set(ndev, config, extack) NULL
checkpatch.pl reports some warnings, for example:
WARNING: Argument 'ndev' is not used in function-like macro
#140: FILE: drivers/net/ethernet/freescale/enetc/enetc.h:531:
+#define enetc_hwtstamp_get(ndev, config) NULL
And there are also compilation errors when
CONFIG_FSL_ENETC_PTP_CLOCK is not enabled. It should be
modified as follows.
#define enetc_hwtstamp_get NULL
#define enetc_hwtstamp_set NULL
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-09 3:15 ` Wei Fang
@ 2025-05-09 10:24 ` Vladimir Oltean
0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2025-05-09 10:24 UTC (permalink / raw)
To: Wei Fang
Cc: netdev@vger.kernel.org, Köry Maincent, Clark Wang,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Simon Horman, Richard Cochran,
linux-kernel@vger.kernel.org
On Fri, May 09, 2025 at 06:15:40AM +0300, Wei Fang wrote:
> > -static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
> > +int enetc_hwtstamp_set(struct net_device *ndev,
> > + struct kernel_hwtstamp_config *config,
> > + struct netlink_ext_ack *extack)
> > +EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
> >
> > -static int enetc_hwtstamp_get(struct net_device *ndev, struct ifreq *ifr)
> > +int enetc_hwtstamp_get(struct net_device *ndev,
> > + struct kernel_hwtstamp_config *config)
> > +EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
>
> The definitions of enetc_hwtstamp_set() and enetc_hwtstamp_set()
> should also be wrapped with:
> #if IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)
> #endif
>
> Otherwise, there will be some compilation errors when
> CONFIG_FSL_ENETC_PTP_CLOCK is not enabled.
>
> > +#if IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK)
> > +
> > +int enetc_hwtstamp_get(struct net_device *ndev,
> > + struct kernel_hwtstamp_config *config);
> > +int enetc_hwtstamp_set(struct net_device *ndev,
> > + struct kernel_hwtstamp_config *config,
> > + struct netlink_ext_ack *extack);
> > +
> > +#else
> > +
> > +#define enetc_hwtstamp_get(ndev, config) NULL
> > +#define enetc_hwtstamp_set(ndev, config, extack) NULL
>
> checkpatch.pl reports some warnings, for example:
> WARNING: Argument 'ndev' is not used in function-like macro
> #140: FILE: drivers/net/ethernet/freescale/enetc/enetc.h:531:
> +#define enetc_hwtstamp_get(ndev, config) NULL
>
> And there are also compilation errors when
> CONFIG_FSL_ENETC_PTP_CLOCK is not enabled. It should be
> modified as follows.
>
> #define enetc_hwtstamp_get NULL
> #define enetc_hwtstamp_set NULL
>
Ah, you're right... for some reason I forgot to test with
CONFIG_FSL_ENETC_PTP_CLOCK=n :-/
I'll send v2 as follows instead:
int enetc_hwtstamp_get(struct net_device *ndev,
struct kernel_hwtstamp_config *config)
{
struct enetc_ndev_priv *priv = netdev_priv(ndev);
if (!IS_ENABLED(CONFIG_FSL_ENETC_PTP_CLOCK))
return -EOPNOTSUPP;
...
}
Much simpler to handle.
I thought that enetc_hwtstamp_get() is in a translation module that only
gets built when CONFIG_FSL_ENETC_PTP_CLOCK is enabled, but obviously
that's not true.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-08 11:43 [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
2025-05-08 20:31 ` Vadim Fedorenko
2025-05-09 3:15 ` Wei Fang
@ 2025-05-09 18:37 ` kernel test robot
2 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2025-05-09 18:37 UTC (permalink / raw)
To: Vladimir Oltean, netdev
Cc: oe-kbuild-all, Köry Maincent, Wei Fang, Clark Wang,
Andrew Lunn, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Claudiu Manoil, Simon Horman, Richard Cochran, linux-kernel
Hi Vladimir,
kernel test robot noticed the following build errors:
[auto build test ERROR on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Vladimir-Oltean/net-enetc-convert-to-ndo_hwtstamp_get-and-ndo_hwtstamp_set/20250508-194458
base: net-next/main
patch link: https://lore.kernel.org/r/20250508114310.1258162-1-vladimir.oltean%40nxp.com
patch subject: [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
config: arm64-randconfig-002-20250509 (https://download.01.org/0day-ci/archive/20250510/202505100217.0jMyMEHN-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250510/202505100217.0jMyMEHN-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505100217.0jMyMEHN-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kasan-checks.h:5,
from include/asm-generic/rwonce.h:26,
from arch/arm64/include/asm/rwonce.h:71,
from include/linux/compiler.h:390,
from include/linux/build_bug.h:5,
from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from drivers/net/ethernet/freescale/enetc/enetc.h:4,
from drivers/net/ethernet/freescale/enetc/enetc.c:4:
>> include/linux/stddef.h:8:16: error: expected identifier or '(' before 'void'
#define NULL ((void *)0)
^~~~
drivers/net/ethernet/freescale/enetc/enetc.h:495:50: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_set(ndev, config, extack) NULL
^~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3265:5: note: in expansion of macro 'enetc_hwtstamp_set'
int enetc_hwtstamp_set(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:8:23: error: expected ')' before numeric constant
#define NULL ((void *)0)
^
drivers/net/ethernet/freescale/enetc/enetc.h:495:50: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_set(ndev, config, extack) NULL
^~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3265:5: note: in expansion of macro 'enetc_hwtstamp_set'
int enetc_hwtstamp_set(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/printk.h:8,
from include/asm-generic/bug.h:22,
from arch/arm64/include/asm/bug.h:26,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from drivers/net/ethernet/freescale/enetc/enetc.h:4,
from drivers/net/ethernet/freescale/enetc/enetc.c:4:
>> drivers/net/ethernet/freescale/enetc/enetc.c:3312:19: error: 'enetc_hwtstamp_set' undeclared here (not in a function); did you mean 'enetc_tstamp_tx'?
EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
^~~~~~~~~~~~~~~~~~
include/linux/export.h:70:16: note: in definition of macro '__EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
include/linux/export.h:84:33: note: in expansion of macro '_EXPORT_SYMBOL'
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "GPL")
^~~~~~~~~~~~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3312:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
^~~~~~~~~~~~~~~~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kasan-checks.h:5,
from include/asm-generic/rwonce.h:26,
from arch/arm64/include/asm/rwonce.h:71,
from include/linux/compiler.h:390,
from include/linux/build_bug.h:5,
from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from drivers/net/ethernet/freescale/enetc/enetc.h:4,
from drivers/net/ethernet/freescale/enetc/enetc.c:4:
>> include/linux/stddef.h:8:16: error: expected identifier or '(' before 'void'
#define NULL ((void *)0)
^~~~
drivers/net/ethernet/freescale/enetc/enetc.h:494:43: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_get(ndev, config) NULL
^~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3314:5: note: in expansion of macro 'enetc_hwtstamp_get'
int enetc_hwtstamp_get(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:8:23: error: expected ')' before numeric constant
#define NULL ((void *)0)
^
drivers/net/ethernet/freescale/enetc/enetc.h:494:43: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_get(ndev, config) NULL
^~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3314:5: note: in expansion of macro 'enetc_hwtstamp_get'
int enetc_hwtstamp_get(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/printk.h:8,
from include/asm-generic/bug.h:22,
from arch/arm64/include/asm/bug.h:26,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from drivers/net/ethernet/freescale/enetc/enetc.h:4,
from drivers/net/ethernet/freescale/enetc/enetc.c:4:
>> drivers/net/ethernet/freescale/enetc/enetc.c:3333:19: error: 'enetc_hwtstamp_get' undeclared here (not in a function); did you mean 'enetc_hwtstamp_set'?
EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
^~~~~~~~~~~~~~~~~~
include/linux/export.h:70:16: note: in definition of macro '__EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
include/linux/export.h:84:33: note: in expansion of macro '_EXPORT_SYMBOL'
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "GPL")
^~~~~~~~~~~~~~
drivers/net/ethernet/freescale/enetc/enetc.c:3333:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
^~~~~~~~~~~~~~~~~
--
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kasan-checks.h:5,
from include/asm-generic/rwonce.h:26,
from arch/arm64/include/asm/rwonce.h:71,
from include/linux/compiler.h:390,
from include/linux/build_bug.h:5,
from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from enetc.h:4,
from enetc.c:4:
>> include/linux/stddef.h:8:16: error: expected identifier or '(' before 'void'
#define NULL ((void *)0)
^~~~
enetc.h:495:50: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_set(ndev, config, extack) NULL
^~~~
enetc.c:3265:5: note: in expansion of macro 'enetc_hwtstamp_set'
int enetc_hwtstamp_set(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:8:23: error: expected ')' before numeric constant
#define NULL ((void *)0)
^
enetc.h:495:50: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_set(ndev, config, extack) NULL
^~~~
enetc.c:3265:5: note: in expansion of macro 'enetc_hwtstamp_set'
int enetc_hwtstamp_set(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/printk.h:8,
from include/asm-generic/bug.h:22,
from arch/arm64/include/asm/bug.h:26,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from enetc.h:4,
from enetc.c:4:
enetc.c:3312:19: error: 'enetc_hwtstamp_set' undeclared here (not in a function); did you mean 'enetc_tstamp_tx'?
EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
^~~~~~~~~~~~~~~~~~
include/linux/export.h:70:16: note: in definition of macro '__EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
include/linux/export.h:84:33: note: in expansion of macro '_EXPORT_SYMBOL'
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "GPL")
^~~~~~~~~~~~~~
enetc.c:3312:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
^~~~~~~~~~~~~~~~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/linux/kasan-checks.h:5,
from include/asm-generic/rwonce.h:26,
from arch/arm64/include/asm/rwonce.h:71,
from include/linux/compiler.h:390,
from include/linux/build_bug.h:5,
from include/linux/container_of.h:5,
from include/linux/list.h:5,
from include/linux/timer.h:5,
from enetc.h:4,
from enetc.c:4:
>> include/linux/stddef.h:8:16: error: expected identifier or '(' before 'void'
#define NULL ((void *)0)
^~~~
enetc.h:494:43: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_get(ndev, config) NULL
^~~~
enetc.c:3314:5: note: in expansion of macro 'enetc_hwtstamp_get'
int enetc_hwtstamp_get(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:8:23: error: expected ')' before numeric constant
#define NULL ((void *)0)
^
enetc.h:494:43: note: in expansion of macro 'NULL'
#define enetc_hwtstamp_get(ndev, config) NULL
^~~~
enetc.c:3314:5: note: in expansion of macro 'enetc_hwtstamp_get'
int enetc_hwtstamp_get(struct net_device *ndev,
^~~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/printk.h:8,
from include/asm-generic/bug.h:22,
from arch/arm64/include/asm/bug.h:26,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from enetc.h:4,
from enetc.c:4:
enetc.c:3333:19: error: 'enetc_hwtstamp_get' undeclared here (not in a function); did you mean 'enetc_hwtstamp_set'?
EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
^~~~~~~~~~~~~~~~~~
include/linux/export.h:70:16: note: in definition of macro '__EXPORT_SYMBOL'
extern typeof(sym) sym; \
^~~
include/linux/export.h:84:33: note: in expansion of macro '_EXPORT_SYMBOL'
#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "GPL")
^~~~~~~~~~~~~~
enetc.c:3333:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
^~~~~~~~~~~~~~~~~
vim +3312 drivers/net/ethernet/freescale/enetc/enetc.c
3264
3265 int enetc_hwtstamp_set(struct net_device *ndev,
3266 struct kernel_hwtstamp_config *config,
3267 struct netlink_ext_ack *extack)
3268 {
3269 struct enetc_ndev_priv *priv = netdev_priv(ndev);
3270 int err, new_offloads = priv->active_offloads;
3271
3272 switch (config->tx_type) {
3273 case HWTSTAMP_TX_OFF:
3274 new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
3275 break;
3276 case HWTSTAMP_TX_ON:
3277 new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
3278 new_offloads |= ENETC_F_TX_TSTAMP;
3279 break;
3280 case HWTSTAMP_TX_ONESTEP_SYNC:
3281 if (!enetc_si_is_pf(priv->si))
3282 return -EOPNOTSUPP;
3283
3284 new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
3285 new_offloads |= ENETC_F_TX_ONESTEP_SYNC_TSTAMP;
3286 break;
3287 default:
3288 return -ERANGE;
3289 }
3290
3291 switch (config->rx_filter) {
3292 case HWTSTAMP_FILTER_NONE:
3293 new_offloads &= ~ENETC_F_RX_TSTAMP;
3294 break;
3295 default:
3296 new_offloads |= ENETC_F_RX_TSTAMP;
3297 config->rx_filter = HWTSTAMP_FILTER_ALL;
3298 }
3299
3300 if ((new_offloads ^ priv->active_offloads) & ENETC_F_RX_TSTAMP) {
3301 bool extended = !!(new_offloads & ENETC_F_RX_TSTAMP);
3302
3303 err = enetc_reconfigure(priv, extended, NULL, NULL);
3304 if (err)
3305 return err;
3306 }
3307
3308 priv->active_offloads = new_offloads;
3309
3310 return 0;
3311 }
> 3312 EXPORT_SYMBOL_GPL(enetc_hwtstamp_set);
3313
3314 int enetc_hwtstamp_get(struct net_device *ndev,
3315 struct kernel_hwtstamp_config *config)
3316 {
3317 struct enetc_ndev_priv *priv = netdev_priv(ndev);
3318
3319 config->flags = 0;
3320
3321 if (priv->active_offloads & ENETC_F_TX_ONESTEP_SYNC_TSTAMP)
3322 config->tx_type = HWTSTAMP_TX_ONESTEP_SYNC;
3323 else if (priv->active_offloads & ENETC_F_TX_TSTAMP)
3324 config->tx_type = HWTSTAMP_TX_ON;
3325 else
3326 config->tx_type = HWTSTAMP_TX_OFF;
3327
3328 config->rx_filter = (priv->active_offloads & ENETC_F_RX_TSTAMP) ?
3329 HWTSTAMP_FILTER_ALL : HWTSTAMP_FILTER_NONE;
3330
3331 return 0;
3332 }
> 3333 EXPORT_SYMBOL_GPL(enetc_hwtstamp_get);
3334
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-09 18:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08 11:43 [PATCH net-next] net: enetc: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
2025-05-08 20:31 ` Vadim Fedorenko
2025-05-09 3:15 ` Wei Fang
2025-05-09 10:24 ` Vladimir Oltean
2025-05-09 18:37 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).