BPF List
 help / color / mirror / Atom feed
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] bpf: net_sched: Fix using bpf qdisc as default qdisc
Date: Tue, 29 Apr 2025 10:29:48 -0700	[thread overview]
Message-ID: <ae064b92-1d9d-47a8-ac26-1172076e5bcb@linux.dev> (raw)
In-Reply-To: <20250422225808.3900221-1-ameryhung@gmail.com>

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);

  parent reply	other threads:[~2025-04-29 17:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 22:58 [PATCH bpf-next/net] bpf: net_sched: Fix using bpf qdisc as default qdisc Amery Hung
2025-04-23 23:20 ` Cong Wang
2025-04-29 17:29 ` Martin KaFai Lau [this message]
2025-04-29 17:37   ` 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=ae064b92-1d9d-47a8-ac26-1172076e5bcb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox