* [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
@ 2025-05-12 16:00 Vladimir Oltean
2025-05-12 18:38 ` Jacob Keller
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Oltean @ 2025-05-12 16:00 UTC (permalink / raw)
To: netdev
Cc: Jacob Keller, Tony Nguyen, Przemek Kitszel, intel-wired-lan,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Vadim Fedorenko, Richard Cochran
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 Intel ice driver to the new API, so that
timestamping configuration can be removed from the ndo_eth_ioctl() path
completely.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 24 +-----------
drivers/net/ethernet/intel/ice/ice_ptp.c | 45 ++++++++++++-----------
drivers/net/ethernet/intel/ice/ice_ptp.h | 17 ++++++---
3 files changed, 37 insertions(+), 49 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 1fbe13ee93a8..674d90d6a081 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -7880,27 +7880,6 @@ int ice_change_mtu(struct net_device *netdev, int new_mtu)
return err;
}
-/**
- * ice_eth_ioctl - Access the hwtstamp interface
- * @netdev: network interface device structure
- * @ifr: interface request data
- * @cmd: ioctl command
- */
-static int ice_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
-{
- struct ice_netdev_priv *np = netdev_priv(netdev);
- struct ice_pf *pf = np->vsi->back;
-
- switch (cmd) {
- case SIOCGHWTSTAMP:
- return ice_ptp_get_ts_config(pf, ifr);
- case SIOCSHWTSTAMP:
- return ice_ptp_set_ts_config(pf, ifr);
- default:
- return -EOPNOTSUPP;
- }
-}
-
/**
* ice_aq_str - convert AQ err code to a string
* @aq_err: the AQ error code to convert
@@ -9734,7 +9713,6 @@ static const struct net_device_ops ice_netdev_ops = {
.ndo_change_mtu = ice_change_mtu,
.ndo_get_stats64 = ice_get_stats64,
.ndo_set_tx_maxrate = ice_set_tx_maxrate,
- .ndo_eth_ioctl = ice_eth_ioctl,
.ndo_set_vf_spoofchk = ice_set_vf_spoofchk,
.ndo_set_vf_mac = ice_set_vf_mac,
.ndo_get_vf_config = ice_get_vf_cfg,
@@ -9758,4 +9736,6 @@ static const struct net_device_ops ice_netdev_ops = {
.ndo_bpf = ice_xdp,
.ndo_xdp_xmit = ice_xdp_xmit,
.ndo_xsk_wakeup = ice_xsk_wakeup,
+ .ndo_hwtstamp_get = ice_ptp_hwtstamp_get,
+ .ndo_hwtstamp_set = ice_ptp_hwtstamp_set,
};
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index b79a148ed0f2..d7b04af745d0 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -2359,23 +2359,24 @@ static int ice_ptp_getcrosststamp(struct ptp_clock_info *info,
}
/**
- * ice_ptp_get_ts_config - ioctl interface to read the timestamping config
- * @pf: Board private structure
- * @ifr: ioctl data
+ * ice_ptp_hwtstamp_get - interface to read the timestamping config
+ * @netdev: network interface device structure
+ * @config: Timestamping configuration structure
*
* Copy the timestamping config to user buffer
*/
-int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr)
+int ice_ptp_hwtstamp_get(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config)
{
- struct hwtstamp_config *config;
+ struct ice_netdev_priv *np = netdev_priv(netdev);
+ struct ice_pf *pf = np->vsi->back;
if (pf->ptp.state != ICE_PTP_READY)
return -EIO;
- config = &pf->ptp.tstamp_config;
+ *config = pf->ptp.tstamp_config;
- return copy_to_user(ifr->ifr_data, config, sizeof(*config)) ?
- -EFAULT : 0;
+ return 0;
}
/**
@@ -2383,8 +2384,8 @@ int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr)
* @pf: Board private structure
* @config: hwtstamp settings requested or saved
*/
-static int
-ice_ptp_set_timestamp_mode(struct ice_pf *pf, struct hwtstamp_config *config)
+static int ice_ptp_set_timestamp_mode(struct ice_pf *pf,
+ struct kernel_hwtstamp_config *config)
{
switch (config->tx_type) {
case HWTSTAMP_TX_OFF:
@@ -2428,32 +2429,32 @@ ice_ptp_set_timestamp_mode(struct ice_pf *pf, struct hwtstamp_config *config)
}
/**
- * ice_ptp_set_ts_config - ioctl interface to control the timestamping
- * @pf: Board private structure
- * @ifr: ioctl data
+ * ice_ptp_hwtstamp_set - interface to control the timestamping
+ * @netdev: network interface device structure
+ * @config: Timestamping configuration structure
+ * @extack: Netlink extended ack structure for error reporting
*
* Get the user config and store it
*/
-int ice_ptp_set_ts_config(struct ice_pf *pf, struct ifreq *ifr)
+int ice_ptp_hwtstamp_set(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack)
{
- struct hwtstamp_config config;
+ struct ice_netdev_priv *np = netdev_priv(netdev);
+ struct ice_pf *pf = np->vsi->back;
int err;
if (pf->ptp.state != ICE_PTP_READY)
return -EAGAIN;
- if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
- return -EFAULT;
-
- err = ice_ptp_set_timestamp_mode(pf, &config);
+ err = ice_ptp_set_timestamp_mode(pf, config);
if (err)
return err;
/* Return the actual configuration set */
- config = pf->ptp.tstamp_config;
+ *config = pf->ptp.tstamp_config;
- return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
- -EFAULT : 0;
+ return 0;
}
/**
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h
index 3b769a0cad00..da9bfd46d750 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.h
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.h
@@ -262,7 +262,7 @@ struct ice_ptp {
struct ptp_extts_request extts_rqs[GLTSYN_EVNT_H_IDX_MAX];
struct ptp_clock_info info;
struct ptp_clock *clock;
- struct hwtstamp_config tstamp_config;
+ struct kernel_hwtstamp_config tstamp_config;
u64 reset_time;
u32 tx_hwtstamp_skipped;
u32 tx_hwtstamp_timeouts;
@@ -294,8 +294,11 @@ struct ice_ptp {
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
int ice_ptp_clock_index(struct ice_pf *pf);
struct ice_pf;
-int ice_ptp_set_ts_config(struct ice_pf *pf, struct ifreq *ifr);
-int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr);
+int ice_ptp_hwtstamp_get(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config);
+int ice_ptp_hwtstamp_set(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack);
void ice_ptp_restore_timestamp_mode(struct ice_pf *pf);
void ice_ptp_extts_event(struct ice_pf *pf);
@@ -316,12 +319,16 @@ void ice_ptp_init(struct ice_pf *pf);
void ice_ptp_release(struct ice_pf *pf);
void ice_ptp_link_change(struct ice_pf *pf, bool linkup);
#else /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
-static inline int ice_ptp_set_ts_config(struct ice_pf *pf, struct ifreq *ifr)
+
+static inline int ice_ptp_hwtstamp_get(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config)
{
return -EOPNOTSUPP;
}
-static inline int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr)
+static inline int ice_ptp_hwtstamp_set(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack)
{
return -EOPNOTSUPP;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-12 16:00 [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
@ 2025-05-12 18:38 ` Jacob Keller
2025-05-12 18:53 ` Vladimir Oltean
0 siblings, 1 reply; 6+ messages in thread
From: Jacob Keller @ 2025-05-12 18:38 UTC (permalink / raw)
To: Vladimir Oltean, netdev
Cc: Tony Nguyen, Przemek Kitszel, intel-wired-lan, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Vadim Fedorenko, Richard Cochran
On 5/12/2025 9:00 AM, 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 Intel ice driver to the new API, so that
> timestamping configuration can be removed from the ndo_eth_ioctl() path
> completely.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Thanks. This has been on my list of nits to cleanup but I hadn't gotten
around to it yet.
I'm covering for Tony for a few days, and will queue this up on his
dev-queue today, so that it get get through our validation cycle.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-12 18:38 ` Jacob Keller
@ 2025-05-12 18:53 ` Vladimir Oltean
2025-05-12 19:06 ` Jacob Keller
0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Oltean @ 2025-05-12 18:53 UTC (permalink / raw)
To: Jacob Keller
Cc: netdev, Tony Nguyen, Przemek Kitszel, intel-wired-lan,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Vadim Fedorenko, Richard Cochran
On Mon, May 12, 2025 at 11:38:17AM -0700, Jacob Keller wrote:
> On 5/12/2025 9:00 AM, 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 Intel ice driver to the new API, so that
> > timestamping configuration can be removed from the ndo_eth_ioctl() path
> > completely.
> >
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> > ---
>
> Acked-by: Jacob Keller <jacob.e.keller@intel.com>
>
> Thanks. This has been on my list of nits to cleanup but I hadn't gotten
> around to it yet.
>
> I'm covering for Tony for a few days, and will queue this up on his
> dev-queue today, so that it get get through our validation cycle.
Ok. I have 3 more Intel conversions pending (igb, ixgbe, i40e), but I've
put a stop for today. I assume it's fine to post these to net-next and
not to the iwl-next tree, or would you prefer otherwise?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-12 18:53 ` Vladimir Oltean
@ 2025-05-12 19:06 ` Jacob Keller
2025-05-13 0:16 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Jacob Keller @ 2025-05-12 19:06 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, Tony Nguyen, Przemek Kitszel, intel-wired-lan,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Vadim Fedorenko, Richard Cochran
On 5/12/2025 11:53 AM, Vladimir Oltean wrote:
> On Mon, May 12, 2025 at 11:38:17AM -0700, Jacob Keller wrote:
>> On 5/12/2025 9:00 AM, 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 Intel ice driver to the new API, so that
>>> timestamping configuration can be removed from the ndo_eth_ioctl() path
>>> completely.
>>>
>>> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>>> ---
>>
>> Acked-by: Jacob Keller <jacob.e.keller@intel.com>
>>
>> Thanks. This has been on my list of nits to cleanup but I hadn't gotten
>> around to it yet.
>>
>> I'm covering for Tony for a few days, and will queue this up on his
>> dev-queue today, so that it get get through our validation cycle.
>
> Ok. I have 3 more Intel conversions pending (igb, ixgbe, i40e), but I've
> put a stop for today. I assume it's fine to post these to net-next and
> not to the iwl-next tree, or would you prefer otherwise?
I think we typically prefer to go through iwl-next because that lets us
run a validation test pass. I have no personal objection if the netdev
maintainers want to take these directly.
Thanks,
Jake
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-12 19:06 ` Jacob Keller
@ 2025-05-13 0:16 ` Jakub Kicinski
2025-05-13 9:31 ` Vladimir Oltean
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2025-05-13 0:16 UTC (permalink / raw)
To: Jacob Keller
Cc: Vladimir Oltean, netdev, Tony Nguyen, Przemek Kitszel,
intel-wired-lan, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Vadim Fedorenko, Richard Cochran
On Mon, 12 May 2025 12:06:56 -0700 Jacob Keller wrote:
> > Ok. I have 3 more Intel conversions pending (igb, ixgbe, i40e), but I've
> > put a stop for today. I assume it's fine to post these to net-next and
> > not to the iwl-next tree, or would you prefer otherwise?
>
> I think we typically prefer to go through iwl-next because that lets us
> run a validation test pass. I have no personal objection if the netdev
> maintainers want to take these directly.
The real question is whether you can get these back to the list before
Vladimir is done converting all drivers :) If yes - let's follow the
usual path and take these via iwl. If Vladimir can convert faster than
you can validate then we should take these direct..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
2025-05-13 0:16 ` Jakub Kicinski
@ 2025-05-13 9:31 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2025-05-13 9:31 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Jacob Keller, netdev, Tony Nguyen, Przemek Kitszel,
intel-wired-lan, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Vadim Fedorenko, Richard Cochran
On Mon, May 12, 2025 at 05:16:52PM -0700, Jakub Kicinski wrote:
> On Mon, 12 May 2025 12:06:56 -0700 Jacob Keller wrote:
> > > Ok. I have 3 more Intel conversions pending (igb, ixgbe, i40e), but I've
> > > put a stop for today. I assume it's fine to post these to net-next and
> > > not to the iwl-next tree, or would you prefer otherwise?
> >
> > I think we typically prefer to go through iwl-next because that lets us
> > run a validation test pass. I have no personal objection if the netdev
> > maintainers want to take these directly.
>
> The real question is whether you can get these back to the list before
> Vladimir is done converting all drivers :) If yes - let's follow the
> usual path and take these via iwl. If Vladimir can convert faster than
> you can validate then we should take these direct..
I think I will be the limiting factor anyway. Let me send all Intel
conversions to iwl-next.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-05-13 9:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 16:00 [PATCH net-next] ice: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
2025-05-12 18:38 ` Jacob Keller
2025-05-12 18:53 ` Vladimir Oltean
2025-05-12 19:06 ` Jacob Keller
2025-05-13 0:16 ` Jakub Kicinski
2025-05-13 9:31 ` Vladimir Oltean
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).