Re: [PATCH RFC net-next v8 06/13] net: Add struct kernel_ethtool_ts_info

From
Köry Maincent <kory.maincent@bootlin.com>
Date
2024-02-19 10:57:41
Also in
lkml, netdev
Reply to
Rahul Rameshbabu, 2024-02-16
On Fri, 16 Feb 2024 10:27:32 -0800
Rahul Rameshbabu [off-list ref] wrote:
quoted
+/**
+ * struct kernel_ethtool_ts_info - kernel copy of struct ethtool_ts_info
+ * @cmd: command number = %ETHTOOL_GET_TS_INFO
+ * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING
flags
+ * @phc_index: device index of the associated PHC, or -1 if there is none
+ * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration
values
+ * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration
values
+ */
+struct kernel_ethtool_ts_info {
+	u32 cmd;
+	u32 so_timestamping;
+	int phc_index;
+	enum hwtstamp_tx_types tx_types;  
I might just be terrible at reading code, but isn't this what
tx_reserved in ethtool_ts_info is for? I feel like using one of the
reserved memspaces for this enum removes the need to make
kernel_ethtool_ts_info? I might be missing something obvious however.
I did it to prepare the introduction phc_qualifier in patch 12. I am not sure it
would be wise to put it under tx/rx_reserved field. IMHO create a new kernel
structure is cleaner for that than the hack of using one of the tx/rx_reserved
field.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Thread (30 messages) 30 messages, 5 authors, last reply 2024-02-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help