diff mbox series

[net-next,v17,01/14] net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask

Message ID 20240709-feature_ptp_netnext-v17-1-b5317f50df2a@bootlin.com (mailing list archive)
State Accepted
Commit e50bfd6bb231a6e2b7221ad78dce294330238c76
Delegated to: Netdev Maintainers
Headers show
Series net: Make timestamping selectable | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; GEN HAS DIFF 2 files changed, 624 insertions(+);
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 838 this patch: 838
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: jacob.e.keller@intel.com
netdev/build_clang success Errors and warnings before: 872 this patch: 872
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3675 this patch: 3675
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Kory Maincent July 9, 2024, 1:53 p.m. UTC
Timestamping software or hardware flags are often used as a group,
therefore adding these masks will ease future use.

I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
not used at all.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---

Changes in v7:
- Move the masks out of uapi to include/linux/net_tstamp.h

Changes in v9:
- Fix commit message typos
---
 include/linux/net_tstamp.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jacob Keller July 15, 2024, 11:28 p.m. UTC | #1
On 7/9/2024 6:53 AM, Kory Maincent wrote:
> Timestamping software or hardware flags are often used as a group,
> therefore adding these masks will ease future use.
> 
> I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
> not used at all.

+1. Is there any hope of completely removing it? I'm not certain if this
is part of uAPI or not. Even so, we could make it more clear with
deprecation naming or similar.

> 
> Reviewed-by: Willem de Bruijn <willemb@google.com>
> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> ---
> 
> Changes in v7:
> - Move the masks out of uapi to include/linux/net_tstamp.h
> 
> Changes in v9:
> - Fix commit message typos
> ---
>  include/linux/net_tstamp.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
> index eb01c37e71e0..3799c79b6c83 100644
> --- a/include/linux/net_tstamp.h
> +++ b/include/linux/net_tstamp.h
> @@ -5,6 +5,14 @@
>  
>  #include <uapi/linux/net_tstamp.h>
>  
> +#define SOF_TIMESTAMPING_SOFTWARE_MASK	(SOF_TIMESTAMPING_RX_SOFTWARE | \
> +					 SOF_TIMESTAMPING_TX_SOFTWARE | \
> +					 SOF_TIMESTAMPING_SOFTWARE)
> +
> +#define SOF_TIMESTAMPING_HARDWARE_MASK	(SOF_TIMESTAMPING_RX_HARDWARE | \
> +					 SOF_TIMESTAMPING_TX_HARDWARE | \
> +					 SOF_TIMESTAMPING_RAW_HARDWARE)
> +

We can't drop _MASK because there already is SOF_TIMESTAMPING_SOFTWARE.
Makes sense.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  enum hwtstamp_source {
>  	HWTSTAMP_SOURCE_NETDEV,
>  	HWTSTAMP_SOURCE_PHYLIB,
>
diff mbox series

Patch

diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
index eb01c37e71e0..3799c79b6c83 100644
--- a/include/linux/net_tstamp.h
+++ b/include/linux/net_tstamp.h
@@ -5,6 +5,14 @@ 
 
 #include <uapi/linux/net_tstamp.h>
 
+#define SOF_TIMESTAMPING_SOFTWARE_MASK	(SOF_TIMESTAMPING_RX_SOFTWARE | \
+					 SOF_TIMESTAMPING_TX_SOFTWARE | \
+					 SOF_TIMESTAMPING_SOFTWARE)
+
+#define SOF_TIMESTAMPING_HARDWARE_MASK	(SOF_TIMESTAMPING_RX_HARDWARE | \
+					 SOF_TIMESTAMPING_TX_HARDWARE | \
+					 SOF_TIMESTAMPING_RAW_HARDWARE)
+
 enum hwtstamp_source {
 	HWTSTAMP_SOURCE_NETDEV,
 	HWTSTAMP_SOURCE_PHYLIB,