Skip to contentSkip to conversation

5.18.6-rc1 review

PATCH In review Greg Kroah-Hartman 15 participants 159 messages Jun 20, 2022 – Jun 22, 2022 Page 2 of 2

Subsystems (6)
lore
Share & tools
lore
#82 lore raw

Re: [PATCH 5.18 081/141] net: remove noblock parameter from skb_recv_datagram()

In reply to Greg Kroah-Hartman

Hello Greg,

as already answered to Sascha:

---

Hello Sasha,

this patch is some kind of improvement/simplification to reduce and clean up the number of variables passed through skb_recv_datagram() call.

There is no functional change and therefore no need to backport this patch IMO.

The 'Reported-by:' tag just came from the kernel test robot when posting the original patch and getting direct feedback on some missing calling sites.

Best regards,
Oliver

Quoted 708 lines · Greg Kroah-Hartman

From: Oliver Hartkopp <[email protected]>

[ Upstream commit f4b41f062c424209e3939a81e6da022e049a45f2 ]

skb_recv_datagram() has two parameters 'flags' and 'noblock' that are merged inside skb_recv_datagram() by 'flags | (noblock ? MSG_DONTWAIT : 0)'

As 'flags' may contain MSG_DONTWAIT as value most callers split the 'flags' into 'flags' and 'noblock' with finally obsolete bit operations like this:

skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &rc);

And this is not even done consistently with the 'flags' parameter.

This patch removes the obsolete and costly splitting into two parameters and only performs bit operations when really needed on the caller side.

One missing conversion thankfully reported by kernel test robot. I missed to enable kunit tests to build the mctp code.

---
  drivers/isdn/mISDN/socket.c    | 2 +-
  drivers/net/ppp/pppoe.c        | 3 +--
  include/linux/skbuff.h         | 3 +--
  net/appletalk/ddp.c            | 3 +--
  net/atm/common.c               | 2 +-
  net/ax25/af_ax25.c             | 3 +--
  net/bluetooth/af_bluetooth.c   | 3 +--
  net/bluetooth/hci_sock.c       | 3 +--
  net/caif/caif_socket.c         | 2 +-
  net/can/bcm.c                  | 5 +----
  net/can/isotp.c                | 4 +---
  net/can/j1939/socket.c         | 2 +-
  net/can/raw.c                  | 6 +-----
  net/core/datagram.c            | 5 ++---
  net/ieee802154/socket.c        | 6 ++++--
  net/ipv4/ping.c                | 3 ++-
  net/ipv4/raw.c                 | 3 ++-
  net/ipv6/raw.c                 | 3 ++-
  net/iucv/af_iucv.c             | 3 +--
  net/key/af_key.c               | 2 +-
  net/l2tp/l2tp_ip.c             | 3 ++-
  net/l2tp/l2tp_ip6.c            | 3 ++-
  net/l2tp/l2tp_ppp.c            | 3 +--
  net/mctp/af_mctp.c             | 2 +-
  net/mctp/test/route-test.c     | 8 ++++----
  net/netlink/af_netlink.c       | 3 +--
  net/netrom/af_netrom.c         | 3 ++-
  net/nfc/llcp_sock.c            | 3 +--
  net/nfc/rawsock.c              | 3 +--
  net/packet/af_packet.c         | 2 +-
  net/phonet/datagram.c          | 3 ++-
  net/phonet/pep.c               | 6 ++++--
  net/qrtr/af_qrtr.c             | 3 +--
  net/rose/af_rose.c             | 3 ++-
  net/unix/af_unix.c             | 5 +++--
  net/vmw_vsock/vmci_transport.c | 5 +----
  net/x25/af_x25.c               | 3 +--
  37 files changed, 57 insertions(+), 70 deletions(-)
drivers/isdn/mISDN/socket.c +1 -1
index a6606736d8c5..2776ca5fc33f 100644
@@ -121,7 +121,7 @@ mISDN_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	if (sk->sk_state == MISDN_CLOSED)
  		return 0;
 
-	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		return err;
 
drivers/net/ppp/pppoe.c +1 -2
index e172743948ed..ce2cbb5903d7 100644
@@ -1012,8 +1012,7 @@ static int pppoe_recvmsg(struct socket *sock, struct msghdr *m,
  		goto end;
  	}
 
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-				flags & MSG_DONTWAIT, &error);
+	skb = skb_recv_datagram(sk, flags, &error);
  	if (error < 0)
  		goto end;
 
include/linux/skbuff.h +1 -2
index 3a30cae8b0a5..2394441fa3dd 100644
@@ -3836,8 +3836,7 @@ struct sk_buff *__skb_try_recv_datagram(struct sock *sk,
  struct sk_buff *__skb_recv_datagram(struct sock *sk,
  				    struct sk_buff_head *sk_queue,
  				    unsigned int flags, int *off, int *err);
-struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
-				  int *err);
+struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned int flags, int *err);
  __poll_t datagram_poll(struct file *file, struct socket *sock,
  			   struct poll_table_struct *wait);
  int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
net/appletalk/ddp.c +1 -2
index bf5736c1d458..a06f4d4a6f47 100644
@@ -1753,8 +1753,7 @@ static int atalk_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	int err = 0;
  	struct sk_buff *skb;
 
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-						flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	lock_sock(sk);
 
  	if (!skb)
net/atm/common.c +1 -1
index 1cfa9bf1d187..d0c8ab7ff8f6 100644
@@ -540,7 +540,7 @@ int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	    !test_bit(ATM_VF_READY, &vcc->flags))
  		return 0;
 
-	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &error);
+	skb = skb_recv_datagram(sk, flags, &error);
  	if (!skb)
  		return error;
 
net/ax25/af_ax25.c +1 -2
index 289f355e1853..95393bb2760b 100644
@@ -1676,8 +1676,7 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	}
 
  	/* Now we can treat all alike */
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-				flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (skb == NULL)
  		goto out;
 
net/bluetooth/af_bluetooth.c +1 -2
index a0cb2e3da8d4..62705734343b 100644
@@ -251,7 +251,6 @@ EXPORT_SYMBOL(bt_accept_dequeue);
  int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  		    int flags)
  {
-	int noblock = flags & MSG_DONTWAIT;
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	size_t copied;
@@ -263,7 +262,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	if (flags & MSG_OOB)
  		return -EOPNOTSUPP;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb) {
  		if (sk->sk_shutdown & RCV_SHUTDOWN)
  			return 0;
net/bluetooth/hci_sock.c +1 -2
index 33b3c0ffc339..189e3115c8c6 100644
@@ -1453,7 +1453,6 @@ static void hci_sock_cmsg(struct sock *sk, struct msghdr *msg,
  static int hci_sock_recvmsg(struct socket *sock, struct msghdr *msg,
  			    size_t len, int flags)
  {
-	int noblock = flags & MSG_DONTWAIT;
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	int copied, err;
@@ -1470,7 +1469,7 @@ static int hci_sock_recvmsg(struct socket *sock, struct msghdr *msg,
  	if (sk->sk_state == BT_CLOSED)
  		return 0;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		return err;
 
net/caif/caif_socket.c +1 -1
index 2b8892d502f7..251e666ba9a2 100644
@@ -282,7 +282,7 @@ static int caif_seqpkt_recvmsg(struct socket *sock, struct msghdr *m,
  	if (flags & MSG_OOB)
  		goto read_error;
 
-	skb = skb_recv_datagram(sk, flags, 0 , &ret);
+	skb = skb_recv_datagram(sk, flags, &ret);
  	if (!skb)
  		goto read_error;
  	copylen = skb->len;
net/can/bcm.c +1 -4
index 95d209b52e6a..64c07e650bb4 100644
@@ -1632,12 +1632,9 @@ static int bcm_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	int error = 0;
-	int noblock;
  	int err;
 
-	noblock =  flags & MSG_DONTWAIT;
-	flags   &= ~MSG_DONTWAIT;
-	skb = skb_recv_datagram(sk, flags, noblock, &error);
+	skb = skb_recv_datagram(sk, flags, &error);
  	if (!skb)
  		return error;
 
net/can/isotp.c +1 -3
index 1e7c6a460ef9..35a1ae61744c 100644
@@ -1055,7 +1055,6 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	struct isotp_sock *so = isotp_sk(sk);
-	int noblock = flags & MSG_DONTWAIT;
  	int ret = 0;
 
  	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
@@ -1064,8 +1063,7 @@ static int isotp_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	if (!so->bound)
  		return -EADDRNOTAVAIL;
 
-	flags &= ~MSG_DONTWAIT;
-	skb = skb_recv_datagram(sk, flags, noblock, &ret);
+	skb = skb_recv_datagram(sk, flags, &ret);
  	if (!skb)
  		return ret;
 
net/can/j1939/socket.c +1 -1
index 6dff4510687a..0bb4fd3f6264 100644
@@ -802,7 +802,7 @@ static int j1939_sk_recvmsg(struct socket *sock, struct msghdr *msg,
  		return sock_recv_errqueue(sock->sk, msg, size, SOL_CAN_J1939,
  					  SCM_J1939_ERRQUEUE);
 
-	skb = skb_recv_datagram(sk, flags, 0, &ret);
+	skb = skb_recv_datagram(sk, flags, &ret);
  	if (!skb)
  		return ret;
 
net/can/raw.c +1 -5
index 7105fa4824e4..0cf728dcff36 100644
@@ -846,16 +846,12 @@ static int raw_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	int err = 0;
-	int noblock;
-
-	noblock = flags & MSG_DONTWAIT;
-	flags &= ~MSG_DONTWAIT;
 
  	if (flags & MSG_ERRQUEUE)
  		return sock_recv_errqueue(sk, msg, size,
  					  SOL_CAN_RAW, SCM_CAN_RAW_ERRQUEUE);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		return err;
 
net/core/datagram.c +2 -3
index ee290776c661..70126d15ca6e 100644
@@ -310,12 +310,11 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk,
  EXPORT_SYMBOL(__skb_recv_datagram);
 
  struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned int flags,
-				  int noblock, int *err)
+				  int *err)
  {
  	int off = 0;
 
-	return __skb_recv_datagram(sk, &sk->sk_receive_queue,
-				   flags | (noblock ? MSG_DONTWAIT : 0),
+	return __skb_recv_datagram(sk, &sk->sk_receive_queue, flags,
  				   &off, err);
  }
  EXPORT_SYMBOL(skb_recv_datagram);
net/ieee802154/socket.c +4 -2
index 3b2366a88c3c..a725dd9bbda8 100644
@@ -314,7 +314,8 @@ static int raw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  	int err = -EOPNOTSUPP;
  	struct sk_buff *skb;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
@@ -703,7 +704,8 @@ static int dgram_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  	struct dgram_sock *ro = dgram_sk(sk);
  	DECLARE_SOCKADDR(struct sockaddr_ieee802154 *, saddr, msg->msg_name);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/ipv4/ping.c +2 -1
index aa9a11b20d18..4e5ceca7ff7f 100644
@@ -871,7 +871,8 @@ int ping_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
  	if (flags & MSG_ERRQUEUE)
  		return inet_recv_error(sk, msg, len, addr_len);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/ipv4/raw.c +2 -1
index 9f97b9cbf7b3..c9dd9603f2e7 100644
@@ -769,7 +769,8 @@ static int raw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  		goto out;
  	}
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/ipv6/raw.c +2 -1
index c51d5ce3711c..8bb41f3b246a 100644
@@ -477,7 +477,8 @@ static int rawv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  	if (np->rxpmtu && np->rxopt.bits.rxpmtu)
  		return ipv6_recv_rxpmtu(sk, msg, len, addr_len);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/iucv/af_iucv.c +1 -2
index a1760add5bf1..a0385ddbffcf 100644
@@ -1223,7 +1223,6 @@ static void iucv_process_message_q(struct sock *sk)
  static int iucv_sock_recvmsg(struct socket *sock, struct msghdr *msg,
  			     size_t len, int flags)
  {
-	int noblock = flags & MSG_DONTWAIT;
  	struct sock *sk = sock->sk;
  	struct iucv_sock *iucv = iucv_sk(sk);
  	unsigned int copied, rlen;
@@ -1242,7 +1241,7 @@ static int iucv_sock_recvmsg(struct socket *sock, struct msghdr *msg,
 
  	/* receive/dequeue next skb:
  	 * the function understands MSG_PEEK and, thus, does not dequeue skb */
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb) {
  		if (sk->sk_shutdown & RCV_SHUTDOWN)
  			return 0;
net/key/af_key.c +1 -1
index d93bde657359..c249b84efbb2 100644
@@ -3700,7 +3700,7 @@ static int pfkey_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
  		goto out;
 
-	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (skb == NULL)
  		goto out;
 
net/l2tp/l2tp_ip.c +2 -1
index b3edafa5fba4..c6a5cc2d88e7 100644
@@ -526,7 +526,8 @@ static int l2tp_ip_recvmsg(struct sock *sk, struct msghdr *msg,
  	if (flags & MSG_OOB)
  		goto out;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/l2tp/l2tp_ip6.c +2 -1
index d54dbd01d86f..8f76e647adbb 100644
@@ -672,7 +672,8 @@ static int l2tp_ip6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  	if (flags & MSG_ERRQUEUE)
  		return ipv6_recv_error(sk, msg, len, addr_len);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto out;
 
net/l2tp/l2tp_ppp.c +1 -2
index bf35710127dd..8be1fdc68a0b 100644
@@ -191,8 +191,7 @@ static int pppol2tp_recvmsg(struct socket *sock, struct msghdr *msg,
  		goto end;
 
  	err = 0;
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-				flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb)
  		goto end;
 
net/mctp/af_mctp.c +1 -1
index e22b0cbb2f35..221863afc4b1 100644
@@ -216,7 +216,7 @@ static int mctp_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
  		return -EOPNOTSUPP;
 
-	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &rc);
+	skb = skb_recv_datagram(sk, flags, &rc);
  	if (!skb)
  		return rc;
 
net/mctp/test/route-test.c +4 -4
index 61205cf40074..24df29e135ed 100644
@@ -352,7 +352,7 @@ static void mctp_test_route_input_sk(struct kunit *test)
  	if (params->deliver) {
  		KUNIT_EXPECT_EQ(test, rc, 0);
 
-		skb2 = skb_recv_datagram(sock->sk, 0, 1, &rc);
+		skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
  		KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
  		KUNIT_EXPECT_EQ(test, skb->len, 1);
 
@@ -360,7 +360,7 @@ static void mctp_test_route_input_sk(struct kunit *test)
 
  	} else {
  		KUNIT_EXPECT_NE(test, rc, 0);
-		skb2 = skb_recv_datagram(sock->sk, 0, 1, &rc);
+		skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
  		KUNIT_EXPECT_PTR_EQ(test, skb2, NULL);
  	}
 
@@ -423,7 +423,7 @@ static void mctp_test_route_input_sk_reasm(struct kunit *test)
  		rc = mctp_route_input(&rt->rt, skb);
  	}
 
-	skb2 = skb_recv_datagram(sock->sk, 0, 1, &rc);
+	skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
 
  	if (params->rx_len) {
  		KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
@@ -582,7 +582,7 @@ static void mctp_test_route_input_sk_keys(struct kunit *test)
  	rc = mctp_route_input(&rt->rt, skb);
 
  	/* (potentially) receive message */
-	skb2 = skb_recv_datagram(sock->sk, 0, 1, &rc);
+	skb2 = skb_recv_datagram(sock->sk, MSG_DONTWAIT, &rc);
 
  	if (params->deliver)
  		KUNIT_EXPECT_NOT_ERR_OR_NULL(test, skb2);
net/netlink/af_netlink.c +1 -2
index 73e9c0a9c187..0cd91f813a3b 100644
@@ -1931,7 +1931,6 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	struct scm_cookie scm;
  	struct sock *sk = sock->sk;
  	struct netlink_sock *nlk = nlk_sk(sk);
-	int noblock = flags & MSG_DONTWAIT;
  	size_t copied;
  	struct sk_buff *skb, *data_skb;
  	int err, ret;
@@ -1941,7 +1940,7 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 
  	copied = 0;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (skb == NULL)
  		goto out;
 
net/netrom/af_netrom.c +2 -1
index fa9dc2ba3941..6f7f4392cffb 100644
@@ -1159,7 +1159,8 @@ static int nr_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	}
 
  	/* Now we can treat all alike */
-	if ((skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &er)) == NULL) {
+	skb = skb_recv_datagram(sk, flags, &er);
+	if (!skb) {
  		release_sock(sk);
  		return er;
  	}
net/nfc/llcp_sock.c +1 -2
index 4ca35791c93b..77642d18a3b4 100644
@@ -821,7 +821,6 @@ static int llcp_sock_sendmsg(struct socket *sock, struct msghdr *msg,
  static int llcp_sock_recvmsg(struct socket *sock, struct msghdr *msg,
  			     size_t len, int flags)
  {
-	int noblock = flags & MSG_DONTWAIT;
  	struct sock *sk = sock->sk;
  	unsigned int copied, rlen;
  	struct sk_buff *skb, *cskb;
@@ -842,7 +841,7 @@ static int llcp_sock_recvmsg(struct socket *sock, struct msghdr *msg,
  	if (flags & (MSG_OOB))
  		return -EOPNOTSUPP;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
  	if (!skb) {
  		pr_err("Recv datagram failed state %d %d %d",
  		       sk->sk_state, err, sock_error(sk));
net/nfc/rawsock.c +1 -2
index 0ca214ab5aef..8dd569765f96 100644
@@ -238,7 +238,6 @@ static int rawsock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
  static int rawsock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  			   int flags)
  {
-	int noblock = flags & MSG_DONTWAIT;
  	struct sock *sk = sock->sk;
  	struct sk_buff *skb;
  	int copied;
@@ -246,7 +245,7 @@ static int rawsock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 
  	pr_debug("sock=%p sk=%p len=%zu flags=%d\n", sock, sk, len, flags);
 
-	skb = skb_recv_datagram(sk, flags, noblock, &rc);
+	skb = skb_recv_datagram(sk, flags, &rc);
  	if (!skb)
  		return rc;
 
net/packet/af_packet.c +1 -1
index 002d2b9c69dd..243566129784 100644
@@ -3426,7 +3426,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
  	 *	but then it will block.
  	 */
 
-	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &err);
+	skb = skb_recv_datagram(sk, flags, &err);
 
  	/*
  	 *	An error occurred so return it. Because skb_recv_datagram()
net/phonet/datagram.c +2 -1
index 393e6aa7a592..3f2e62b63dd4 100644
@@ -123,7 +123,8 @@ static int pn_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  			MSG_CMSG_COMPAT))
  		goto out_nofree;
 
-	skb = skb_recv_datagram(sk, flags, noblock, &rval);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &rval);
  	if (skb == NULL)
  		goto out_nofree;
 
net/phonet/pep.c +4 -2
index 65d463ad8770..441a26706592 100644
@@ -772,7 +772,8 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
  	u8 pipe_handle, enabled, n_sb;
  	u8 aligned = 0;
 
-	skb = skb_recv_datagram(sk, 0, flags & O_NONBLOCK, errp);
+	skb = skb_recv_datagram(sk, (flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
+				errp);
  	if (!skb)
  		return NULL;
 
@@ -1267,7 +1268,8 @@ static int pep_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  			return -EINVAL;
  	}
 
-	skb = skb_recv_datagram(sk, flags, noblock, &err);
+	flags |= (noblock ? MSG_DONTWAIT : 0);
+	skb = skb_recv_datagram(sk, flags, &err);
  	lock_sock(sk);
  	if (skb == NULL) {
  		if (err == -ENOTCONN && sk->sk_state == TCP_CLOSE_WAIT)
net/qrtr/af_qrtr.c +1 -2
index ec2322529727..5c2fb992803b 100644
@@ -1035,8 +1035,7 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg,
  		return -EADDRNOTAVAIL;
  	}
 
-	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-				flags & MSG_DONTWAIT, &rc);
+	skb = skb_recv_datagram(sk, flags, &rc);
  	if (!skb) {
  		release_sock(sk);
  		return rc;
net/rose/af_rose.c +2 -1
index 30a1cf4c16c6..bf2d986a6bc3 100644
@@ -1230,7 +1230,8 @@ static int rose_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  		return -ENOTCONN;
 
  	/* Now we can treat all alike */
-	if ((skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &er)) == NULL)
+	skb = skb_recv_datagram(sk, flags, &er);
+	if (!skb)
  		return er;
 
  	qbit = (skb->data[0] & ROSE_Q_BIT) == ROSE_Q_BIT;
net/unix/af_unix.c +3 -2
index 4aed12e94221..6114d69b8a2d 100644
@@ -1643,7 +1643,8 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
  	 * so that no locks are necessary.
  	 */
 
-	skb = skb_recv_datagram(sk, 0, flags&O_NONBLOCK, &err);
+	skb = skb_recv_datagram(sk, (flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
+				&err);
  	if (!skb) {
  		/* This means receive shutdown. */
  		if (err == 0)
@@ -2500,7 +2501,7 @@ static int unix_read_sock(struct sock *sk, read_descriptor_t *desc,
  		int used, err;
 
  		mutex_lock(&u->iolock);
-		skb = skb_recv_datagram(sk, 0, 1, &err);
+		skb = skb_recv_datagram(sk, MSG_DONTWAIT, &err);
  		mutex_unlock(&u->iolock);
  		if (!skb)
  			return err;
net/vmw_vsock/vmci_transport.c +1 -4
index b17dc9745188..b14f0ed7427b 100644
@@ -1732,19 +1732,16 @@ static int vmci_transport_dgram_dequeue(struct vsock_sock *vsk,
  					int flags)
  {
  	int err;
-	int noblock;
  	struct vmci_datagram *dg;
  	size_t payload_len;
  	struct sk_buff *skb;
 
-	noblock = flags & MSG_DONTWAIT;
-
  	if (flags & MSG_OOB || flags & MSG_ERRQUEUE)
  		return -EOPNOTSUPP;
 
  	/* Retrieve the head sk_buff from the socket's receive queue. */
  	err = 0;
-	skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err);
+	skb = skb_recv_datagram(&vsk->sk, flags, &err);
  	if (!skb)
  		return err;
 
net/x25/af_x25.c +1 -2
index 3a171828638b..6bc2ac8d8146 100644
@@ -1315,8 +1315,7 @@ static int x25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
  	} else {
  		/* Now we can treat all alike */
  		release_sock(sk);
-		skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
-					flags & MSG_DONTWAIT, &rc);
+		skb = skb_recv_datagram(sk, flags, &rc);
  		lock_sock(sk);
  		if (!skb)
  			goto out;
#84 lore raw

Re: [PATCH 5.18 081/141] net: remove noblock parameter from skb_recv_datagram()

In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Oliver Hartkopp

Hello Greg,

as already answered to Sascha:

---

Hello Sasha,

Quoted 7 lines
Quoted 5 lines

this patch is some kind of improvement/simplification to reduce and clean up the number of variables passed through skb_recv_datagram() call.

There is no functional change and therefore no need to backport this patch IMO.

It is needed by a follow-on patch that fixes a real issue.

Ah, ok! Wasn't aware of that follow-on patch.

Sorry for the noise ;-)

Many thanks,
Oliver

author maintainer
#83 lore raw

Re: [PATCH 5.18 081/141] net: remove noblock parameter from skb_recv_datagram()

In reply to Oliver Hartkopp
Quoted 6 lines · Oliver Hartkopp

Hello Greg,

as already answered to Sascha:

---

Quoted 7 lines

Hello Sasha,

this patch is some kind of improvement/simplification to reduce and clean up the number of variables passed through skb_recv_datagram() call.

There is no functional change and therefore no need to backport this patch IMO.

It is needed by a follow-on patch that fixes a real issue.

thanks,

greg k-h

author maintainer
#85 lore raw

Re: [PATCH 5.18 081/141] net: remove noblock parameter from skb_recv_datagram()

In reply to Oliver Hartkopp
Quoted 15 lines · Oliver Hartkopp
Quoted 12 lines · Greg Kroah-Hartman
Quoted 11 lines · Oliver Hartkopp

Hello Greg,

as already answered to Sascha:

---

Hello Sasha,

this patch is some kind of improvement/simplification to reduce and clean up the number of variables passed through skb_recv_datagram() call.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

There is no functional change and therefore no need to backport this patch IMO.

It is needed by a follow-on patch that fixes a real issue.

Ah, ok! Wasn't aware of that follow-on patch.

Sorry for the noise ;-)

Not noise at all, thanks for the review,that's always appreciated.

greg k-h

Tested-by on the v1 series
#146 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Tested rc1 against the Fedora build system (aarch64, armv7, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.

Tested-by on the v1 series
#148 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BCMSTB using 32-bit and 64-bit ARM kernels:

Signature · 1 line
Florian
Tested-by on the v1 series
#149 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

5.18.6-rc1 Successfully Compiled and booted on my Raspberry PI 4b (8g) (bcm2711)

Tested-by on the v1 series
#150 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Built and booted successfully on RISC-V RV64 (HiFive Unmatched).

Tested-by on the v1 series
#151 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

Build results:

	total: 154 pass: 154 fail: 0
Qemu test results:
	total: 489 pass: 489 fail: 0

Guenter

Tested-by on the v1 series
#152 lore raw
In reply to Greg Kroah-Hartman

Hi Greg,

Quoted 7 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

Build test (gcc version 11.3.1 20220612):
mips: 59 configs -> no failure
arm: 99 configs -> no failure
arm64: 3 configs -> no failure
x86_64: 4 configs -> no failure alpha allmodconfig -> no failure csky allmodconfig -> no failure powerpc allmodconfig -> no failure riscv allmodconfig -> no failure s390 allmodconfig -> no failure xtensa allmodconfig -> no failure

Boot test:
x86_64: Booted on my test laptop. No regression.
x86_64: Booted on qemu. No regression. [1]
mips: Booted on ci20 board. No regression. [2]

[1]. https://openqa.qa.codethink.co.uk/tests/1363
[2]. https://openqa.qa.codethink.co.uk/tests/1368

--
Regards
Sudip

Tested-by on the v1 series
#153 lore raw
In reply to Greg Kroah-Hartman
Quoted 5 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Successfully cross-compiled for arm (multi_v7_defconfig, GCC 12.1.0, armv7 with neon FPU) and arm64 (bcm2711_defconfig, GCC 12.1.0).

Signature · 1 line
An old man doll... just what I always wanted! - Clara
maintainer Tested-by on the v1 series
#154 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.18:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    130 tests:	130 pass, 0 fail

Linux version: 5.18.6-rc1-g1cf3647a86ad
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Jon

Tested-by on the v1 series
#155 lore raw
In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

Hi Greg,

5.18.6-rc1 tested.

Run tested on:
- Allwinner H6 (Tanix TX6)
- Intel Tiger Lake x86_64 (nuc11 i7-1165G7)

In addition - build tested for:
- Allwinner A64
- Allwinner H3
- Allwinner H5
- NXP iMX6
- NXP iMX8
- Qualcomm Dragonboard
- Rockchip RK3288
- Rockchip RK3328
- Rockchip RK3399pro
- Samsung Exynos

--
Rudi

Tested-by Linux Kernel Functional Testing on the v1 series
#156 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

## Build
* kernel: 5.18.6-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.18.y
* git commit: 1cf3647a86ad5204a01c7495a62a13d07f02d51c
* git describe: v5.18.5-142-g1cf3647a86ad
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.18.y/build/v5.18.5-142-g1cf3647a86ad

## Test Regressions (compared to v5.18-48-g10e6e3d47333) No test regressions found.

## Metric Regressions (compared to v5.18-48-g10e6e3d47333) No metric regressions found.

## Test Fixes (compared to v5.18-48-g10e6e3d47333) No test fixes found.

## Metric Fixes (compared to v5.18-48-g10e6e3d47333) No metric fixes found.

## Test result summary
total: 123299, pass: 111561, fail: 547, skip: 10306, xfail: 885

## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 319 total, 316 passed, 3 failed
* arm64: 64 total, 62 passed, 2 failed
* i386: 57 total, 50 passed, 7 failed
* mips: 41 total, 38 passed, 3 failed
* parisc: 14 total, 14 passed, 0 failed
* powerpc: 65 total, 56 passed, 9 failed
* riscv: 32 total, 27 passed, 5 failed
* s390: 23 total, 20 passed, 3 failed
* sh: 26 total, 24 passed, 2 failed
* sparc: 14 total, 14 passed, 0 failed
* x86_64: 62 total, 58 passed, 4 failed

## Test suites summary
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-gpio
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-lib
* kselftest-membarrier
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-zram
* kunit
* kunit/15
* kunit/261
* kunit/3
* kunit/427
* kunit/90
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-cap_bounds-tests
* ltp-commands
* ltp-commands-tests
* ltp-containers
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests
* ltp-fcntl-locktests-tests
* ltp-filecaps
* ltp-filecaps-tests
* ltp-fs
* ltp-fs-tests
* ltp-fs_bind
* ltp-fs_bind-tests
* ltp-fs_perms_simple
* ltp-fs_perms_simple-tests
* ltp-fsx
* ltp-fsx-tests
* ltp-hugetlb
* ltp-hugetlb-tests
* ltp-io
* ltp-io-tests
* ltp-ipc
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty
* ltp-pty-tests
* ltp-sched
* ltp-sched-tests
* ltp-securebits
* ltp-securebits-tests
* ltp-smoke
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* perf/Zstd-perf.data-compression
* rcutorture
* ssuite
* v4l2-compliance
* vdso

--
Linaro LKFT
https://lkft.linaro.org

reviewer Tested-by on the v1 series
#157 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

Tested-by on the v1 series
#158 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.6 release. There are 141 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Wed, 22 Jun 2022 12:47:02 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.6-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Hi Greg,

Compiled and booted on my test system Lenovo P50s: Intel Core i7 No emergency and critical messages in the dmesg

./perf bench sched all
# Running sched/messaging benchmark...
# 20 sender and receiver processes per group
# 10 groups == 400 processes run

     Total time: 0.449 [sec]

# Running sched/pipe benchmark...
# Executed 1000000 pipe operations between two processes

     Total time: 10.870 [sec]

      10.870600 usecs/op
          91991 ops/sec

Thanks
-Zan