Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 228e548e authored by Anton Blanchard's avatar Anton Blanchard Committed by David S. Miller
Browse files

net: Add sendmmsg socket system call

This patch adds a multiple message send syscall and is the send
version of the existing recvmmsg syscall. This is heavily
based on the patch by Arnaldo that added recvmmsg.

I wrote a microbenchmark to test the performance gains of using
this new syscall:

http://ozlabs.org/~anton/junkcode/sendmmsg_test.c



The test was run on a ppc64 box with a 10 Gbit network card. The
benchmark can send both UDP and RAW ethernet packets.

64B UDP

batch   pkts/sec
1       804570
2       872800 (+ 8 %)
4       916556 (+14 %)
8       939712 (+17 %)
16      952688 (+18 %)
32      956448 (+19 %)
64      964800 (+20 %)

64B raw socket

batch   pkts/sec
1       1201449
2       1350028 (+12 %)
4       1461416 (+22 %)
8       1513080 (+26 %)
16      1541216 (+28 %)
32      1553440 (+29 %)
64      1557888 (+30 %)

We see a 20% improvement in throughput on UDP send and 30%
on raw socket send.

[ Add sparc syscall entries. -DaveM ]

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c5cae81
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -352,3 +352,4 @@ SYSCALL_SPU(name_to_handle_at)
COMPAT_SYS_SPU(open_by_handle_at)
COMPAT_SYS_SPU(clock_adjtime)
SYSCALL_SPU(syncfs)
COMPAT_SYS_SPU(sendmmsg)
+2 −1
Original line number Diff line number Diff line
@@ -371,10 +371,11 @@
#define __NR_open_by_handle_at	346
#define __NR_clock_adjtime	347
#define __NR_syncfs		348
#define __NR_sendmmsg		349

#ifdef __KERNEL__

#define __NR_syscalls		349
#define __NR_syscalls		350

#define __NR__exit __NR_exit
#define NR_syscalls	__NR_syscalls
+2 −1
Original line number Diff line number Diff line
@@ -404,8 +404,9 @@
#define __NR_open_by_handle_at	333
#define __NR_clock_adjtime	334
#define __NR_syncfs		335
#define __NR_sendmmsg		336

#define NR_syscalls		336
#define NR_syscalls		337

#ifdef __32bit_syscall_numbers__
/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
+1 −1
Original line number Diff line number Diff line
@@ -84,4 +84,4 @@ sys_call_table:
/*320*/	.long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
/*325*/	.long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
/*330*/	.long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
/*335*/	.long sys_syncfs
/*335*/	.long sys_syncfs, sys_sendmmsg
+2 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ sys_call_table32:
/*320*/	.word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv
	.word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init
/*330*/	.word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
	.word sys_syncfs
	.word sys_syncfs, compat_sys_sendmmsg

#endif /* CONFIG_COMPAT */

@@ -162,4 +162,4 @@ sys_call_table:
/*320*/	.word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
	.word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init
/*330*/	.word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
	.word sys_syncfs
	.word sys_syncfs, sys_sendmmsg
Loading