Skip to contentSkip to conversation

xsk: align xdp socket batch size with dpdk

PATCH Applied Li RongQing 3 participants 3 messages Apr 14, 2021 – Apr 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xsk: align xdp socket batch size with dpdk

DPDK default burst size is 32, however, kernel xsk sendto syscall can not handle all 32 at one time, and return with error.

So make kernel xdp socket batch size larger to avoid unnecessary syscall fail and context switch which will help increase performance.

---
 net/xdp/xsk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/xdp/xsk.c +1 -1
index a71ed66..cd62d4b 100644
@@ -30,7 +30,7 @@
 #include "xdp_umem.h"
 #include "xsk.h"
 
-#define TX_BATCH_SIZE 16
+#define TX_BATCH_SIZE 32
 
 static DEFINE_PER_CPU(struct list_head, xskmap_flush_list);
 
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Li RongQing

DPDK default burst size is 32, however, kernel xsk sendto syscall can not handle all 32 at one time, and return with error.

So make kernel xdp socket batch size larger to avoid unnecessary syscall fail and context switch which will help increase performance.

My apologies for the delay RongQing. I forgot to ack this for some reason. Your suggestion makes sense and will improve performance in other cases too. Thank you.

Quoted 21 lines
---
 net/xdp/xsk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/xdp/xsk.c +1 -2
index a71ed66..cd62d4b 100644
@@ -30,7 +30,7 @@
 #include "xdp_umem.h"
 #include "xsk.h"
 
-#define TX_BATCH_SIZE 16
+#define TX_BATCH_SIZE 32
 
 static DEFINE_PER_CPU(struct list_head, xskmap_flush_list);
 
--

1.7.1

#2 lore raw
In reply to Li RongQing
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

Quoted 9 lines · On Wed, 14 Apr 2021 13:39:12 +0800 you wrote:

DPDK default burst size is 32, however, kernel xsk sendto syscall can not handle all 32 at one time, and return with error.

So make kernel xdp socket batch size larger to avoid unnecessary syscall fail and context switch which will help increase performance.

[...]

Here is the summary with links:
- xsk: align xdp socket batch size with dpdk

    https://git.kernel.org/bpf/bpf-next/c/e7a1c1300891

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html