[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ae064b92-1d9d-47a8-ac26-1172076e5bcb@linux.dev>
Date: Tue, 29 Apr 2025 10:29:48 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Amery Hung <ameryhung@...il.com>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
alexei.starovoitov@...il.com, andrii@...nel.org, daniel@...earbox.net,
martin.lau@...nel.org, xiyou.wangcong@...il.com, kernel-team@...a.com
Subject: Re: [PATCH bpf-next/net] bpf: net_sched: Fix using bpf qdisc as
default qdisc
On 4/22/25 3:58 PM, Amery Hung wrote:
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index db6330258dda..1cda7e7feb32 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -208,7 +208,7 @@ static struct Qdisc_ops *qdisc_lookup_default(const char *name)
>
> for (q = qdisc_base; q; q = q->next) {
> if (!strcmp(name, q->id)) {
> - if (!try_module_get(q->owner))
> + if (!bpf_try_module_get(q, q->owner))
> q = NULL;
> break;
> }
> @@ -238,7 +238,7 @@ int qdisc_set_default(const char *name)
>
> if (ops) {
> /* Set new default */
> - module_put(default_qdisc_ops->owner);
> + bpf_module_put(ops, default_qdisc_ops->owner);
The first arg, should it be the "default_qdisc_ops" instead?
> default_qdisc_ops = ops;
> }
> write_unlock(&qdisc_mod_lock);
Powered by blists - more mailing lists