Message ID | 20210512103451.989420-1-memxor@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Add TC-BPF API | expand |
On 5/12/21 12:34 PM, Kumar Kartikeya Dwivedi wrote: > This is the seventh version of the TC-BPF series. > > It adds a simple API that uses netlink to attach the tc filter and its bpf > classifier program. Currently, a user needs to shell out to the tc command line > to be able to create filters and attach SCHED_CLS programs as classifiers. With > the help of this API, it will be possible to use libbpf for doing all parts of > bpf program setup and attach. > > Changelog contains details of patchset evolution. > > In an effort to keep discussion focused, this series doesn't have the high level > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > hence that will be submitted as a separate patchset based on this. > > The individual commit messages contain more details, and also a brief summary of > the API. > > Changelog: > ---------- > v6 -> v7 > v6: https://lore.kernel.org/bpf/20210504005023.1240974-1-memxor@gmail.com > > * Address all comments from Daniel > * Rename BPF_NL_* to NL_* > * Make bpf_tc_query only support targeted query > * Adjust inconsistencies in the commit message > * Drop RTM_GETTFILTER NLM_F_DUMP support > * Other misc cleanups (also remove bpf_tc_query selftest for dump mode) Still had to do a major patch cleanup on the first two before pushing out, but I think it looks nice now and I do like the simple/straight forward API for tc/BPF. Anyway, applied, thanks!
On Wed, May 12, 2021 at 3:35 AM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote: > > This is the seventh version of the TC-BPF series. > > It adds a simple API that uses netlink to attach the tc filter and its bpf > classifier program. Currently, a user needs to shell out to the tc command line > to be able to create filters and attach SCHED_CLS programs as classifiers. With > the help of this API, it will be possible to use libbpf for doing all parts of > bpf program setup and attach. > > Changelog contains details of patchset evolution. > > In an effort to keep discussion focused, this series doesn't have the high level > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > hence that will be submitted as a separate patchset based on this. > > The individual commit messages contain more details, and also a brief summary of > the API. > > Changelog: > ---------- Hey Kartikeya, There were few issues flagged by Coverity after I synced libbpf to Github. A bunch of them are netlink.c-related. Could you please take a look and see if they are false positives or something that we can actually fix? See links to the issues below. Thanks! [0] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901199&mergedDefectId=141815 [1] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901193&mergedDefectId=322806 [2] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901197&mergedDefectId=322807 [3] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901195&mergedDefectId=322808 [...] > > Kumar Kartikeya Dwivedi (3): > libbpf: add netlink helpers > libbpf: add low level TC-BPF API > libbpf: add selftests for TC-BPF API > > tools/lib/bpf/libbpf.h | 43 ++ > tools/lib/bpf/libbpf.map | 5 + > tools/lib/bpf/netlink.c | 554 ++++++++++++++++-- > tools/lib/bpf/nlattr.h | 48 ++ > .../testing/selftests/bpf/prog_tests/tc_bpf.c | 395 +++++++++++++ > .../testing/selftests/bpf/progs/test_tc_bpf.c | 12 + > 6 files changed, 993 insertions(+), 64 deletions(-) > create mode 100644 tools/testing/selftests/bpf/prog_tests/tc_bpf.c > create mode 100644 tools/testing/selftests/bpf/progs/test_tc_bpf.c > > -- > 2.31.1 >
On Sat, Jun 12, 2021 at 01:31:56AM IST, Andrii Nakryiko wrote: > On Wed, May 12, 2021 at 3:35 AM Kumar Kartikeya Dwivedi > <memxor@gmail.com> wrote: > > > > This is the seventh version of the TC-BPF series. > > > > It adds a simple API that uses netlink to attach the tc filter and its bpf > > classifier program. Currently, a user needs to shell out to the tc command line > > to be able to create filters and attach SCHED_CLS programs as classifiers. With > > the help of this API, it will be possible to use libbpf for doing all parts of > > bpf program setup and attach. > > > > Changelog contains details of patchset evolution. > > > > In an effort to keep discussion focused, this series doesn't have the high level > > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > > hence that will be submitted as a separate patchset based on this. > > > > The individual commit messages contain more details, and also a brief summary of > > the API. > > > > Changelog: > > ---------- > > Hey Kartikeya, > > There were few issues flagged by Coverity after I synced libbpf to > Github. A bunch of them are netlink.c-related. Could you please take a > look and see if they are false positives or something that we can > actually fix? See links to the issues below. Thanks! > > [0] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901199&mergedDefectId=141815 > [1] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901193&mergedDefectId=322806 > [2] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901197&mergedDefectId=322807 > [3] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901195&mergedDefectId=322808 > Hi Andrii, These links don't work for me (I get a timeout). Would you know why? Is there some other link where I can look at them? > [...] > > > > > Kumar Kartikeya Dwivedi (3): > > libbpf: add netlink helpers > > libbpf: add low level TC-BPF API > > libbpf: add selftests for TC-BPF API > > > > tools/lib/bpf/libbpf.h | 43 ++ > > tools/lib/bpf/libbpf.map | 5 + > > tools/lib/bpf/netlink.c | 554 ++++++++++++++++-- > > tools/lib/bpf/nlattr.h | 48 ++ > > .../testing/selftests/bpf/prog_tests/tc_bpf.c | 395 +++++++++++++ > > .../testing/selftests/bpf/progs/test_tc_bpf.c | 12 + > > 6 files changed, 993 insertions(+), 64 deletions(-) > > create mode 100644 tools/testing/selftests/bpf/prog_tests/tc_bpf.c > > create mode 100644 tools/testing/selftests/bpf/progs/test_tc_bpf.c > > > > -- > > 2.31.1 > > -- Kartikeya
On Fri, Jun 11, 2021 at 1:47 PM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote: > > On Sat, Jun 12, 2021 at 01:31:56AM IST, Andrii Nakryiko wrote: > > On Wed, May 12, 2021 at 3:35 AM Kumar Kartikeya Dwivedi > > <memxor@gmail.com> wrote: > > > > > > This is the seventh version of the TC-BPF series. > > > > > > It adds a simple API that uses netlink to attach the tc filter and its bpf > > > classifier program. Currently, a user needs to shell out to the tc command line > > > to be able to create filters and attach SCHED_CLS programs as classifiers. With > > > the help of this API, it will be possible to use libbpf for doing all parts of > > > bpf program setup and attach. > > > > > > Changelog contains details of patchset evolution. > > > > > > In an effort to keep discussion focused, this series doesn't have the high level > > > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > > > hence that will be submitted as a separate patchset based on this. > > > > > > The individual commit messages contain more details, and also a brief summary of > > > the API. > > > > > > Changelog: > > > ---------- > > > > Hey Kartikeya, > > > > There were few issues flagged by Coverity after I synced libbpf to > > Github. A bunch of them are netlink.c-related. Could you please take a > > look and see if they are false positives or something that we can > > actually fix? See links to the issues below. Thanks! > > > > [0] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901199&mergedDefectId=141815 > > [1] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901193&mergedDefectId=322806 > > [2] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901197&mergedDefectId=322807 > > [3] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901195&mergedDefectId=322808 > > > > Hi Andrii, > > These links don't work for me (I get a timeout). Would you know why? Is there > some other link where I can look at them? > Sorry, I don't know any other way to share them. https://scan3.coverity.com/reports.htm#v40547/p11903 should show all libbpf issues. Maybe try creating an account with coverity.com?.. > > [...] > > > > > > > > Kumar Kartikeya Dwivedi (3): > > > libbpf: add netlink helpers > > > libbpf: add low level TC-BPF API > > > libbpf: add selftests for TC-BPF API > > > > > > tools/lib/bpf/libbpf.h | 43 ++ > > > tools/lib/bpf/libbpf.map | 5 + > > > tools/lib/bpf/netlink.c | 554 ++++++++++++++++-- > > > tools/lib/bpf/nlattr.h | 48 ++ > > > .../testing/selftests/bpf/prog_tests/tc_bpf.c | 395 +++++++++++++ > > > .../testing/selftests/bpf/progs/test_tc_bpf.c | 12 + > > > 6 files changed, 993 insertions(+), 64 deletions(-) > > > create mode 100644 tools/testing/selftests/bpf/prog_tests/tc_bpf.c > > > create mode 100644 tools/testing/selftests/bpf/progs/test_tc_bpf.c > > > > > > -- > > > 2.31.1 > > > > > -- > Kartikeya
On Sat, Jun 12, 2021 at 02:28:09AM IST, Andrii Nakryiko wrote: > On Fri, Jun 11, 2021 at 1:47 PM Kumar Kartikeya Dwivedi > <memxor@gmail.com> wrote: > > > > On Sat, Jun 12, 2021 at 01:31:56AM IST, Andrii Nakryiko wrote: > > > On Wed, May 12, 2021 at 3:35 AM Kumar Kartikeya Dwivedi > > > <memxor@gmail.com> wrote: > > > > > > > > This is the seventh version of the TC-BPF series. > > > > > > > > It adds a simple API that uses netlink to attach the tc filter and its bpf > > > > classifier program. Currently, a user needs to shell out to the tc command line > > > > to be able to create filters and attach SCHED_CLS programs as classifiers. With > > > > the help of this API, it will be possible to use libbpf for doing all parts of > > > > bpf program setup and attach. > > > > > > > > Changelog contains details of patchset evolution. > > > > > > > > In an effort to keep discussion focused, this series doesn't have the high level > > > > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > > > > hence that will be submitted as a separate patchset based on this. > > > > > > > > The individual commit messages contain more details, and also a brief summary of > > > > the API. > > > > > > > > Changelog: > > > > ---------- > > > > > > Hey Kartikeya, > > > > > > There were few issues flagged by Coverity after I synced libbpf to > > > Github. A bunch of them are netlink.c-related. Could you please take a > > > look and see if they are false positives or something that we can > > > actually fix? See links to the issues below. Thanks! > > > > > > [0] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901199&mergedDefectId=141815 > > > [1] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901193&mergedDefectId=322806 > > > [2] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901197&mergedDefectId=322807 > > > [3] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901195&mergedDefectId=322808 > > > > > > > Hi Andrii, > > > > These links don't work for me (I get a timeout). Would you know why? Is there > > some other link where I can look at them? > > > > Sorry, I don't know any other way to share them. > https://scan3.coverity.com/reports.htm#v40547/p11903 should show all > libbpf issues. Maybe try creating an account with coverity.com?.. > Thanks, that helped. I now see 401 Unauthorized, so I sent an approval request. -- Kartikeya
On Fri, Jun 11, 2021 at 2:25 PM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote: > > On Sat, Jun 12, 2021 at 02:28:09AM IST, Andrii Nakryiko wrote: > > On Fri, Jun 11, 2021 at 1:47 PM Kumar Kartikeya Dwivedi > > <memxor@gmail.com> wrote: > > > > > > On Sat, Jun 12, 2021 at 01:31:56AM IST, Andrii Nakryiko wrote: > > > > On Wed, May 12, 2021 at 3:35 AM Kumar Kartikeya Dwivedi > > > > <memxor@gmail.com> wrote: > > > > > > > > > > This is the seventh version of the TC-BPF series. > > > > > > > > > > It adds a simple API that uses netlink to attach the tc filter and its bpf > > > > > classifier program. Currently, a user needs to shell out to the tc command line > > > > > to be able to create filters and attach SCHED_CLS programs as classifiers. With > > > > > the help of this API, it will be possible to use libbpf for doing all parts of > > > > > bpf program setup and attach. > > > > > > > > > > Changelog contains details of patchset evolution. > > > > > > > > > > In an effort to keep discussion focused, this series doesn't have the high level > > > > > TC-BPF API. It was clear that there is a need for a bpf_link API in the kernel, > > > > > hence that will be submitted as a separate patchset based on this. > > > > > > > > > > The individual commit messages contain more details, and also a brief summary of > > > > > the API. > > > > > > > > > > Changelog: > > > > > ---------- > > > > > > > > Hey Kartikeya, > > > > > > > > There were few issues flagged by Coverity after I synced libbpf to > > > > Github. A bunch of them are netlink.c-related. Could you please take a > > > > look and see if they are false positives or something that we can > > > > actually fix? See links to the issues below. Thanks! > > > > > > > > [0] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901199&mergedDefectId=141815 > > > > [1] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901193&mergedDefectId=322806 > > > > [2] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901197&mergedDefectId=322807 > > > > [3] https://scan3.coverity.com/reports.htm#v40547/p11903/fileInstanceId=53874109&defectInstanceId=10901195&mergedDefectId=322808 > > > > > > > > > > Hi Andrii, > > > > > > These links don't work for me (I get a timeout). Would you know why? Is there > > > some other link where I can look at them? > > > > > > > Sorry, I don't know any other way to share them. > > https://scan3.coverity.com/reports.htm#v40547/p11903 should show all > > libbpf issues. Maybe try creating an account with coverity.com?.. > > > > Thanks, that helped. I now see 401 Unauthorized, so I sent an approval request. Approved. > > -- > Kartikeya