reminder: IO Visor TSC/Dev Meeting
Brenden Blanco
Please join us tomorrow for our bi-weekly call. As usual, this meeting is
open to everybody and completely optional. You might be interested to join if: You want to know what is going on in BPF land You are doing something interesting yourself with BPF and would like to share You want to know what the heck BPF is === IO Visor Dev/TSC Meeting === Every 2 weeks on Wednesday, from Wednesday, January 25, 2017, to no end date 11:00 am | Pacific Daylight Time (San Francisco, GMT-07:00) | 30 min https://bluejeans.com/568677804/ https://www.timeanddate.com/worldclock/meetingdetails.html?year=2019&month=4&day=17&hour=18&min=0&sec=0&p1=900
|
|
Re: bpftrace and include search paths?
Richard Elling
Yes, thanks. Though CPATH seems to be more universal. I'll work up some docs and submit a PR. Now, if I can find an equivalent to dtrace's print(arg[0])... -- richard
|
|
Re: R? min value is negative, either use unsigned or 'var &= const'
#verifier
Yonghong Song
On Thu, Apr 11, 2019 at 8:37 AM Simon <contact@...> wrote:
Glad you find a solution! Sure. Verifier understands some dynamic check if these dynamic check is resolved to be constant vs. variable or constant vs. constant compares during path sensitive verification.
|
|
Re: R? min value is negative, either use unsigned or 'var &= const'
#verifier
Simon
I finally discover that checksum can be calculated via incremental update. (see RFC 1624) Using it, I didn't have to deal with dynamic sized payload and so no more issue with the verifier. So I go back to use bcc :) Again, Thx a lot Yonghong for your time ! Please don't forget to keep me in touch about that even if I'm not impacted anymore, I'm curious to know how you move forward on this ! (By the way did you get the point about the error just above, is the verifier able to understand this kind of dynamic check ?)
|
|
Re: minutes: IO Visor TSC/Dev Meeting
Jiong Wang
Great, will have a look, thanks! Regards, Jiong On 05/04/2019 07:45, Y Song wrote:
Hi, Jiong, To follow up the iovisor meeting discussion, the below is my prototype for an end_loop instruction in llvm: https://github.com/yonghong-song/llvm/commit/b83226772100317092cae6478229ed6ca3b9903c The goal is to help verifier to just focus on these marked cases, rejecting any other backedges. Please let me and John know if you get some better idea for bounded loop support in llvm/verifier. Thanks, Yonghong On Wed, Apr 3, 2019 at 11:49 AM Brenden Blanco <bblanco@...> wrote:Hi All, Thanks for the good discussion today! Below are my notes. Thanks, Brenden === Discussion ===[...]Yonghong: * Compile once run anywhere work continues * bitfield handling bugs in IR/debuginfo Daniel: * Global support work continues * BTF side patches submitted to bpf mailing list * tests included Jiong: * 32 bit patch set * test methodology improvements * updated patches later in the week * some concerns around shifts, to be addressed in later improvements Andrii: * BTF and compile-once work integration to share prototype tool with Saeed Brendan: * Is there a tool to measure queue latency in qdisc->netdev layer? * debian/ubuntu are packaging bpftrace * except libbcc renamed to libbpf_cc * some issues with mixing iovisor's libbcc and debian's Jesper: * Fedora adding packaging support for libbpf Alexei: * systemd also adding support for libbpf - link to be provided? === Attendees === Brenden Blanco Andril Nakryiko Daniel Borkmann Jesper Brouer Jiong Wang Marco Leogrande Michael Savisko Paul Chaignon Quentin Monnet Alexei Starovoitov Saeed Flavio Rony Jonathan Lemon Brendan Gregg Dan Siemon Joe Stringer John
|
|
Re: minutes: IO Visor TSC/Dev Meeting
Yonghong Song
Hi, Jiong,
To follow up the iovisor meeting discussion, the below is my prototype for an end_loop instruction in llvm: https://github.com/yonghong-song/llvm/commit/b83226772100317092cae6478229ed6ca3b9903c The goal is to help verifier to just focus on these marked cases, rejecting any other backedges. Please let me and John know if you get some better idea for bounded loop support in llvm/verifier. Thanks, Yonghong On Wed, Apr 3, 2019 at 11:49 AM Brenden Blanco <bblanco@...> wrote: [...] Yonghong:
|
|
Re: bpftrace and include search paths?
Brendan Gregg
C_INCLUDE_PATH=... environment variable should work. But you can file an RFE or PR anyway to add this to the docs. Thanks! Brendan
On Thu, Apr 4, 2019 at 12:41 PM Richard Elling <richard.elling@...> wrote: I have a need to have a bpftrace script #include headers from a project
|
|
bpftrace and include search paths?
Richard Elling
I have a need to have a bpftrace script #include headers from a project
directory. In cc, this is like adding -I<path>. Am I blind from reading manuals or is there a clever way to pass that info down through bpftrace into bpf or is this a new RFE? -- richard
|
|
XDP on Azure vNICs
Kanthi P <Pavuluri.kanthi@...>
Hi, We are seeing an issue with XDP(xdp generic) attached to Azure vNICs. When "accelerated networking" is enabled on Azure vNICs, xdp doesn't receive all the packets. We see all of them in tcpdump though. Has anyone tried it this way? Thanks, Kanthi
|
|
minutes: IO Visor TSC/Dev Meeting
Brenden Blanco
Hi All,
Thanks for the good discussion today! Below are my notes. Thanks, Brenden === Discussion === Michael: * https://github.com/savisko/katran/tree/xdp_off * Mellanox presentation on XDP + Katran * offload tc XDP programs to hardware nic * Example application: Katran from Facebook * Control is implemented as a C++ library (example is open source) * Katran DP already implemented in XDP * Parsing + extract flow ID * lookup key generation * counter update * packet modified to forward to other IP * Accelerate marking of flows in hardware * XDP metadata to pass mark field from hardware to xdp program * struct xdp_md_mark { __u32 mark) }; * if (mark_ptr + 1 <= data) markID = mark_ptr->mark; * per-CPU XDP map to convert mark -> real flow information mark == 0 implies new flow * original XDP slow-path has get_packet_dst() to create LRU mapping * modified version uses perf event output to notify acceleration helper to install flow mark in hardware * perf results: 100 flows: 40+% performance improvements 10k flows: 0-50% performance improvements depending on #rx queues used Software: 25Mpps Hardware: 37-39Mpps * considering changing implementation to mark real server instead of flow id, to reduce number of entries kept in L1 cache Yonghong: * Compile once run anywhere work continues * bitfield handling bugs in IR/debuginfo Daniel: * Global support work continues * BTF side patches submitted to bpf mailing list * tests included Jiong: * 32 bit patch set * test methodology improvements * updated patches later in the week * some concerns around shifts, to be addressed in later improvements Andrii: * BTF and compile-once work integration to share prototype tool with Saeed Brendan: * Is there a tool to measure queue latency in qdisc->netdev layer? * debian/ubuntu are packaging bpftrace * except libbcc renamed to libbpf_cc * some issues with mixing iovisor's libbcc and debian's Jesper: * Fedora adding packaging support for libbpf Alexei: * systemd also adding support for libbpf - link to be provided? === Attendees === Brenden Blanco Andril Nakryiko Daniel Borkmann Jesper Brouer Jiong Wang Marco Leogrande Michael Savisko Paul Chaignon Quentin Monnet Alexei Starovoitov Saeed Flavio Rony Jonathan Lemon Brendan Gregg Dan Siemon Joe Stringer John
|
|
Re: reminder: IO Visor TSC/Dev Meeting
Hi, Please see attached presentation of XDP acceleration of Katrab LB (in PPT and PDF). The code can be found here: https://github.com/savisko/katran/tree/xdp_off Regards, Michael
On Wednesday, April 3, 2019, 2:58:39 AM GMT+3, Brenden Blanco <bblanco@...> wrote:
Agenda: discussion on XDP acceleration of Katran LB Please join us tomorrow for our bi-weekly call. As usual, this meeting is open to everybody and completely optional. You might be interested to join if: You want to know what is going on in BPF land You are doing something interesting yourself with BPF and would like to share You want to know what the heck BPF is === IO Visor Dev/TSC Meeting === Every 2 weeks on Wednesday, from Wednesday, January 25, 2017, to no end date 11:00 am | Pacific Daylight Time (San Francisco, GMT-07:00) | 30 min
|
|
reminder: IO Visor TSC/Dev Meeting
Brenden Blanco
Agenda: discussion on XDP acceleration of Katran LB
Please join us tomorrow for our bi-weekly call. As usual, this meeting is open to everybody and completely optional. You might be interested to join if: You want to know what is going on in BPF land You are doing something interesting yourself with BPF and would like to share You want to know what the heck BPF is === IO Visor Dev/TSC Meeting === Every 2 weeks on Wednesday, from Wednesday, January 25, 2017, to no end date 11:00 am | Pacific Daylight Time (San Francisco, GMT-07:00) | 30 min https://bluejeans.com/568677804/ https://www.timeanddate.com/worldclock/meetingdetails.html?year=2019&month=4&day=3&hour=18&min=0&sec=0&p1=900
|
|
Re: minutes: IO Visor TSC/Dev Meeting
Brenden Blanco
On Tue, Apr 2, 2019 at 10:48 AM Saeed Mahameed
<saeedm@...> wrote: Sending to the iovisor-dev mailer is gated by a signup requirement, in order to reduce spam. The signup process should be pretty painless, I believe it just requires going through an email validation step: https://lists.iovisor.org/g/iovisor-dev/join Sounds good!
|
|
Re: minutes: IO Visor TSC/Dev Meeting
Saeed Mahameed
Hi Brenden,
toggle quoted messageShow quoted text
I am sending this on behalf of Michael Savisko, he is having some difficulties sending emails to the iovisor list. Michael is working on real world use cases for XDP acceleration. He would like to present and discuss his work and analysis on accelerating Katran load balancer [1] via meta data offloads. He will need 10 minutes and will share some slides, i hope we can push this to tomorrow's meeting agenda. Katran modified code is on Github: https://github.com/savisko/katran/tree/xdp_off [1] https://code.fb.com/open-source/open-sourcing-katran-a-scalable-network-load-balancer/ Thanks, Saeed.
On Wed, Mar 20, 2019 at 3:32 PM Brenden Blanco <bblanco@...> wrote:
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Yonghong Song
On Wed, Mar 27, 2019 at 1:48 PM Pablo Alvarez via Lists.Iovisor.Org
<palvarez=akamai.com@...> wrote: -O0 won't work as helper call will become an indirect call static void *(*bpf_map_lookup_elem)(void *map, void *key) = (void *) BPF_FUNC_map_lookup_elem; Another reason is below value tracking in verifier. The verifier does not handle value spill well. It kept track of map pointers, packet pointers, etc. But if a particular value is spilled, later on, when reload from stack, it will become unknown. For example, r1 = 10; /* verifier state: r1 = 10 */ *(r10 - 40) = r1; r2 = *(r10 - 40); /* verifier state: r2, unknown */ The reason is that keep tracking of values could increase verification time quite a bit. This is measured sometime back, but it may warrant to do some measurement again at this moment to see whether can relax this restriction. So practically -O0 won't work. -O1 may or may not work and most people do not use it. -O2 is preferred. Also for performance reasons, we want to make -O2 work as BPF JIT inside the kernel does not do any optimization, it is simple one insn each time translation.
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Pablo Alvarez
Why is it required that llvm compile the BPF code with -O2? That seems to be part of what is causing these verifier problems...
toggle quoted messageShow quoted text
On 3/27/19 4:23 PM, Yonghong Song wrote:
On Wed, Mar 27, 2019 at 10:17 AM Jiong Wang <jiong.wang@...> wrote:If you use BPF constructor debug=16 flag, it will print out theOn 27 Mar 2019, at 16:43, Simon <contact@...> wrote:Just my humble opinion, I would recommend:
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Yonghong Song
On Wed, Mar 27, 2019 at 10:17 AM Jiong Wang <jiong.wang@...> wrote:
If you use BPF constructor debug=16 flag, it will print out theOn 27 Mar 2019, at 16:43, Simon <contact@...> wrote:Just my humble opinion, I would recommend: register state for every insn if you are even more curious. To resolve this issue, llvm may need to do more: - prevent/undo optimization which may cause ultimate verifier rejections. - provide hints (e.g., through BTF) to verifier so verifier may selectively do some analysis or enable some tracking for the cases where BTF instructed to handle. For example, BTF may tell verifier two register have the same state at a particular point and verifier only needs to check these two registers with limited range and no others, etc. Regards,
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Jiong Wang
On 27 Mar 2019, at 16:43, Simon <contact@...> wrote:Just my humble opinion, I would recommend: 1. get used to verifier rejection information, for example: R0=inv1 R1=pkt(id=0,off=0,r=42,imm=0) R2=pkt_end(id=0,off=0,imm=0) R3=inv(id=0) R4=inv(id=0,umax_value=504,var_off=(0x0; 0x1ff)) R5=inv5 R10=fp0,call_-1 40: (0f) r1 += r3 math between pkt pointer and register with unbounded min value is not allowed It tells you the status of each registers at the rejection point, for example, now R3 is “inv”, meaning a scalar value (not a pointer), and is without value range, then r4 has value range, and maximum value is 504. 2. known what verifier will reject. Could refer to: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/verifier?id=473c5daa86ffe91e937856cc32b4faa61db2e3e3 those are unit examples of what will be rejected, and some of them are with meaningful test name or comments so could be easy to understand. Regards, Jiong
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Simon
Thx a lot for your time Jiong. The more I played with bpf/xdp, the more I understand that the challenge is about making "optimized byte code" compliant for the verifier. How could I do this kind of checks my self ? I mean looking how llvm optimized my code ? (to be able to do same kind of analyses you do above?)
|
|
Re: math between pkt pointer and register with unbounded min value is not allowed
#verifier
Jiong Wang
On 27 Mar 2019, at 16:11, Jiong Wang via Lists.Iovisor.Org <jiong.wang=netronome.com@...> wrote:And in your code, after you insert those printk, they made the following two comparisons non-combinable any more, so udp_len is used for the comparison and got correct value range to pass the later pkt pointer addition check. if (udp_len < 8) { return XDP_DROP; } if (udp_len > 512) { return XDP_DROP; }
|
|