Skip to contentSkip to conversation

net: e1000e: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()

PATCH Superseded Piotr Wejman 3 participants 3 messages Feb 16, 2025 – Feb 18, 2025

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: e1000e: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()

Update the driver to use the new hardware timestamping API added in commit 66f7223039c0 ("net: add NDOs for configuring hardware timestamping"). Use Netlink extack for error reporting in e1000e_config_hwtstamp. Align the indentation of net_device_ops.

---
Changes in v3:
- remove new lines at the end of the extack
- add error print in e1000e_systim_reset
- Link to v2: https://lore.kernel.org/netdev/[email protected]/

Changes in v2:
- amend commit message
- use extack for error reporting
- rename e1000_mii_ioctl to e1000_ioctl
- Link to v1: https://lore.kernel.org/netdev/[email protected]/

 drivers/net/ethernet/intel/e1000e/e1000.h  |  2 +-
 drivers/net/ethernet/intel/e1000e/netdev.c | 73 +++++++++++-----------
 2 files changed, 36 insertions(+), 39 deletions(-)
drivers/net/ethernet/intel/e1000e/e1000.h +1 -1
index ba9c19e6994c..952898151565 100644
@@ -319,7 +319,7 @@ struct e1000_adapter {
 	u16 tx_ring_count;
 	u16 rx_ring_count;
 
-	struct hwtstamp_config hwtstamp_config;
+	struct kernel_hwtstamp_config hwtstamp_config;
 	struct delayed_work systim_overflow_work;
 	struct sk_buff *tx_hwtstamp_skb;
 	unsigned long tx_hwtstamp_start;
drivers/net/ethernet/intel/e1000e/netdev.c +35 -38

177 lines not on this page · raw message

Signature · 1 line
2.25.1
reviewer Reviewed-by on v3 1/1
#1 lore raw
Quoted 7 lines · Piotr Wejman

Update the driver to use the new hardware timestamping API added in commit 66f7223039c0 ("net: add NDOs for configuring hardware timestamping"). Use Netlink extack for error reporting in e1000e_config_hwtstamp. Align the indentation of net_device_ops.

...

drivers/net/ethernet/intel/e1000e/netdev.c static void e1000e_systim_reset(struct e1000_adapter *adapter) · line 3942

Quoted 6 lines
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -3932,7 +3939,11 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter)
 	spin_unlock_irqrestore(&adapter->systim_lock, flags);
 
 	/* restore the previous hwtstamp configuration settings */
-	e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config);
+	ret_val = e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config, &extack);

nit: If there is a v4 for some other reason, please consider line-wrapping

     the above to avoid lines that are more than 80 columns wide.

	ret_val = e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config,
					 &extack);
Quoted 8 lines
drivers/net/ethernet/intel/e1000e/netdev.c +4 -0
+	if (ret_val) {
+		if (extack._msg)
+			e_err("%s\n", extack._msg);
+	}
 }
 
 /**

drivers/net/ethernet/intel/e1000e/netdev.c static int e1000_change_mtu(struct net_device *netdev, int new_mtu) · line 6094

Quoted 7 lines
drivers/net/ethernet/intel/e1000e/netdev.c +2 -2
@@ -6079,8 +6090,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
 	return 0;
 }
 
-static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
-			   int cmd)
+static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr,
+		       int cmd)

nit: And conversely, if there is a v4 for some other reason,
please consider merging the above two lines into one.

...

Reviewed-by
#2 lore raw
Quoted 10 lines · Simon Horman
Quoted 7 lines · Piotr Wejman

Update the driver to use the new hardware timestamping API added in commit 66f7223039c0 ("net: add NDOs for configuring hardware timestamping"). Use Netlink extack for error reporting in e1000e_config_hwtstamp. Align the indentation of net_device_ops.

Quoted 36 lines

...

drivers/net/ethernet/intel/e1000e/netdev.c static void e1000e_systim_reset(struct e1000_adapter *adapter) · line 3942

Quoted 6 lines
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -3932,7 +3939,11 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter)
  	spin_unlock_irqrestore(&adapter->systim_lock, flags);
 
  	/* restore the previous hwtstamp configuration settings */
-	e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config);
+	ret_val = e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config, &extack);

nit: If there is a v4 for some other reason, please consider line-wrapping

      the above to avoid lines that are more than 80 columns wide.

	ret_val = e1000e_config_hwtstamp(adapter, &adapter->hwtstamp_config,
					 &extack);
Quoted 8 lines
drivers/net/ethernet/intel/e1000e/netdev.c +4 -0
+	if (ret_val) {
+		if (extack._msg)
+			e_err("%s\n", extack._msg);
+	}
  }
 
  /**

drivers/net/ethernet/intel/e1000e/netdev.c static int e1000_change_mtu(struct net_device *netdev, int new_mtu) · line 6094

Quoted 7 lines
drivers/net/ethernet/intel/e1000e/netdev.c +2 -2
@@ -6079,8 +6090,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
  	return 0;
  }
 
-static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
-			   int cmd)
+static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr,
+		       int cmd)

nit: And conversely, if there is a v4 for some other reason,
please consider merging the above two lines into one.

...