From: Martin KaFai Lau <martin.lau@linux.dev>
To: Amery Hung <ameryhung@gmail.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
alexei.starovoitov@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, martin.lau@kernel.org,
xiyou.wangcong@gmail.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next/net v1 2/5] selftests/bpf: Test setting and creating bpf qdisc as default qdisc
Date: Fri, 2 May 2025 12:27:20 -0700 [thread overview]
Message-ID: <ec91dcac-d2d0-4705-aca1-8cdc1954aa11@linux.dev> (raw)
In-Reply-To: <CAMB2axO2Jkc4Ec051+BYhju2Vr_GwzZL6yhHGuohMdg2q6WLRQ@mail.gmail.com>
On 5/2/25 10:52 AM, Amery Hung wrote:
>>> +static void test_default_qdisc_attach_to_mq(void)
>>> +{
>>> + struct bpf_qdisc_fifo *fifo_skel;
>>> + char default_qdisc[IFNAMSIZ];
>>> + struct netns_obj *netns;
>>> + char tc_qdisc_show[64];
>>> + struct bpf_link *link;
>>> + char *str_ret;
>>> + FILE *tc;
>>> + int err;
>>> +
>>> + fifo_skel = bpf_qdisc_fifo__open_and_load();
>>> + if (!ASSERT_OK_PTR(fifo_skel, "bpf_qdisc_fifo__open_and_load"))
>>> + return;
>>> +
>>> + link = bpf_map__attach_struct_ops(fifo_skel->maps.fifo);
>>
>> fifo_skel->links.fifo = bpf_map__attach_struct_ops(....);
>>
>> Then no need to bpf_link__destroy(link). bpf_qdisc_fifo__destroy() should do.
>>
>
> I see. I assume it will also be okay to set autoattach and call
> bpf_qdisc_fifo__attach()?
Good point. bpf_qdisc_fifo__attach() will be even simpler. I thought the
autoattach is true by default. Please check.
next prev parent reply other threads:[~2025-05-02 19:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 22:30 [PATCH bpf-next/net v1 0/5] Fix bpf qdisc bugs and cleanup Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 1/5] bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc Amery Hung
2025-05-02 9:32 ` Simon Horman
2025-05-01 22:30 ` [PATCH bpf-next/net v1 2/5] selftests/bpf: Test setting and creating bpf qdisc " Amery Hung
2025-05-01 23:58 ` Martin KaFai Lau
2025-05-02 17:52 ` Amery Hung
2025-05-02 19:27 ` Martin KaFai Lau [this message]
2025-05-02 19:33 ` Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 3/5] bpf: net_sched: Make some Qdisc_ops ops mandatory Amery Hung
2025-05-02 0:13 ` Martin KaFai Lau
2025-05-01 22:30 ` [PATCH bpf-next/net v1 4/5] selftests/bpf: selftests/bpf: Test attaching a bpf qdisc with incomplete operators Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 5/5] selftests/bpf: Cleanup bpf qdisc selftests Amery Hung
2025-05-02 0:22 ` Martin KaFai Lau
2025-05-02 17:53 ` Amery Hung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ec91dcac-d2d0-4705-aca1-8cdc1954aa11@linux.dev \
--to=martin.lau@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.