|
|
Log in / Subscribe / Register

Optimize BPF tailcall for LoongArch

From:  Tiezhu Yang <yangtiezhu-AT-loongson.cn>
To:  Huacai Chen <chenhuacai-AT-kernel.org>, Hengqi Chen <hengqi.chen-AT-gmail.com>
Subject:  [PATCH v2 0/4] Optimize BPF tailcall for LoongArch
Date:  Mon, 06 Jul 2026 11:39:02 +0800
Message-ID:  <20260706033906.1988-1-yangtiezhu@loongson.cn>
Cc:  loongarch-AT-lists.linux.dev, bpf-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

Based on 7.2-rc1, tested on a Loongson-3A6000 physical machine.

This version addresses the review comments of AI, changes are isolated
to patch 3/4, the rest of the series remains unchanged.

v1 -> v2:
- [Patch 3/4] Use ctx->image to inject a safe dummy offset during
  Pass 1, safely bypassing the 16-bit signed immediate range check.
- [Patch 3/4] Update the commit message to reflect the new code.

Here are the test results:

  $ sudo modprobe test_bpf test_suite=test_tail_calls
  $ dmesg -t | tail -1
  test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed]

  $ sudo ./test_progs -t tailcalls | tail -1
  Summary: 1/37 PASSED, 0 SKIPPED, 0 FAILED

Tiezhu Yang (4):
  LoongArch: BPF: Optimize redundant TCC loads in epilogue
  LoongArch: BPF: Move arena register slot below TCC context
  LoongArch: BPF: Refactor jump offset calculation in tail call
  LoongArch: BPF: Implement branchless conditional move for TCC

 arch/loongarch/include/asm/inst.h |   6 ++
 arch/loongarch/net/bpf_jit.c      | 112 +++++++++++++++---------------
 2 files changed, 63 insertions(+), 55 deletions(-)

-- 
2.42.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds