stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
@ 2022-04-06 19:29 Vladimir Oltean
  2022-04-06 19:29 ` [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW Vladimir Oltean
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-06 19:29 UTC (permalink / raw)
  To: Sasha Levin, Greg Kroah-Hartman, stable
  Cc: lkml, Willem de Bruijn, Soheil Hassas Yeganeh, netdev,
	Paolo Abeni, Jakub Kicinski, David S. Miller

As discussed with Willem here:
https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/

the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
option in several cases on older kernels, yet user space has no way to
find out about this, practically resulting in broken functionality.

This patch set backports the support towards linux-4.14.y and linux-4.19.y,
which fixes the issue described above by simply making the kernel act
upon SOF_TIMESTAMPING_OPT_ID as expected.

Testing was done with the most recent (not the vintage-correct one)
kselftest script at:
tools/testing/selftests/networking/timestamping/txtimestamp.sh
with the message "OK. All tests passed".

I tried to backport the changes to linux-4.9.y as well, but something
apparently unrelated is broken there, and I didn't investigate further
so I'm not targeting that stable branch:

./txtimestamp.sh
protocol:     TCP
payload:      10
server port:  9000

family:       INET
test SND
    USR: 1581090724 s 856088 us (seq=0, len=0)
./txtimestamp: poll

Willem de Bruijn (2):
  ipv6: add missing tx timestamping on IPPROTO_RAW
  net: add missing SOF_TIMESTAMPING_OPT_ID support

 include/net/sock.h     | 25 +++++++++++++++++++++----
 net/can/raw.c          |  2 +-
 net/ipv4/raw.c         |  2 +-
 net/ipv6/raw.c         |  7 +++++--
 net/packet/af_packet.c |  6 +++---
 5 files changed, 31 insertions(+), 11 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW
  2022-04-06 19:29 [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
@ 2022-04-06 19:29 ` Vladimir Oltean
  2022-04-06 19:45   ` Willem de Bruijn
  2022-04-06 19:29 ` [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support Vladimir Oltean
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-06 19:29 UTC (permalink / raw)
  To: Sasha Levin, Greg Kroah-Hartman, stable
  Cc: lkml, Willem de Bruijn, Soheil Hassas Yeganeh, netdev,
	Paolo Abeni, Jakub Kicinski, David S. Miller, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

[ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ]

Raw sockets support tx timestamping, but one case is missing.

IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc
has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does
not. Add it.

Fixes: 11878b40ed5c ("net-timestamp: SOCK_RAW and PING timestamping")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/ipv6/raw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 3d9d20074203..f0d8b7e9a685 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -622,7 +622,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
 
 static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
 			struct flowi6 *fl6, struct dst_entry **dstp,
-			unsigned int flags)
+			unsigned int flags, const struct sockcm_cookie *sockc)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct net *net = sock_net(sk);
@@ -659,6 +659,8 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
 
 	skb->ip_summed = CHECKSUM_NONE;
 
+	sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+
 	if (flags & MSG_CONFIRM)
 		skb_set_dst_pending_confirm(skb, 1);
 
@@ -945,7 +947,8 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 
 back_from_confirm:
 	if (hdrincl)
-		err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags);
+		err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst,
+					msg->msg_flags, &sockc);
 	else {
 		ipc6.opt = opt;
 		lock_sock(sk);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support
  2022-04-06 19:29 [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
  2022-04-06 19:29 ` [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW Vladimir Oltean
@ 2022-04-06 19:29 ` Vladimir Oltean
  2022-04-06 19:48   ` Willem de Bruijn
  2022-04-06 19:29 ` [PATCH 4.19 1/1] " Vladimir Oltean
  2022-04-08 15:29 ` [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
  3 siblings, 1 reply; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-06 19:29 UTC (permalink / raw)
  To: Sasha Levin, Greg Kroah-Hartman, stable
  Cc: lkml, Willem de Bruijn, Soheil Hassas Yeganeh, netdev,
	Paolo Abeni, Jakub Kicinski, David S. Miller, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

[ Upstream commit 8f932f762e7928d250e21006b00ff9b7718b0a64 ]

SOF_TIMESTAMPING_OPT_ID is supported on TCP, UDP and RAW sockets.
But it was missing on RAW with IPPROTO_IP, PF_PACKET and CAN.

Add skb_setup_tx_timestamp that configures both tx_flags and tskey
for these paths that do not need corking or use bytestream keys.

Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 include/net/sock.h     | 25 +++++++++++++++++++++----
 net/can/raw.c          |  2 +-
 net/ipv4/raw.c         |  2 +-
 net/ipv6/raw.c         |  2 +-
 net/packet/af_packet.c |  6 +++---
 5 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index f72753391acc..f729ccfe756a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2311,22 +2311,39 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
 void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);
 
 /**
- * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
+ * _sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
  * @sk:		socket sending this packet
  * @tsflags:	timestamping flags to use
  * @tx_flags:	completed with instructions for time stamping
+ * @tskey:      filled in with next sk_tskey (not for TCP, which uses seqno)
  *
  * Note: callers should take care of initial ``*tx_flags`` value (usually 0)
  */
-static inline void sock_tx_timestamp(const struct sock *sk, __u16 tsflags,
-				     __u8 *tx_flags)
+static inline void _sock_tx_timestamp(struct sock *sk, __u16 tsflags,
+				      __u8 *tx_flags, __u32 *tskey)
 {
-	if (unlikely(tsflags))
+	if (unlikely(tsflags)) {
 		__sock_tx_timestamp(tsflags, tx_flags);
+		if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
+		    tsflags & SOF_TIMESTAMPING_TX_RECORD_MASK)
+			*tskey = sk->sk_tskey++;
+	}
 	if (unlikely(sock_flag(sk, SOCK_WIFI_STATUS)))
 		*tx_flags |= SKBTX_WIFI_STATUS;
 }
 
+static inline void sock_tx_timestamp(struct sock *sk, __u16 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)
+{
+	_sock_tx_timestamp(skb->sk, tsflags, &skb_shinfo(skb)->tx_flags,
+			   &skb_shinfo(skb)->tskey);
+}
+
 /**
  * sk_eat_skb - Release a skb if it is no longer needed
  * @sk: socket to eat this skb from
diff --git a/net/can/raw.c b/net/can/raw.c
index 2a987a6ea6d7..bda2113a8529 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -814,7 +814,7 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 	if (err < 0)
 		goto free_skb;
 
-	sock_tx_timestamp(sk, sk->sk_tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sk->sk_tsflags);
 
 	skb->dev = dev;
 	skb->sk  = sk;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 9c4b2c0dc68a..19a6ec2adc6c 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -390,7 +390,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
 
 	skb->ip_summed = CHECKSUM_NONE;
 
-	sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 
 	if (flags & MSG_CONFIRM)
 		skb_set_dst_pending_confirm(skb, 1);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index f0d8b7e9a685..e8926ebfe74c 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -659,7 +659,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
 
 	skb->ip_summed = CHECKSUM_NONE;
 
-	sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 
 	if (flags & MSG_CONFIRM)
 		skb_set_dst_pending_confirm(skb, 1);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 92394595920c..b0dd17d1992e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2017,7 +2017,7 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
 	skb->priority = sk->sk_priority;
 	skb->mark = sk->sk_mark;
 
-	sock_tx_timestamp(sk, sockc.tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc.tsflags);
 
 	if (unlikely(extra_len == 4))
 		skb->no_fcs = 1;
@@ -2539,7 +2539,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
 	skb->dev = dev;
 	skb->priority = po->sk.sk_priority;
 	skb->mark = po->sk.sk_mark;
-	sock_tx_timestamp(&po->sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 	skb_zcopy_set_nouarg(skb, ph.raw);
 
 	skb_reserve(skb, hlen);
@@ -3002,7 +3002,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
 		goto out_free;
 	}
 
-	sock_tx_timestamp(sk, sockc.tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc.tsflags);
 
 	if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) &&
 	    !packet_extra_vlan_len_allowed(dev, skb)) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4.19 1/1] net: add missing SOF_TIMESTAMPING_OPT_ID support
  2022-04-06 19:29 [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
  2022-04-06 19:29 ` [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW Vladimir Oltean
  2022-04-06 19:29 ` [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support Vladimir Oltean
@ 2022-04-06 19:29 ` Vladimir Oltean
  2022-04-08 15:29 ` [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
  3 siblings, 0 replies; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-06 19:29 UTC (permalink / raw)
  To: Sasha Levin, Greg Kroah-Hartman, stable
  Cc: lkml, Willem de Bruijn, Soheil Hassas Yeganeh, netdev,
	Paolo Abeni, Jakub Kicinski, David S. Miller, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

[ Upstream commit 8f932f762e7928d250e21006b00ff9b7718b0a64 ]

SOF_TIMESTAMPING_OPT_ID is supported on TCP, UDP and RAW sockets.
But it was missing on RAW with IPPROTO_IP, PF_PACKET and CAN.

Add skb_setup_tx_timestamp that configures both tx_flags and tskey
for these paths that do not need corking or use bytestream keys.

Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 include/net/sock.h     | 25 +++++++++++++++++++++----
 net/can/raw.c          |  2 +-
 net/ipv4/raw.c         |  2 +-
 net/ipv6/raw.c         |  2 +-
 net/packet/af_packet.c |  6 +++---
 5 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 2bf8dcf863f2..7d3a4c2eea95 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2400,22 +2400,39 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
 void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);
 
 /**
- * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
+ * _sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
  * @sk:		socket sending this packet
  * @tsflags:	timestamping flags to use
  * @tx_flags:	completed with instructions for time stamping
+ * @tskey:      filled in with next sk_tskey (not for TCP, which uses seqno)
  *
  * Note: callers should take care of initial ``*tx_flags`` value (usually 0)
  */
-static inline void sock_tx_timestamp(const struct sock *sk, __u16 tsflags,
-				     __u8 *tx_flags)
+static inline void _sock_tx_timestamp(struct sock *sk, __u16 tsflags,
+				      __u8 *tx_flags, __u32 *tskey)
 {
-	if (unlikely(tsflags))
+	if (unlikely(tsflags)) {
 		__sock_tx_timestamp(tsflags, tx_flags);
+		if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
+		    tsflags & SOF_TIMESTAMPING_TX_RECORD_MASK)
+			*tskey = sk->sk_tskey++;
+	}
 	if (unlikely(sock_flag(sk, SOCK_WIFI_STATUS)))
 		*tx_flags |= SKBTX_WIFI_STATUS;
 }
 
+static inline void sock_tx_timestamp(struct sock *sk, __u16 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)
+{
+	_sock_tx_timestamp(skb->sk, tsflags, &skb_shinfo(skb)->tx_flags,
+			   &skb_shinfo(skb)->tskey);
+}
+
 /**
  * sk_eat_skb - Release a skb if it is no longer needed
  * @sk: socket to eat this skb from
diff --git a/net/can/raw.c b/net/can/raw.c
index d0fb5a57c66d..2a6db8752b61 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -814,7 +814,7 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 	if (err < 0)
 		goto free_skb;
 
-	sock_tx_timestamp(sk, sk->sk_tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sk->sk_tsflags);
 
 	skb->dev = dev;
 	skb->sk  = sk;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 8cae691c3c9f..654f586fc0d7 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -391,7 +391,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
 
 	skb->ip_summed = CHECKSUM_NONE;
 
-	sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 
 	if (flags & MSG_CONFIRM)
 		skb_set_dst_pending_confirm(skb, 1);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 98c8f98a7660..ad7bd40b6d53 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -660,7 +660,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
 
 	skb->ip_summed = CHECKSUM_NONE;
 
-	sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 
 	if (flags & MSG_CONFIRM)
 		skb_set_dst_pending_confirm(skb, 1);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index d65051959f85..b951f411dded 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1978,7 +1978,7 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
 	skb->mark = sk->sk_mark;
 	skb->tstamp = sockc.transmit_time;
 
-	sock_tx_timestamp(sk, sockc.tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc.tsflags);
 
 	if (unlikely(extra_len == 4))
 		skb->no_fcs = 1;
@@ -2501,7 +2501,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
 	skb->priority = po->sk.sk_priority;
 	skb->mark = po->sk.sk_mark;
 	skb->tstamp = sockc->transmit_time;
-	sock_tx_timestamp(&po->sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc->tsflags);
 	skb_zcopy_set_nouarg(skb, ph.raw);
 
 	skb_reserve(skb, hlen);
@@ -2965,7 +2965,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
 		goto out_free;
 	}
 
-	sock_tx_timestamp(sk, sockc.tsflags, &skb_shinfo(skb)->tx_flags);
+	skb_setup_tx_timestamp(skb, sockc.tsflags);
 
 	if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) &&
 	    !packet_extra_vlan_len_allowed(dev, skb)) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW
  2022-04-06 19:29 ` [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW Vladimir Oltean
@ 2022-04-06 19:45   ` Willem de Bruijn
  2022-04-06 19:47     ` Vladimir Oltean
  0 siblings, 1 reply; 13+ messages in thread
From: Willem de Bruijn @ 2022-04-06 19:45 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Sasha Levin, Greg Kroah-Hartman, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Wed, Apr 6, 2022 at 3:30 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> From: Willem de Bruijn <willemb@google.com>
>
> [ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ]
>
> Raw sockets support tx timestamping, but one case is missing.
>
> IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc
> has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does
> not. Add it.
>
> Fixes: 11878b40ed5c ("net-timestamp: SOCK_RAW and PING timestamping")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

For 4.14.y cherry-pick:

Acked-by: Willem de Bruijn <willemb@google.com>

Might be good to point out that this is not only a clean cherry-pick
of the one-line patch, but has to include part of commit a818f75e311c
("net: ipv6: Hook into time based transmission") to plumb the
sockcm_cookie. The rest of that patch is not a candidate for stable,
so LGTM.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW
  2022-04-06 19:45   ` Willem de Bruijn
@ 2022-04-06 19:47     ` Vladimir Oltean
  2022-04-06 21:57       ` Willem de Bruijn
  0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-06 19:47 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: Sasha Levin, Greg Kroah-Hartman, stable, lkml,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Wed, Apr 06, 2022 at 03:45:14PM -0400, Willem de Bruijn wrote:
> On Wed, Apr 6, 2022 at 3:30 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> >
> > From: Willem de Bruijn <willemb@google.com>
> >
> > [ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ]
> >
> > Raw sockets support tx timestamping, but one case is missing.
> >
> > IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc
> > has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does
> > not. Add it.
> >
> > Fixes: 11878b40ed5c ("net-timestamp: SOCK_RAW and PING timestamping")
> > Signed-off-by: Willem de Bruijn <willemb@google.com>
> > Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> For 4.14.y cherry-pick:
> 
> Acked-by: Willem de Bruijn <willemb@google.com>

Thanks.

> Might be good to point out that this is not only a clean cherry-pick
> of the one-line patch, but has to include part of commit a818f75e311c
> ("net: ipv6: Hook into time based transmission") to plumb the
> sockcm_cookie. The rest of that patch is not a candidate for stable,
> so LGTM.

Point out how?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support
  2022-04-06 19:29 ` [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support Vladimir Oltean
@ 2022-04-06 19:48   ` Willem de Bruijn
  0 siblings, 0 replies; 13+ messages in thread
From: Willem de Bruijn @ 2022-04-06 19:48 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Sasha Levin, Greg Kroah-Hartman, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Wed, Apr 6, 2022 at 3:30 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> From: Willem de Bruijn <willemb@google.com>
>
> [ Upstream commit 8f932f762e7928d250e21006b00ff9b7718b0a64 ]
>
> SOF_TIMESTAMPING_OPT_ID is supported on TCP, UDP and RAW sockets.
> But it was missing on RAW with IPPROTO_IP, PF_PACKET and CAN.
>
> Add skb_setup_tx_timestamp that configures both tx_flags and tskey
> for these paths that do not need corking or use bytestream keys.
>
> Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Acked-by: Willem de Bruijn <willemb@google.com>

Thanks for handling the cherry-pick to stable of this fix, Vladimir.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW
  2022-04-06 19:47     ` Vladimir Oltean
@ 2022-04-06 21:57       ` Willem de Bruijn
  0 siblings, 0 replies; 13+ messages in thread
From: Willem de Bruijn @ 2022-04-06 21:57 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Willem de Bruijn, Sasha Levin, Greg Kroah-Hartman, stable, lkml,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Wed, Apr 6, 2022 at 5:15 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>
> On Wed, Apr 06, 2022 at 03:45:14PM -0400, Willem de Bruijn wrote:
> > On Wed, Apr 6, 2022 at 3:30 PM Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> > >
> > > From: Willem de Bruijn <willemb@google.com>
> > >
> > > [ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ]
> > >
> > > Raw sockets support tx timestamping, but one case is missing.
> > >
> > > IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc
> > > has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does
> > > not. Add it.
> > >
> > > Fixes: 11878b40ed5c ("net-timestamp: SOCK_RAW and PING timestamping")
> > > Signed-off-by: Willem de Bruijn <willemb@google.com>
> > > Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> >
> > For 4.14.y cherry-pick:
> >
> > Acked-by: Willem de Bruijn <willemb@google.com>
>
> Thanks.
>
> > Might be good to point out that this is not only a clean cherry-pick
> > of the one-line patch, but has to include part of commit a818f75e311c
> > ("net: ipv6: Hook into time based transmission") to plumb the
> > sockcm_cookie. The rest of that patch is not a candidate for stable,
> > so LGTM.
>
> Point out how?

In this case I did, so we're good. In general, perhaps it's fine to
add such comments below the original Signed-off-by/Acked-by/.. block?
Not sure what the common approach is, if any.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
  2022-04-06 19:29 [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
                   ` (2 preceding siblings ...)
  2022-04-06 19:29 ` [PATCH 4.19 1/1] " Vladimir Oltean
@ 2022-04-08 15:29 ` Vladimir Oltean
  2022-04-08 15:42   ` Greg Kroah-Hartman
  2022-04-29  8:38   ` Greg Kroah-Hartman
  3 siblings, 2 replies; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-08 15:29 UTC (permalink / raw)
  To: Sasha Levin, Greg Kroah-Hartman, stable
  Cc: lkml, Willem de Bruijn, Soheil Hassas Yeganeh, netdev,
	Paolo Abeni, Jakub Kicinski, David S. Miller

Hello Greg, Sasha,

On Wed, Apr 06, 2022 at 10:29:53PM +0300, Vladimir Oltean wrote:
> As discussed with Willem here:
> https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/
> 
> the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
> option in several cases on older kernels, yet user space has no way to
> find out about this, practically resulting in broken functionality.
> 
> This patch set backports the support towards linux-4.14.y and linux-4.19.y,
> which fixes the issue described above by simply making the kernel act
> upon SOF_TIMESTAMPING_OPT_ID as expected.
> 
> Testing was done with the most recent (not the vintage-correct one)
> kselftest script at:
> tools/testing/selftests/networking/timestamping/txtimestamp.sh
> with the message "OK. All tests passed".

Could you please pick up these backports for "stable"? Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
  2022-04-08 15:29 ` [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
@ 2022-04-08 15:42   ` Greg Kroah-Hartman
  2022-04-09 16:09     ` Sasha Levin
  2022-04-29  8:38   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 13+ messages in thread
From: Greg Kroah-Hartman @ 2022-04-08 15:42 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Sasha Levin, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Fri, Apr 08, 2022 at 03:29:30PM +0000, Vladimir Oltean wrote:
> Hello Greg, Sasha,
> 
> On Wed, Apr 06, 2022 at 10:29:53PM +0300, Vladimir Oltean wrote:
> > As discussed with Willem here:
> > https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/
> > 
> > the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
> > option in several cases on older kernels, yet user space has no way to
> > find out about this, practically resulting in broken functionality.
> > 
> > This patch set backports the support towards linux-4.14.y and linux-4.19.y,
> > which fixes the issue described above by simply making the kernel act
> > upon SOF_TIMESTAMPING_OPT_ID as expected.
> > 
> > Testing was done with the most recent (not the vintage-correct one)
> > kselftest script at:
> > tools/testing/selftests/networking/timestamping/txtimestamp.sh
> > with the message "OK. All tests passed".
> 
> Could you please pick up these backports for "stable"? Thanks.

You sent this 2 days ago!

Please relax :)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
  2022-04-08 15:42   ` Greg Kroah-Hartman
@ 2022-04-09 16:09     ` Sasha Levin
  0 siblings, 0 replies; 13+ messages in thread
From: Sasha Levin @ 2022-04-09 16:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Vladimir Oltean, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Fri, Apr 08, 2022 at 05:42:30PM +0200, Greg Kroah-Hartman wrote:
>On Fri, Apr 08, 2022 at 03:29:30PM +0000, Vladimir Oltean wrote:
>> Hello Greg, Sasha,
>>
>> On Wed, Apr 06, 2022 at 10:29:53PM +0300, Vladimir Oltean wrote:
>> > As discussed with Willem here:
>> > https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/
>> >
>> > the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
>> > option in several cases on older kernels, yet user space has no way to
>> > find out about this, practically resulting in broken functionality.
>> >
>> > This patch set backports the support towards linux-4.14.y and linux-4.19.y,
>> > which fixes the issue described above by simply making the kernel act
>> > upon SOF_TIMESTAMPING_OPT_ID as expected.
>> >
>> > Testing was done with the most recent (not the vintage-correct one)
>> > kselftest script at:
>> > tools/testing/selftests/networking/timestamping/txtimestamp.sh
>> > with the message "OK. All tests passed".
>>
>> Could you please pick up these backports for "stable"? Thanks.
>
>You sent this 2 days ago!
>
>Please relax :)

I've queued these up.

In general, we don't pick up new patches during -rc releases, which is
when you've sent this patchset and which is why sometimes it takes a few
days for stuff to go in.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
  2022-04-08 15:29 ` [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
  2022-04-08 15:42   ` Greg Kroah-Hartman
@ 2022-04-29  8:38   ` Greg Kroah-Hartman
  2022-04-29  9:54     ` Vladimir Oltean
  1 sibling, 1 reply; 13+ messages in thread
From: Greg Kroah-Hartman @ 2022-04-29  8:38 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Sasha Levin, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Fri, Apr 08, 2022 at 03:29:30PM +0000, Vladimir Oltean wrote:
> Hello Greg, Sasha,
> 
> On Wed, Apr 06, 2022 at 10:29:53PM +0300, Vladimir Oltean wrote:
> > As discussed with Willem here:
> > https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/
> > 
> > the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
> > option in several cases on older kernels, yet user space has no way to
> > find out about this, practically resulting in broken functionality.
> > 
> > This patch set backports the support towards linux-4.14.y and linux-4.19.y,
> > which fixes the issue described above by simply making the kernel act
> > upon SOF_TIMESTAMPING_OPT_ID as expected.
> > 
> > Testing was done with the most recent (not the vintage-correct one)
> > kselftest script at:
> > tools/testing/selftests/networking/timestamping/txtimestamp.sh
> > with the message "OK. All tests passed".
> 
> Could you please pick up these backports for "stable"? Thanks.

Do you not already see these in a released kernel?  If not, please
resubmit what is missing as I think they are all there...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19
  2022-04-29  8:38   ` Greg Kroah-Hartman
@ 2022-04-29  9:54     ` Vladimir Oltean
  0 siblings, 0 replies; 13+ messages in thread
From: Vladimir Oltean @ 2022-04-29  9:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sasha Levin, stable, lkml, Willem de Bruijn,
	Soheil Hassas Yeganeh, netdev, Paolo Abeni, Jakub Kicinski,
	David S. Miller

On Fri, Apr 29, 2022 at 10:38:42AM +0200, Greg Kroah-Hartman wrote:
> On Fri, Apr 08, 2022 at 03:29:30PM +0000, Vladimir Oltean wrote:
> > Hello Greg, Sasha,
> > 
> > On Wed, Apr 06, 2022 at 10:29:53PM +0300, Vladimir Oltean wrote:
> > > As discussed with Willem here:
> > > https://lore.kernel.org/netdev/CA+FuTSdQ57O6RWj_Lenmu_Vd3NEX9xMzMYkB0C3rKMzGgcPc6A@mail.gmail.com/T/
> > > 
> > > the kernel silently doesn't act upon the SOF_TIMESTAMPING_OPT_ID socket
> > > option in several cases on older kernels, yet user space has no way to
> > > find out about this, practically resulting in broken functionality.
> > > 
> > > This patch set backports the support towards linux-4.14.y and linux-4.19.y,
> > > which fixes the issue described above by simply making the kernel act
> > > upon SOF_TIMESTAMPING_OPT_ID as expected.
> > > 
> > > Testing was done with the most recent (not the vintage-correct one)
> > > kselftest script at:
> > > tools/testing/selftests/networking/timestamping/txtimestamp.sh
> > > with the message "OK. All tests passed".
> > 
> > Could you please pick up these backports for "stable"? Thanks.
> 
> Do you not already see these in a released kernel?  If not, please
> resubmit what is missing as I think they are all there...

They're there, thanks.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.14.y&id=add668be8f5e53f4471a075edaa70a7cb85fd036
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.14.y&id=a96c57a72f477b42ab238fad3c2c1f8e8c091256
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=cd7295d0bea3f56a3f024f1b22d50a0f3fc727f1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-04-29  9:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 19:29 [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
2022-04-06 19:29 ` [PATCH 4.14 1/2] ipv6: add missing tx timestamping on IPPROTO_RAW Vladimir Oltean
2022-04-06 19:45   ` Willem de Bruijn
2022-04-06 19:47     ` Vladimir Oltean
2022-04-06 21:57       ` Willem de Bruijn
2022-04-06 19:29 ` [PATCH 4.14 2/2] net: add missing SOF_TIMESTAMPING_OPT_ID support Vladimir Oltean
2022-04-06 19:48   ` Willem de Bruijn
2022-04-06 19:29 ` [PATCH 4.19 1/1] " Vladimir Oltean
2022-04-08 15:29 ` [PATCH stable 0/3] SOF_TIMESTAMPING_OPT_ID backport to 4.14 and 4.19 Vladimir Oltean
2022-04-08 15:42   ` Greg Kroah-Hartman
2022-04-09 16:09     ` Sasha Levin
2022-04-29  8:38   ` Greg Kroah-Hartman
2022-04-29  9:54     ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).