Re: [PATCH bpf-next v3 2/3] selftests/bpf: make xdp_cpumap_attach keep redirect prog attached
From: Alexis Lothoré
Date: Fri Oct 11 2024 - 07:51:05 EST
Hello Martin,
On 10/11/24 03:23, Martin KaFai Lau wrote:
> On 10/9/24 3:12 AM, Alexis Lothoré (eBPF Foundation) wrote:
>> - int err, prog_fd, map_fd;
>> + int err, prog_fd, prog_redir_fd, map_fd;
>> + struct nstoken *nstoken = NULL;
>> __u32 idx = 0;
>> + SYS(out_close, "ip netns add %s", TEST_NS);
>> + nstoken = open_netns(TEST_NS);
>> + if (!ASSERT_OK_PTR(nstoken, "open_netns"))
>> + goto out_close;
>> + SYS(out_close, "ip link set dev lo up");
>
> There is easier helper netns_{new,free} to do all these:
> netns_obj = netns_new(TEST_NS, true);
>
> Only fyi for your future work.
ACK, thanks !
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com