diff mbox series

xsk: align xdp socket batch size with dpdk

Message ID 1618378752-4191-1-git-send-email-lirongqing@baidu.com (mailing list archive)
State Accepted
Commit e7a1c1300891d8f11d05b42665e299cc22a4b383
Delegated to: BPF
Headers show
Series xsk: align xdp socket batch size with dpdk | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 14 maintainers not CCed: netdev@vger.kernel.org jonathan.lemon@gmail.com yhs@fb.com kpsingh@kernel.org kafai@fb.com john.fastabend@gmail.com davem@davemloft.net kuba@kernel.org hawk@kernel.org daniel@iogearbox.net andrii@kernel.org ast@kernel.org bjorn@kernel.org songliubraving@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/header_inline success Link

Commit Message

Li RongQing April 14, 2021, 5:39 a.m. UTC
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.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/xdp/xsk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Magnus Karlsson April 23, 2021, 4:51 a.m. UTC | #1
On Wed, Apr 14, 2021 at 2:39 PM Li RongQing <lirongqing@baidu.com> 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.

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.

Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>

> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  net/xdp/xsk.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
> index a71ed66..cd62d4b 100644
> --- a/net/xdp/xsk.c
> +++ b/net/xdp/xsk.c
> @@ -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
>
patchwork-bot+netdevbpf@kernel.org April 23, 2021, 8 a.m. UTC | #2
Hello:

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

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
diff mbox series

Patch

diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index a71ed66..cd62d4b 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -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);