diff mbox series

[v2,2/5] net-timestamp: Increase the size of tsflags

Message ID 20221018010733.4765-3-muhammad.husaini.zulkifli@intel.com
State Changes Requested
Headers show
Series Add support for DMA timestamp for non-PTP packets | expand

Commit Message

Zulkifli, Muhammad Husaini Oct. 18, 2022, 1:07 a.m. UTC
Increase the size of tsflags to support more SOF_TIMESTAMPING flags.
Current flag size can only support up to 16 flags only.

Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
---
 include/net/sock.h | 12 ++++++------
 net/socket.c       |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Paul Menzel Oct. 18, 2022, 5:57 a.m. UTC | #1
Dear Muhammad,


Thank you for the patch. For the summary/title you could be more 
specific with

 > net-timestamp: Double tsflags size to 32-bit for more flags


Kind regards,

Paul
Zulkifli, Muhammad Husaini Oct. 18, 2022, 12:42 p.m. UTC | #2
Hi Paul,

Thanks for review. 

> -----Original Message-----
> From: Paul Menzel <pmenzel@molgen.mpg.de>
> Sent: Tuesday, 18 October, 2022 1:58 PM
> To: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli@intel.com>
> Cc: leon@kernel.org; netdev@vger.kernel.org; richardcochran@gmail.com;
> saeed@kernel.org; edumazet@google.com; gal@nvidia.com;
> kuba@kernel.org; michael.chan@broadcom.com; davem@davemloft.net;
> andy@greyhouse.net; intel-wired-lan@osuosl.org
> Subject: Re: [Intel-wired-lan] [PATCH v2 2/5] net-timestamp: Increase the
> size of tsflags
> 
> Dear Muhammad,
> 
> 
> Thank you for the patch. For the summary/title you could be more specific
> with
> 
>  > net-timestamp: Double tsflags size to 32-bit for more flags
> 

Sure. Will do

> 
> Kind regards,
> 
> Paul
diff mbox series

Patch

diff --git a/include/net/sock.h b/include/net/sock.h
index 08038a385ef2..ad5a3d44ad25 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -503,7 +503,7 @@  struct sock {
 #if BITS_PER_LONG==32
 	seqlock_t		sk_stamp_seq;
 #endif
-	u16			sk_tsflags;
+	u32			sk_tsflags;
 	u8			sk_shutdown;
 	atomic_t		sk_tskey;
 	atomic_t		sk_zckey;
@@ -1892,7 +1892,7 @@  void sk_send_sigurg(struct sock *sk);
 struct sockcm_cookie {
 	u64 transmit_time;
 	u32 mark;
-	u16 tsflags;
+	u32 tsflags;
 };
 
 static inline void sockcm_init(struct sockcm_cookie *sockc,
@@ -2723,7 +2723,7 @@  static inline void sock_recv_cmsgs(struct msghdr *msg, struct sock *sk,
 		sock_write_timestamp(sk, 0);
 }
 
-void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);
+void __sock_tx_timestamp(__u32 tsflags, __u8 *tx_flags);
 
 /**
  * _sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
@@ -2734,7 +2734,7 @@  void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);
  *
  * Note: callers should take care of initial ``*tx_flags`` value (usually 0)
  */
-static inline void _sock_tx_timestamp(struct sock *sk, __u16 tsflags,
+static inline void _sock_tx_timestamp(struct sock *sk, __u32 tsflags,
 				      __u8 *tx_flags, __u32 *tskey)
 {
 	if (unlikely(tsflags)) {
@@ -2747,13 +2747,13 @@  static inline void _sock_tx_timestamp(struct sock *sk, __u16 tsflags,
 		*tx_flags |= SKBTX_WIFI_STATUS;
 }
 
-static inline void sock_tx_timestamp(struct sock *sk, __u16 tsflags,
+static inline void sock_tx_timestamp(struct sock *sk, __u32 tsflags,
 				     __u8 *tx_flags)
 {
 	_sock_tx_timestamp(sk, tsflags, tx_flags, NULL);
 }
 
-static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags)
+static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u32 tsflags)
 {
 	_sock_tx_timestamp(skb->sk, tsflags, &skb_shinfo(skb)->tx_flags,
 			   &skb_shinfo(skb)->tskey);
diff --git a/net/socket.c b/net/socket.c
index 00da9ce3dba0..ab5d8973e719 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -679,7 +679,7 @@  void sock_release(struct socket *sock)
 }
 EXPORT_SYMBOL(sock_release);
 
-void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags)
+void __sock_tx_timestamp(__u32 tsflags, __u8 *tx_flags)
 {
 	u8 flags = *tx_flags;