Re: [RFC PATCH net-next v6 1/5] net: Add NDOs for hardware timestamp get/set
From: Max Georgiev <hidden>
Date: 2023-05-12 03:22:35
On Thu, May 11, 2023 at 6:32 AM Vladimir Oltean [off-list ref] wrote:
On Mon, May 01, 2023 at 10:31:46PM -0600, Maxim Georgiev wrote:quoted
struct net_device_ops { int (*ndo_init)(struct net_device *dev);@@ -1649,6 +1659,12 @@ struct net_device_ops { ktime_t (*ndo_get_tstamp)(struct net_device *dev, const struct skb_shared_hwtstamps *hwtstamps, bool cycles); + int (*ndo_hwtstamp_get)(struct net_device *dev, + struct kernel_hwtstamp_config *kernel_config, + struct netlink_ext_ack *extack);I'm not sure it is necessary to pass an extack to "get". That should only give a more detailed reason if the driver refuses something.
I have to admit I just followed Jakub's guidance adding "extack" to the list of parametres. I'll let Jakub to comment on that.
For that matter, now that ndo_hwtstamp_get() should no longer be concerned with the copy_to_user(), I'm not even sure that it should return int at all, and not void. The transition is going to be slightly problematic though, with the generic_hwtstamp_get_lower() necessarily still calling dev_eth_ioctl() -> copy_to_user(), so we probably can't make it void just now.
Would it make sense to keep the return int value here "for future extensions"?