mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hari Bathini <hbathini@linux.ibm.com>
To: Artem Savkov <asavkov@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] powerpc64/bpf: jit support for unconditional byte swap
Date: Wed, 22 May 2024 17:07:28 +0530	[thread overview]
Message-ID: <922473a0-7e74-45e8-9929-154d0590d124@linux.ibm.com> (raw)
In-Reply-To: <20240517075650.248801-3-asavkov@redhat.com>



On 17/05/24 1:26 pm, Artem Savkov wrote:
> Add jit support for unconditional byte swap. Tested using BSWAP tests
> from test_bpf module.
> 
> Signed-off-by: Artem Savkov <asavkov@redhat.com>
> ---
>   arch/powerpc/net/bpf_jit_comp64.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
> index 3071205782b15..97191cf091bbf 100644
> --- a/arch/powerpc/net/bpf_jit_comp64.c
> +++ b/arch/powerpc/net/bpf_jit_comp64.c
> @@ -699,11 +699,12 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, u32 *fimage, struct code
>   		 */
>   		case BPF_ALU | BPF_END | BPF_FROM_LE:
>   		case BPF_ALU | BPF_END | BPF_FROM_BE:

> +		case BPF_ALU64 | BPF_END | BPF_FROM_LE:

A comment here indicating this case does unconditional swap
could improve readability.

Other than this minor nit, the patchset looks good to me.
Also, tested the changes with test_bpf module and selftests.
For the series..

Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>

>   #ifdef __BIG_ENDIAN__
>   			if (BPF_SRC(code) == BPF_FROM_BE)
>   				goto emit_clear;
>   #else /* !__BIG_ENDIAN__ */
> -			if (BPF_SRC(code) == BPF_FROM_LE)
> +			if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE)
>   				goto emit_clear;
>   #endif
>   			switch (imm) {

  reply	other threads:[~2024-05-22 11:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  7:56 [PATCH 0/5] powerpc64/bpf: jit support for cpuv4 instructions Artem Savkov
2024-05-17  7:56 ` [PATCH 1/5] powerpc64/bpf: jit support for 32bit offset jmp instruction Artem Savkov
2024-05-17  7:56 ` [PATCH 2/5] powerpc64/bpf: jit support for unconditional byte swap Artem Savkov
2024-05-22 11:37   ` Hari Bathini [this message]
2024-05-17  7:56 ` [PATCH 3/5] powerpc64/bpf: jit support for sign extended load Artem Savkov
2024-05-17  7:56 ` [PATCH 4/5] powerpc64/bpf: jit support for sign extended mov Artem Savkov
2024-05-17  7:56 ` [PATCH 5/5] powerpc64/bpf: jit support for signed division and modulo Artem Savkov
2024-07-12 12:53 ` [PATCH 0/5] powerpc64/bpf: jit support for cpuv4 instructions Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=922473a0-7e74-45e8-9929-154d0590d124@linux.ibm.com \
    --to=hbathini@linux.ibm.com \
    --cc=andrii@kernel.org \
    --cc=asavkov@redhat.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®