lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMB2axN2DPfTOAaf=7byckUXjkJOVUmN3faM_HTQ5hTifAWo1w@mail.gmail.com>
Date: Fri, 11 Apr 2025 10:20:25 -0700
From: Amery Hung <ameryhung@...il.com>
To: Martin KaFai Lau <iamkafai@...il.com>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, alexei.starovoitov@...il.com, 
	andrii@...nel.org, daniel@...earbox.net, edumazet@...gle.com, kuba@...nel.org, 
	xiyou.wangcong@...il.com, jhs@...atatu.com, martin.lau@...nel.org, 
	jiri@...nulli.us, stfomichev@...il.com, toke@...hat.com, sinquersw@...il.com, 
	ekarani.silvestre@....ufcg.edu.br, yangpeihao@...u.edu.cn, 
	yepeilin.cs@...il.com, kernel-team@...a.com
Subject: Re: [PATCH bpf-next v7 08/10] selftests/bpf: Add a basic fifo qdisc test

On Thu, Apr 10, 2025 at 4:59 PM Martin KaFai Lau <iamkafai@...il.com> wrote:
>
> On Wed, Apr 9, 2025 at 2:49 PM Amery Hung <ameryhung@...il.com> wrote:
> > +void test_bpf_qdisc(void)
>
> nit. re-name to "test_ns_bpf_qdisc"....
>
> > +{
> > +       struct netns_obj *netns;
> > +
> > +       netns = netns_new("bpf_qdisc_ns", true);
>
> ... then this can be saved.
>
> > +       if (!ASSERT_OK_PTR(netns, "netns_new"))
> > +               return;
> > +
> > +       if (test__start_subtest("fifo"))
> > +               test_fifo();
> > +
> > +       netns_free(netns);
> > +}
> > diff --git a/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h b/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h
> > new file mode 100644
> > index 000000000000..65a2c561c0bb
> > --- /dev/null
> > +++ b/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h
> > @@ -0,0 +1,31 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +
> > +#ifndef _BPF_QDISC_COMMON_H
> > +#define _BPF_QDISC_COMMON_H
> > +
> > +#define NET_XMIT_SUCCESS        0x00
> > +#define NET_XMIT_DROP           0x01    /* skb dropped                  */
> > +#define NET_XMIT_CN             0x02    /* congestion notification      */
> > +
> > +#define TC_PRIO_CONTROL  7
> > +#define TC_PRIO_MAX      15
> > +
> > +#define private(name) SEC(".data." #name) __hidden __attribute__((aligned(8)))
> > +
> > +u32 bpf_skb_get_hash(struct sk_buff *p) __ksym;
> > +void bpf_kfree_skb(struct sk_buff *p) __ksym;
> > +void bpf_qdisc_skb_drop(struct sk_buff *p, struct bpf_sk_buff_ptr *to_free) __ksym;
> > +void bpf_qdisc_watchdog_schedule(struct Qdisc *sch, u64 expire, u64 delta_ns) __ksym;
> > +void bpf_qdisc_bstats_update(struct Qdisc *sch, const struct sk_buff *skb) __ksym;
>
> nit. These kfunc declarations should be no longer needed. vmlinux.h
> should already have them. Update pahole if vmlinux.h does not have
> them.
>
> The set has been applied. Please consider following up the nits in
> selftests. Thanks.

I will send a follow up addressing two things you mentioned. Thanks
for the suggestions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ