History

net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX

Since commit 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device") the user could get bond active interface's PHC index directly. But when there is a failover, the bond active interface will change, thus the PHC index is also changed. This may break the user's program if they did not update the PHC timely. This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX. When the user wants to get the bond active interface's PHC, they need to add this flag and be aware the PHC index may be changed. With the new flag. All flag checks in current drivers are removed. Only the checking in net_hwtstamp_validate() is kept.

Hangbin Liu committed 4 years ago

Commit 9c9211a1 parent a3c62a040 files · +16 −144Browse files

Showing the changes to include/uapi/linux (1 of 40 files). Show all

Unified · Split

include/uapi/linux/net_tstamp.h+15−1
@@ -62,7 +62,7 @@ struct so_timestamping { · 61 unmodified lines
62/**62/**
63 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter63 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
64 *64 *
65 * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP65 * @flags: one of HWTSTAMP_FLAG_*
66 * @tx_type: one of HWTSTAMP_TX_*66 * @tx_type: one of HWTSTAMP_TX_*
67 * @rx_filter: one of HWTSTAMP_FILTER_*67 * @rx_filter: one of HWTSTAMP_FILTER_*
68 *68 *
@@ -78,6 +78,20 @@ struct hwtstamp_config { · 9 unmodified lines
78 int rx_filter;78 int rx_filter;
79};79};
80 80
81/* possible values for hwtstamp_config->flags */
82enum hwtstamp_flags {
83 /*
84 * With this flag, the user could get bond active interface's
85 * PHC index. Note this PHC index is not stable as when there
86 * is a failover, the bond active interface will be changed, so
87 * will be the PHC index.
88 */
89 HWTSTAMP_FLAG_BONDED_PHC_INDEX = (1<<0),
90
91 HWTSTAMP_FLAG_LAST = HWTSTAMP_FLAG_BONDED_PHC_INDEX,
92 HWTSTAMP_FLAG_MASK = (HWTSTAMP_FLAG_LAST - 1) | HWTSTAMP_FLAG_LAST
93};
94
81/* possible values for hwtstamp_config->tx_type */95/* possible values for hwtstamp_config->tx_type */
82enum hwtstamp_tx_types {96enum hwtstamp_tx_types {
83 /*97 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t