Skip to content

bpf: net_sched: Fix using bpf qdisc as default qdisc #8827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,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;
}
Expand Down Expand Up @@ -237,7 +237,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);
default_qdisc_ops = ops;
}
write_unlock(&qdisc_mod_lock);
Expand Down
4 changes: 2 additions & 2 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,14 +1001,14 @@ struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
{
struct Qdisc *sch;

if (!try_module_get(ops->owner)) {
if (!bpf_try_module_get(ops, ops->owner)) {
NL_SET_ERR_MSG(extack, "Failed to increase module reference counter");
return NULL;
}

sch = qdisc_alloc(dev_queue, ops, extack);
if (IS_ERR(sch)) {
module_put(ops->owner);
bpf_module_put(ops, ops->owner);
return NULL;
}
sch->parent = parentid;
Expand Down
Loading