[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZY1ewk_H4QWmKz_T@shredder>
Date: Thu, 28 Dec 2023 13:40:50 +0200
From: Ido Schimmel <idosch@...sch.org>
To: Victor Nogueira <victor@...atatu.com>
Cc: jhs@...atatu.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, xiyou.wangcong@...il.com,
jiri@...nulli.us, mleitner@...hat.com, vladbu@...dia.com,
paulb@...dia.com, pctammela@...atatu.com, netdev@...r.kernel.org,
kernel@...atatu.com
Subject: Re: [PATCH net-next v8 1/5] net/sched: Introduce tc block netdev
tracking infra
On Tue, Dec 19, 2023 at 03:16:19PM -0300, Victor Nogueira wrote:
> +static int qdisc_block_add_dev(struct Qdisc *sch, struct net_device *dev,
> + struct netlink_ext_ack *extack)
> +{
> + const struct Qdisc_class_ops *cl_ops = sch->ops->cl_ops;
> + struct tcf_block *block;
> + int err;
> +
> + block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
> + if (block) {
> + err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
> + if (err) {
> + NL_SET_ERR_MSG(extack,
> + "ingress block dev insert failed");
> + return err;
> + }
> + }
> +
> + block = cl_ops->tcf_block(sch, TC_H_MIN_EGRESS, NULL);
> + if (block) {
> + err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
> + if (err) {
> + NL_SET_ERR_MSG(extack,
> + "Egress block dev insert failed");
> + goto err_out;
> + }
> + }
The following fails after this patch:
# tc qdisc add dev swp1 ingress
Error: Egress block dev insert failed.
Probably because ingress_tcf_block() ignores the 'cl' argument.
> +
> + return 0;
> +
> +err_out:
> + block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
> + if (block)
> + xa_erase(&block->ports, dev->ifindex);
> +
> + return err;
> +}
Powered by blists - more mailing lists