Re: [PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-16 Thread Jianlin Lv
On Thu, Apr 15, 2021 at 10:38 PM Daniel Borkmann wrote: > > On 4/15/21 11:32 AM, Jianlin Lv wrote: > > For debugging JITs, dumping the JITed image to kernel log is discouraged, > > "bpftool prog dump jited" is much better way to examine JITed dumps. > > This pa

[PATCH bpf-next 2/2] docs: bpf: bpf_jit_enable mode changed

2021-04-15 Thread Jianlin Lv
Remove information about bpf_jit_enable=2 mode and added description for how to use the bpf_jit_disasm tool after get rid of =2 mode. Signed-off-by: Jianlin Lv --- Documentation/admin-guide/sysctl/net.rst | 1 - Documentation/networking/filter.rst | 25 ++-- 2 files

[PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-15 Thread Jianlin Lv
to explain how to use bpf_jit_disasm tool after this change. Signed-off-by: Jianlin Lv --- arch/arm/net/bpf_jit_32.c | 4 arch/arm64/net/bpf_jit_comp.c | 4 arch/mips/net/bpf_jit.c | 4 arch/mips/net/ebpf_jit.c | 4 arch/powerpc/net/bpf_

Re: [PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-31 Thread Jianlin Lv
On Wed, Mar 31, 2021 at 5:28 PM Will Deacon wrote: > > On Wed, Mar 31, 2021 at 05:22:18PM +0800, Jianlin Lv wrote: > > On Tue, Mar 30, 2021 at 5:31 PM Will Deacon wrote: > > > > > > On Tue, Mar 30, 2021 at 03:42:35PM +0800, Jianlin Lv wrote: > > > > A64_

Re: [PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-31 Thread Jianlin Lv
On Tue, Mar 30, 2021 at 5:31 PM Will Deacon wrote: > > On Tue, Mar 30, 2021 at 03:42:35PM +0800, Jianlin Lv wrote: > > A64_MOV is currently mapped to Add Instruction. Architecturally MOV > > (register) is an alias of ORR (shifted register) and MOV (to or from SP) > > is an

[PATCH bpf-next] bpf: arm64: Redefine MOV consistent with arch insn

2021-03-30 Thread Jianlin Lv
... 14: mov x25, sp f9 03 00 91 ... 24: mov x19, x0 f3 03 00 aa ... 8c: mov x0, x7 e0 03 07 aa Signed-off-by: Jianlin Lv --- arch/arm64/net/bpf_jit.h | 7 +-- arch/arm64/net/bpf_jit_comp.c | 4 ++-- 2 files changed, 7 insert

Re: [PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-27 Thread Jianlin Lv
On Sat, Mar 27, 2021 at 11:19 PM Alexei Starovoitov wrote: > > On Sat, Mar 27, 2021 at 1:19 AM Jianlin Lv wrote: > > > > > On Fri, Mar 26, 2021 at 5:40 AM Jianlin Lv wrote: > > > > > > > > When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of

RE: [PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-27 Thread Jianlin Lv
> -Original Message- > From: Alexei Starovoitov > Sent: Friday, March 26, 2021 10:25 PM > To: Jianlin Lv > Cc: bpf ; David S. Miller ; > Jakub Kicinski ; Alexei Starovoitov ; > Daniel Borkmann ; Andrii Nakryiko > ; Martin KaFai Lau ; Song Liu > ; Yonghong S

[PATCH bpf-next] bpf: trace jit code when enable BPF_JIT_ALWAYS_ON

2021-03-26 Thread Jianlin Lv
When CONFIG_BPF_JIT_ALWAYS_ON is enabled, the value of bpf_jit_enable in /proc/sys is limited to SYSCTL_ONE. This is not convenient for debugging. This patch modifies the value of extra2 (max) to 2 that support developers to emit traces on kernel log. Signed-off-by: Jianlin Lv --- net/core

Re: [PATCH bpf-next v2] bpf: Simplify expression for identify bpf mem type

2021-03-18 Thread Jianlin Lv
On Thu, Mar 18, 2021 at 11:58 PM Daniel Borkmann wrote: > > On 3/18/21 7:36 AM, Jianlin Lv wrote: > > Added BPF_LD_ST_SIZE_MASK macro as mask of size modifier that help to > > reduce the evaluation of expressions in if statements, > > and remove BPF_SIZE_MASK in netronom

[PATCH bpf-next v2] bpf: Simplify expression for identify bpf mem type

2021-03-17 Thread Jianlin Lv
Added BPF_LD_ST_SIZE_MASK macro as mask of size modifier that help to reduce the evaluation of expressions in if statements, and remove BPF_SIZE_MASK in netronome driver. Signed-off-by: Jianlin Lv --- v2: Move the bpf_LD_ST_SIZE_MASK macro definition to include/linux/bpf.h --- drivers/net

[PATCH bpf-next] bpf: Remove insn_buf[] declaration in inner block

2021-03-17 Thread Jianlin Lv
Two insn_buf[16] variables are declared in the function, which act on function scope and block scope respectively. The statement in the inner blocks is redundant, so remove it. Signed-off-by: Jianlin Lv --- kernel/bpf/verifier.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/bpf

[PATCH bpf-next] bpf: Simplify expression for identify bpf mem type

2021-03-17 Thread Jianlin Lv
Added BPF_SIZE_MASK macro as mask of size modifier that help to reduce the evaluation of expressions in if statements, and remove BPF_SIZE_MASK in netronome driver. Signed-off-by: Jianlin Lv --- drivers/net/ethernet/netronome/nfp/bpf/main.h | 2 -- include/uapi/linux/bpf.h

[PATCH net-next v2] bonding: Added -ENODEV interpret for slaves option

2021-03-14 Thread Jianlin Lv
When the incorrect interface name is stored in the slaves/active_slave option of the bonding sysfs, the kernel does not record the log that interface does not exist. This patch adds a log for -ENODEV error, which will facilitate users to figure out such issue. Signed-off-by: Jianlin Lv --- v2

[PATCH net-next] bonding: Added -ENODEV interpret for slaves option

2021-03-13 Thread Jianlin Lv
After upgrading the kernel, the slave interface name is changed, Systemd cannot use the original configuration to create bond interface, thereby losing the connection with the host. Adding log for ENODEV will make it easier to find out such problem lies. Signed-off-by: Jianlin Lv --- drivers

[PATCH net-next] net: Remove unnecessary intermediate variables

2020-08-21 Thread Jianlin Lv
It is not necessary to use src/dst as an intermediate variable for assignment operation; Delete src/dst intermediate variables to avoid unnecessary variable declarations. Signed-off-by: Jianlin Lv --- drivers/net/vxlan.c | 16 1 file changed, 4 insertions(+), 12 deletions

[PATCH net-next] net: remove redundant variable in vxlan_xmit_one

2020-08-20 Thread Jianlin Lv
: Jianlin Lv --- drivers/net/vxlan.c | 40 +++- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b9fefe27e3e8..679260e1d9f1 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2597,7 +2597,6

[PATCH bpf-next] docs: correct subject prefix and update LLVM info

2020-08-20 Thread Jianlin Lv
bpf_devel_QA.rst:152 The subject prefix information is not accurate, it should be 'PATCH bpf-next v2' Also update LLVM version info and add information about ‘-DLLVM_TARGETS_TO_BUILD’ to prompt the developer to build the desired target. Signed-off-by: Jianlin Lv --- Documen

[PATCH bpf-next] bpf: fix load XDP program error in test_xdp_vlan

2020-08-12 Thread Jianlin Lv
XDP program already attached. ip will throw an error in case a XDP program is already attached to the networking interface, to prevent it from being overridden by accident. In order to replace the currently running XDP program with a new one, the -force option must be used. Signed-off-by: Jianlin Lv

[PATCH bpf-next v2] bpf: fix segmentation fault of test_progs

2020-08-10 Thread Jianlin Lv
4 pages of anonymous mapping,then do all the mmap() with MAP_FIXED. Another issue is that when unmap the second page fails, the length parameter to delete tmp1 mappings should be 4*page_size. Signed-off-by: Jianlin Lv --- v2: - Update commit messages - Create 4 pages of anonymous mapping that

[PATCH bpf-next] bpf: fix segmentation fault of test_progs

2020-08-07 Thread Jianlin Lv
unmap the second page fails, the length parameter to delete tmp1 mappings should be 3*page_size. Signed-off-by: Jianlin Lv --- tools/testing/selftests/bpf/prog_tests/mmap.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mmap.c b

[PATCH bpf-next v2] bpf: fix compilation warning of selftests

2020-08-06 Thread Jianlin Lv
e. Signed-off-by: Jianlin Lv --- v2: - replease CHECK_FAIL by CHECK - fix test_tcpnotify_user failed issue --- .../selftests/bpf/prog_tests/send_signal.c | 18 -- .../bpf/prog_tests/stacktrace_build_id_nmi.c | 4 +++- .../selftests/bpf/test_tcpnotify_user.c| 13 ++

[PATCH bpf-next] bpf: fix compilation warning of selftests

2020-07-30 Thread Jianlin Lv
e. Signed-off-by: Jianlin Lv --- .../selftests/bpf/prog_tests/send_signal.c| 37 ++- .../bpf/prog_tests/stacktrace_build_id_nmi.c | 3 +- .../selftests/bpf/test_tcpnotify_user.c | 15 ++-- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/tools/testing

RE: [PATCH bpf-next] bpf: Generate cookie for new non-initial net NS

2020-07-21 Thread Jianlin Lv
> -Original Message- > From: bpf-ow...@vger.kernel.org On Behalf > Of Daniel Borkmann > Sent: Wednesday, July 22, 2020 4:18 AM > To: Jianlin Lv ; b...@vger.kernel.org > Cc: da...@davemloft.net; k...@kernel.org; a...@kernel.org; y...@fb.com; > Song Zhu ; linux-k

[PATCH bpf-next] bpf: Generate cookie for new non-initial net NS

2020-07-20 Thread Jianlin Lv
initial and non-initial network namespace. Signed-off-by: Jianlin Lv --- net/core/net_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index dcd61aca343e..5937bd0df56d 100644 --- a/net/core/net_namespace.c +++ b