Thread (8 messages) 8 messages, 2 authors, 2019-10-22

Re: [PATCH bpf-next v2] libbpf: use implicit XSKMAP lookup from AF_XDP XDP program

From: Björn Töpel <hidden>
Date: 2019-10-21 14:35:22
Also in: bpf

On Mon, 21 Oct 2019 at 15:37, Björn Töpel [off-list ref] wrote:
On Mon, 21 Oct 2019 at 14:19, Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
Björn Töpel [off-list ref] writes:
[...]
quoted
quoted
bpf_redirect_map() returns a 32-bit signed int, so the upper 32-bit
will need to be cleared. Having an explicit AND is one instruction
less than two shifts. So, it's an optimization (every instruction is
sacred).
OIC. Well, a comment explaining that might be nice (since you're doing
per-instruction comments anyway)? :)
Sure, I can do a v3 with a comment, unless someone has a better idea
avoiding both shifts and AND.

Thanks for taking a look!
Now wait, there are the JMP32 instructions that Jiong added. So,
shifts/AND can be avoided. Now, regarding backward compat... JMP32 is
pretty new. I need to think a bit how to approach this. I mean, I'd
like to be able to use new BPF instructions.


Björn
Björn

quoted
-Toke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help