[ovs-dev] [PATCH v4 1/5] netdev-afxdp: Enable loading XDP program.

William Tu u9012063 at gmail.com
Thu Feb 4 18:47:43 UTC 2021


On Thu, Jul 30, 2020 at 7:55 PM Toshiaki Makita
<toshiaki.makita1 at gmail.com> wrote:
>
> From: William Tu <u9012063 at gmail.com>
>
> Now netdev-afxdp always forwards all packets to userspace because
> it is using libbpf's default XDP program, see 'xsk_load_xdp_prog'.
> There are some cases when users want to keep packets in kernel instead
> of sending to userspace, for example, management traffic such as SSH
> should be processed in kernel.
>
> The patch enables loading the user-provided XDP program by
>   $ovs-vsctl -- set int afxdp-p0 options:xdp-obj=<path/to/xdp/obj>
>
> So users can implement their filtering logic or traffic steering idea
> in their XDP program, and rest of the traffic passes to AF_XDP socket
> handled by OVS.
>
> Note: kernel in AF_XDP CI test is updated to 5.5 because libbpf from 5.3
> does not have newly used APIs like "bpf_program__get_type".

Thanks for figuring the right version.

>
> Signed-off-by: William Tu <u9012063 at gmail.com>
> Co-Authored-by: Toshiaki Makita <toshiaki.makita1 at gmail.com>
> Signed-off-by: Toshiaki Makita <toshiaki.makita1 at gmail.com>
> ---
>  .travis.yml                           |   2 +-
>  Documentation/intro/install/afxdp.rst |  59 ++++++++++
>  NEWS                                  |   2 +
>  lib/netdev-afxdp.c                    | 155 ++++++++++++++++++++++++--
>  lib/netdev-linux-private.h            |   3 +
>  5 files changed, 213 insertions(+), 8 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 527240a67..26b55a3e6 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -40,7 +40,7 @@ env:
>    - TESTSUITE=1 LIBS=-ljemalloc
>    - KERNEL_LIST="5.5  4.20 4.19 4.18 4.17 4.16"
>    - KERNEL_LIST="4.15 4.14 4.9  4.4  3.19 3.16"
> -  - AFXDP=1 KERNEL=5.3
> +  - AFXDP=1 KERNEL=5.5
>    - M32=1 OPTS="--disable-ssl"
>    - DPDK=1 OPTS="--enable-shared"
>    - DPDK_SHARED=1

We'll need to rebase this patch to latest master.
Otherwise the patch looks good to me, tested OK
on my system.

William


More information about the dev mailing list