public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Wathsala Vithanage <wathsala.vithanage@arm.com>
To: Christophe Fontaine <cfontain@redhat.com>, dev@dpdk.org
Cc: Konstantin Ananyev <konstantin.ananyev@huawei.com>,
	Marat Khalili <marat.khalili@huawei.com>
Subject: Re: [PATCH v2 2/2] bpf/arm64: support packet data load instructions
Date: Thu, 9 Apr 2026 17:11:10 -0500	[thread overview]
Message-ID: <35f96fed-29d4-4a0b-b3a1-0f2c9fc6b60e@arm.com> (raw)
In-Reply-To: <CAHVr2N=DR9G8Wixv9sgov9Ks_DZkxbRHovn4ng0uME6GX8RboA@mail.gmail.com>

Hi Christophe,

Thanks for doing this work. I saw that you intend to submit a v3 due to 
failure in Ubuntu. Please, see my comment regarding emit_b below.

>> +       /* A64_R(0) = mbuf->buf_addr */
>> +       emit_mov_imm(ctx, 1, tmp1, offsetof(struct rte_mbuf, buf_addr));
>> +       emit_ldr(ctx, EBPF_DW, A64_R(0), r6, tmp1);
>> +       /* tmp2 = * mbuf->data_off */
>> +       emit_mov_imm(ctx, 1, tmp2, offsetof(struct rte_mbuf, data_off));
>> +       emit_ldr(ctx, BPF_H, tmp2, r6, tmp2);
>> +
>> +       /* A64_R(0) += data_off + off */
>> +       emit_add(ctx, 1, A64_R(0), tmp2);
>> +       emit_add(ctx, 1, A64_R(0), A64_R(1));
>> +
>> +       /* End of Fast Path, skip slow path */
>> +       emit_b(ctx, 4);
>> +
Followed by emit_b() above there is an emit_call(). It invokes 
emit_mov_imm() which could possibly generate different number of movk 
instructions depending on the address of the __rte_pktmbuf_read. So, 
emit_b(ctx, 4), may not  necessarily land at the intended location 
because there could be more than 4 instructions emitted by emit_call.
>> +       /* slow path, call __rte_pktmbuf_read */
>> +       emit_call(ctx, tmp1, __rte_pktmbuf_read);
>> +       /* check return value of __rte_pktmbuf_read */
>> +       emit_return_zero_if_src_zero(ctx, 1, A64_R(0));
>> +
>> +       /* A64_R(0) points to the data, load 1/2/4 bytes into r0*/
>> +       emit_ldr(ctx, opsz, r0, A64_R(0), A64_ZR);
>> +       if (sz != sizeof(uint8_t))
>> +               emit_be(ctx, r0, sz * CHAR_BIT);
>> +}
>> +
>>   

--wathsala



      parent reply	other threads:[~2026-04-09 22:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 12:20 [PATCH] bpf/arm64: support packet data load instructions Christophe Fontaine
2026-03-17  9:07 ` David Marchand
2026-03-18 11:59 ` Marat Khalili
2026-03-18 12:54   ` Morten Brørup
2026-03-18 13:07     ` Marat Khalili
2026-03-18 13:39       ` Morten Brørup
2026-03-18 15:34         ` Christophe Fontaine
2026-03-18 16:16           ` Marat Khalili
2026-03-18 16:37             ` Morten Brørup
2026-03-18 16:43               ` Marat Khalili
2026-03-18 18:10                 ` Konstantin Ananyev
2026-03-19  9:20                   ` Morten Brørup
2026-03-18 23:13     ` Stephen Hemminger
2026-03-19 11:44 ` [PATCH v2 0/2] " Christophe Fontaine
2026-03-19 11:44   ` [PATCH v2 1/2] bpf/arm64: fix offset type to allow a negative jump Christophe Fontaine
2026-03-19 11:44   ` [PATCH v2 2/2] bpf/arm64: support packet data load instructions Christophe Fontaine
2026-03-23  8:15     ` Christophe Fontaine
2026-03-23  9:26       ` Marat Khalili
2026-04-09 22:11       ` Wathsala Vithanage [this message]

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=35f96fed-29d4-4a0b-b3a1-0f2c9fc6b60e@arm.com \
    --to=wathsala.vithanage@arm.com \
    --cc=cfontain@redhat.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=marat.khalili@huawei.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