linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: David Miller <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: Cong Wang <cong.wang@bytedance.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the net-next tree with the bpf tree
Date: Tue, 22 Jun 2021 11:06:22 +1000	[thread overview]
Message-ID: <20210622110622.25f9f026@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4798 bytes --]

Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  net/ipv4/tcp_bpf.c
  net/ipv4/udp_bpf.c
  include/linux/skmsg.h
  net/core/skmsg.c

between commit:

  9f2470fbc4cb ("skmsg: Improve udp_bpf_recvmsg() accuracy")

from the bpf tree and commit:

  c49661aa6f70 ("skmsg: Remove unused parameters of sk_msg_wait_data()")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/skmsg.h
index e3d080c299f6,fcaa9a7996c8..000000000000
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
diff --cc net/core/skmsg.c
index 9b6160a191f8,f0b9decdf279..000000000000
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
diff --cc net/ipv4/tcp_bpf.c
index bb49b52d7be8,a80de92ea3b6..000000000000
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@@ -163,28 -163,6 +163,28 @@@ static bool tcp_bpf_stream_read(const s
  	return !empty;
  }
  
- static int tcp_msg_wait_data(struct sock *sk, struct sk_psock *psock, int flags,
- 			     long timeo, int *err)
++static int tcp_msg_wait_data(struct sock *sk, struct sk_psock *psock,
++			     long timeo)
 +{
 +	DEFINE_WAIT_FUNC(wait, woken_wake_function);
 +	int ret = 0;
 +
 +	if (sk->sk_shutdown & RCV_SHUTDOWN)
 +		return 1;
 +
 +	if (!timeo)
 +		return ret;
 +
 +	add_wait_queue(sk_sleep(sk), &wait);
 +	sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk);
 +	ret = sk_wait_event(sk, &timeo,
 +			    !list_empty(&psock->ingress_msg) ||
 +			    !skb_queue_empty(&sk->sk_receive_queue), &wait);
 +	sk_clear_bit(SOCKWQ_ASYNC_WAITDATA, sk);
 +	remove_wait_queue(sk_sleep(sk), &wait);
 +	return ret;
 +}
 +
  static int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  		    int nonblock, int flags, int *addr_len)
  {
@@@ -206,11 -184,11 +206,11 @@@
  msg_bytes_ready:
  	copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
  	if (!copied) {
- 		int data, err = 0;
  		long timeo;
+ 		int data;
  
  		timeo = sock_rcvtimeo(sk, nonblock);
- 		data = tcp_msg_wait_data(sk, psock, flags, timeo, &err);
 -		data = sk_msg_wait_data(sk, psock, timeo);
++		data = tcp_msg_wait_data(sk, psock, timeo);
  		if (data) {
  			if (!sk_psock_queue_empty(psock))
  				goto msg_bytes_ready;
diff --cc net/ipv4/udp_bpf.c
index 565a70040c57,b07e4b6dda25..000000000000
--- a/net/ipv4/udp_bpf.c
+++ b/net/ipv4/udp_bpf.c
@@@ -21,45 -21,6 +21,45 @@@ static int sk_udp_recvmsg(struct sock *
  	return udp_prot.recvmsg(sk, msg, len, noblock, flags, addr_len);
  }
  
 +static bool udp_sk_has_data(struct sock *sk)
 +{
 +	return !skb_queue_empty(&udp_sk(sk)->reader_queue) ||
 +	       !skb_queue_empty(&sk->sk_receive_queue);
 +}
 +
 +static bool psock_has_data(struct sk_psock *psock)
 +{
 +	return !skb_queue_empty(&psock->ingress_skb) ||
 +	       !sk_psock_queue_empty(psock);
 +}
 +
 +#define udp_msg_has_data(__sk, __psock)	\
 +		({ udp_sk_has_data(__sk) || psock_has_data(__psock); })
 +
- static int udp_msg_wait_data(struct sock *sk, struct sk_psock *psock, int flags,
- 			     long timeo, int *err)
++static int udp_msg_wait_data(struct sock *sk, struct sk_psock *psock,
++			     long timeo)
 +{
 +	DEFINE_WAIT_FUNC(wait, woken_wake_function);
 +	int ret = 0;
 +
 +	if (sk->sk_shutdown & RCV_SHUTDOWN)
 +		return 1;
 +
 +	if (!timeo)
 +		return ret;
 +
 +	add_wait_queue(sk_sleep(sk), &wait);
 +	sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk);
 +	ret = udp_msg_has_data(sk, psock);
 +	if (!ret) {
 +		wait_woken(&wait, TASK_INTERRUPTIBLE, timeo);
 +		ret = udp_msg_has_data(sk, psock);
 +	}
 +	sk_clear_bit(SOCKWQ_ASYNC_WAITDATA, sk);
 +	remove_wait_queue(sk_sleep(sk), &wait);
 +	return ret;
 +}
 +
  static int udp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
  			   int nonblock, int flags, int *addr_len)
  {
@@@ -81,13 -43,13 +81,13 @@@
  msg_bytes_ready:
  	copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
  	if (!copied) {
- 		int data, err = 0;
  		long timeo;
+ 		int data;
  
  		timeo = sock_rcvtimeo(sk, nonblock);
- 		data = udp_msg_wait_data(sk, psock, flags, timeo, &err);
 -		data = sk_msg_wait_data(sk, psock, timeo);
++		data = udp_msg_wait_data(sk, psock, timeo);
  		if (data) {
 -			if (!sk_psock_queue_empty(psock))
 +			if (psock_has_data(psock))
  				goto msg_bytes_ready;
  			ret = sk_udp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
  			goto out;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2021-06-22  1:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  1:06 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-08  3:11 Stephen Rothwell
2021-04-08  3:02 Stephen Rothwell
2021-03-29  1:29 Stephen Rothwell
2021-03-29  8:28 ` Jiri Olsa
2020-07-16  1:59 Stephen Rothwell
2020-05-26  3:12 Stephen Rothwell
2020-05-26  5:45 ` Björn Töpel
2019-06-06  1:34 Stephen Rothwell
2019-02-20  0:37 Stephen Rothwell
2019-02-20  0:41 ` Alexei Starovoitov
2019-02-20  0:45   ` Stanislav Fomichev
2019-02-20  1:03     ` Stephen Rothwell
2019-02-20  0:48   ` Daniel Borkmann
2019-02-20  3:03     ` Stanislav Fomichev
2018-12-14  0:56 Stephen Rothwell
2018-12-03  2:16 Stephen Rothwell
2018-12-03  2:03 Stephen Rothwell
2018-08-01  1:35 Stephen Rothwell
2018-08-01  4:23 ` Yonghong Song
2018-07-26  1:19 Stephen Rothwell
2018-07-26 15:32 ` Martin KaFai Lau
2018-01-09  0:21 Stephen Rothwell
2018-01-09  0:29 ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210622110622.25f9f026@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=ast@kernel.org \
    --cc=cong.wang@bytedance.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: linux-next: manual merge of the net-next tree with the bpf tree' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox