public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring
@ 2020-12-16 18:03 Victor Stewart
  2020-12-16 18:03 ` Victor Stewart
  0 siblings, 1 reply; 5+ messages in thread
From: Victor Stewart @ 2020-12-16 18:03 UTC (permalink / raw)
  To: io-uring, soheil, netdev

This patch adds PROTO_CMSG_DATA_ONLY to inet_dgram_ops and inet6_dgram_ops so that UDP_SEGMENT (GSO) and UDP_GRO can be used through io_uring.

GSO and GRO are vital to bring QUIC servers on par with TCP throughputs, and together offer a higher
throughput gain than io_uring alone (rate of data transit
considering), thus io_uring is presently the lesser performance choice.

RE http://vger.kernel.org/lpc_net2018_talks/willemdebruijn-lpc2018-udpgso-paper-DRAFT-1.pdf,
GSO is about +~63% and GRO +~82%.

this patch closes that loophole. 

net/ipv4/af_inet.c  | 1 +
net/ipv6/af_inet6.c | 1 +
net/socket.c        | 8 +++++---
3 files changed, 7 insertions(+), 3 deletions(-)



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

* [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring
  2020-12-16 18:03 [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring Victor Stewart
@ 2020-12-16 18:03 ` Victor Stewart
  2020-12-16 23:12   ` kernel test robot
  0 siblings, 1 reply; 5+ messages in thread
From: Victor Stewart @ 2020-12-16 18:03 UTC (permalink / raw)
  To: io-uring, soheil, netdev; +Cc: Victor Stewart

Signed-off-by: Victor Stewart <[email protected]>
---
 net/ipv4/af_inet.c  | 1 +
 net/ipv6/af_inet6.c | 1 +
 net/socket.c        | 8 +++++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b7260c8cef2e..c9fd5e7cfd6e 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1052,6 +1052,7 @@ EXPORT_SYMBOL(inet_stream_ops);
 
 const struct proto_ops inet_dgram_ops = {
 	.family		   = PF_INET,
+	.flags		   = PROTO_CMSG_DATA_ONLY,
 	.owner		   = THIS_MODULE,
 	.release	   = inet_release,
 	.bind		   = inet_bind,
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e648fbebb167..560f45009d06 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -695,6 +695,7 @@ const struct proto_ops inet6_stream_ops = {
 
 const struct proto_ops inet6_dgram_ops = {
 	.family		   = PF_INET6,
+	.flags		   = PROTO_CMSG_DATA_ONLY,
 	.owner		   = THIS_MODULE,
 	.release	   = inet6_release,
 	.bind		   = inet6_bind,
diff --git a/net/socket.c b/net/socket.c
index 6e6cccc2104f..6995835d6355 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2416,9 +2416,11 @@ static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg,
 long __sys_sendmsg_sock(struct socket *sock, struct msghdr *msg,
 			unsigned int flags)
 {
-	/* disallow ancillary data requests from this path */
-	if (msg->msg_control || msg->msg_controllen)
-		return -EINVAL;
+	if (msg->msg_control || msg->msg_controllen) {
+		/* disallow ancillary data reqs unless cmsg is plain data */
+		if (!(sock->ops->flags & PROTO_CMSG_DATA_ONLY))
+			return -EINVAL;
+	}
 
 	return ____sys_sendmsg(sock, msg, flags, NULL, 0);
 }
-- 
2.26.2


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

* Re: [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring
  2020-12-16 18:03 ` Victor Stewart
@ 2020-12-16 23:12   ` kernel test robot
  2020-12-16 23:29     ` Victor Stewart
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2020-12-16 23:12 UTC (permalink / raw)
  To: Victor Stewart, io-uring, soheil, netdev
  Cc: kbuild-all, clang-built-linux, Victor Stewart

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

Hi Victor,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Victor-Stewart/udp-allow-UDP-cmsghdrs-through-io_uring/20201217-020451
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 3db1a3fa98808aa90f95ec3e0fa2fc7abf28f5c9
config: riscv-randconfig-r031-20201216 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 71601d2ac9954cb59c443cb3ae442cb106df35d4)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/6cce2a0155c3ee2a1550cb3d5e434cc85f055a60
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Victor-Stewart/udp-allow-UDP-cmsghdrs-through-io_uring/20201217-020451
        git checkout 6cce2a0155c3ee2a1550cb3d5e434cc85f055a60
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

   /tmp/leds-blinkm-655475.s: Assembler messages:
>> /tmp/leds-blinkm-655475.s:590: Error: unrecognized opcode `zext.b s7,a0'
>> /tmp/leds-blinkm-655475.s:614: Error: unrecognized opcode `zext.b a0,a0'
>> /tmp/leds-blinkm-655475.s:667: Error: unrecognized opcode `zext.b a2,s2'
   /tmp/leds-blinkm-655475.s:750: Error: unrecognized opcode `zext.b a2,s2'
   /tmp/leds-blinkm-655475.s:833: Error: unrecognized opcode `zext.b a2,s2'
   clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32876 bytes --]

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

* Re: [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring
  2020-12-16 23:12   ` kernel test robot
@ 2020-12-16 23:29     ` Victor Stewart
  2020-12-17 15:50       ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Victor Stewart @ 2020-12-16 23:29 UTC (permalink / raw)
  To: io-uring, Soheil Hassas Yeganeh, netdev, Jann Horn

what's to be done about this kernel test robot output, if anything?

On Wed, Dec 16, 2020 at 11:12 PM kernel test robot <[email protected]> wrote:
>
> Hi Victor,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on net-next/master]
>
> url:    https://github.com/0day-ci/linux/commits/Victor-Stewart/udp-allow-UDP-cmsghdrs-through-io_uring/20201217-020451
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 3db1a3fa98808aa90f95ec3e0fa2fc7abf28f5c9
> config: riscv-randconfig-r031-20201216 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 71601d2ac9954cb59c443cb3ae442cb106df35d4)
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install riscv cross compiling tool for clang build
>         # apt-get install binutils-riscv64-linux-gnu
>         # https://github.com/0day-ci/linux/commit/6cce2a0155c3ee2a1550cb3d5e434cc85f055a60
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Victor-Stewart/udp-allow-UDP-cmsghdrs-through-io_uring/20201217-020451
>         git checkout 6cce2a0155c3ee2a1550cb3d5e434cc85f055a60
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
>    /tmp/leds-blinkm-655475.s: Assembler messages:
> >> /tmp/leds-blinkm-655475.s:590: Error: unrecognized opcode `zext.b s7,a0'
> >> /tmp/leds-blinkm-655475.s:614: Error: unrecognized opcode `zext.b a0,a0'
> >> /tmp/leds-blinkm-655475.s:667: Error: unrecognized opcode `zext.b a2,s2'
>    /tmp/leds-blinkm-655475.s:750: Error: unrecognized opcode `zext.b a2,s2'
>    /tmp/leds-blinkm-655475.s:833: Error: unrecognized opcode `zext.b a2,s2'
>    clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]

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

* Re: [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring
  2020-12-16 23:29     ` Victor Stewart
@ 2020-12-17 15:50       ` Jens Axboe
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2020-12-17 15:50 UTC (permalink / raw)
  To: Victor Stewart, io-uring, Soheil Hassas Yeganeh, netdev,
	Jann Horn

On 12/16/20 4:29 PM, Victor Stewart wrote:
> what's to be done about this kernel test robot output, if anything?

Nothing I think, doesn't look related to your change at all.

-- 
Jens Axboe


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

end of thread, other threads:[~2020-12-17 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-16 18:03 [PATCH net-next v4] udp:allow UDP cmsghdrs through io_uring Victor Stewart
2020-12-16 18:03 ` Victor Stewart
2020-12-16 23:12   ` kernel test robot
2020-12-16 23:29     ` Victor Stewart
2020-12-17 15:50       ` Jens Axboe

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