net: e1000e: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
Subsystems (3)
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
@@ -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
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 ine1000e_config_hwtstamp. Align the indentation ofnet_device_ops.Reviewed-by Vadim Fedorenko <[email protected]>Signed-off-by Piotr Wejman <[email protected]>
...
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.
...
Lifshits, Vitaly
Reviewed-byQuoted 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 ine1000e_config_hwtstamp. Align the indentation ofnet_device_ops.Reviewed-by Vadim Fedorenko <[email protected]>Signed-off-by Piotr Wejman <[email protected]>Reviewed-by Simon Horman <[email protected]>
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....