[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DDN0UIQ05A22.1SDXOW1K83VYY@bootlin.com>
Date: Mon, 20 Oct 2025 10:54:40 +0200
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: "Martin KaFai Lau" <martin.lau@...ux.dev>,
Alexis Lothoré (eBPF Foundation)
<alexis.lothore@...tlin.com>
Cc: "Alexei Starovoitov" <ast@...nel.org>, "Daniel Borkmann"
<daniel@...earbox.net>, "Andrii Nakryiko" <andrii@...nel.org>, "Eduard
Zingerman" <eddyz87@...il.com>, "Song Liu" <song@...nel.org>, "Yonghong
Song" <yonghong.song@...ux.dev>, "John Fastabend"
<john.fastabend@...il.com>, "KP Singh" <kpsingh@...nel.org>, "Stanislav
Fomichev" <sdf@...ichev.me>, "Hao Luo" <haoluo@...gle.com>, "Jiri Olsa"
<jolsa@...nel.org>, "Shuah Khan" <shuah@...nel.org>,
<ebpf@...uxfoundation.org>, "Thomas Petazzoni"
<thomas.petazzoni@...tlin.com>, "Bastien Curutchet"
<bastien.curutchet@...tlin.com>, <bpf@...r.kernel.org>,
<linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next 2/5] selftests/bpf: add tc helpers
On Sat Oct 18, 2025 at 1:26 AM CEST, Martin KaFai Lau wrote:
>
>
> On 10/17/25 7:29 AM, Alexis Lothoré (eBPF Foundation) wrote:
>> diff --git a/tools/testing/selftests/bpf/tc_helpers.c b/tools/testing/selftests/bpf/tc_helpers.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..d668e10e3ebad8f8e04862f5c2b3ccd487fe8fa6
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/tc_helpers.c
>> @@ -0,0 +1,87 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +#define _GNU_SOURCE
>> +
>> +#include <net/if.h>
>> +#include "tc_helpers.h"
>> +#include "test_progs.h"
>> +
>> +static int attach_tc_prog(int ifindex, int igr_fd, int egr_fd)
>
> This one looks good but change it to "int tc_prog_attach(const char
> *dev, int ingress_fd, int egress_fd)". Remove static. Take "const char
> *dev" as the arg. Add it to network_helpers.[ch] instead of creating a
> new source file.
Nice, thanks for the hint, I missed this header
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists