diff mbox series

[net-next,v7,07/16] net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask

Message ID 20231114-feature_ptp_netnext-v7-7-472e77951e40@bootlin.com (mailing list archive)
State Accepted
Commit acec05fb78abb74fdab2195bfca9a6d38a732643
Delegated to: Netdev Maintainers
Headers show
Series net: Make timestamping selectable | expand

Checks

Context Check Description
netdev/series_format fail Series longer than 15 patches (and no cover letter)
netdev/tree_selection success Clearly marked for net-next, async
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: 3891 this patch: 3891
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 1328 this patch: 1328
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: 4144 this patch: 4144
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 Nov. 14, 2023, 11:28 a.m. UTC
Timestamping software or hardware flags are often used as a group,
therefore adding these masks will easier future use.

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

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 include/uapi/linux/net_tstamp.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Willem de Bruijn Nov. 14, 2023, 3:52 p.m. UTC | #1
Kory Maincent wrote:
> Timestamping software or hardware flags are often used as a group,
> therefore adding these masks will easier future use.
> 
> I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
> not use at all.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>
Jakub Kicinski Nov. 19, 2023, 2:22 a.m. UTC | #2
On Tue, 14 Nov 2023 12:28:35 +0100 Kory Maincent wrote:
> Timestamping software or hardware flags are often used as a group,
> therefore adding these masks will easier future use.
> 
> I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
> not use at all.

Does this really need to be in uAPI?
Kory Maincent Nov. 20, 2023, 9:05 a.m. UTC | #3
On Sat, 18 Nov 2023 18:22:47 -0800
Jakub Kicinski <kuba@kernel.org> wrote:

> On Tue, 14 Nov 2023 12:28:35 +0100 Kory Maincent wrote:
> > Timestamping software or hardware flags are often used as a group,
> > therefore adding these masks will easier future use.
> > 
> > I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
> > not use at all.  
> 
> Does this really need to be in uAPI?

I have put it in the same place as SOF_TIMESTAMPING_* flags but indeed I am not
sure ethtool would need it.
I can move it to include/linux/net_tstamp.h and we will move back to uapi if
we see that it is necessary. What do you think?
Jakub Kicinski Nov. 20, 2023, 4:48 p.m. UTC | #4
On Mon, 20 Nov 2023 10:05:49 +0100 Köry Maincent wrote:
> > Does this really need to be in uAPI?  
> 
> I have put it in the same place as SOF_TIMESTAMPING_* flags but indeed I am not
> sure ethtool would need it.
> I can move it to include/linux/net_tstamp.h and we will move back to uapi if
> we see that it is necessary. What do you think?

include/linux/net_tstamp.h sounds better to me, Willem may disagree..
Willem de Bruijn Nov. 20, 2023, 4:51 p.m. UTC | #5
Jakub Kicinski wrote:
> On Mon, 20 Nov 2023 10:05:49 +0100 Köry Maincent wrote:
> > > Does this really need to be in uAPI?  
> > 
> > I have put it in the same place as SOF_TIMESTAMPING_* flags but indeed I am not
> > sure ethtool would need it.
> > I can move it to include/linux/net_tstamp.h and we will move back to uapi if
> > we see that it is necessary. What do you think?
> 
> include/linux/net_tstamp.h sounds better to me, Willem may disagree..

Sounds like the right home to me for non uapi timestamping, too.
diff mbox series

Patch

diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index a2c66b3d7f0f..df8091998c8d 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -48,6 +48,14 @@  enum {
 					 SOF_TIMESTAMPING_TX_SCHED | \
 					 SOF_TIMESTAMPING_TX_ACK)
 
+#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)
+
 /**
  * struct so_timestamping - SO_TIMESTAMPING parameter
  *