[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb4261f0-a5b7-4438-87f2-21207d86185d@gmail.com>
Date: Thu, 4 Jan 2024 10:06:06 -0800
From: Kui-Feng Lee <sinquersw@...il.com>
To: Victor Nogueira <victor@...atatu.com>, jhs@...atatu.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, xiyou.wangcong@...il.com, jiri@...nulli.us
Cc: idosch@...sch.org, mleitner@...hat.com, vladbu@...dia.com,
paulb@...dia.com, pctammela@...atatu.com, netdev@...r.kernel.org,
kernel@...atatu.com, syzbot+84339b9e7330daae4d66@...kaller.appspotmail.com,
syzbot+806b0572c8d06b66b234@...kaller.appspotmail.com,
syzbot+0039110f932d438130f9@...kaller.appspotmail.com
Subject: Re: [PATCH net-next v2 1/1] net/sched: We should only add appropriate
qdiscs blocks to ports' xarray
On 12/31/23 09:23, Victor Nogueira wrote:
> We should only add qdiscs to the blocks ports' xarray in ingress that
> support ingress_block_set/get or in egress that support
> egress_block_set/get.
>
> Fixes: 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra")
> Signed-off-by: Victor Nogueira <victor@...atatu.com>
> Reviewed-by: Jamal Hadi Salim <jhs@...atatu.com>
> Reported-by: Ido Schimmel <idosch@...dia.com>
> Closes: https://lore.kernel.org/all/ZY1hBb8GFwycfgvd@shredder/
> Tested-by: Ido Schimmel <idosch@...dia.com>
> Reported-and-tested-by: syzbot+84339b9e7330daae4d66@...kaller.appspotmail.com
> Closes: https://lore.kernel.org/all/0000000000007c85f5060dcc3a28@google.com/
> Reported-and-tested-by: syzbot+806b0572c8d06b66b234@...kaller.appspotmail.com
> Closes: https://lore.kernel.org/all/00000000000082f2f2060dcc3a92@google.com/
> Reported-and-tested-by: syzbot+0039110f932d438130f9@...kaller.appspotmail.com
> Closes: https://lore.kernel.org/all/0000000000007fbc8c060dcc3a5c@google.com/
> ---
> v1 -> v2:
>
> - Remove newline between fixes tag and Signed-off-by tag
> - Add Ido's Reported-by and Tested-by tags
> - Add syzbot's Reported-and-tested-by tags
>
> net/sched/sch_api.c | 34 ++++++++++++++++++++--------------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 299086bb6205..426be81276f1 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1187,23 +1187,29 @@ static int qdisc_block_add_dev(struct Qdisc *sch, struct net_device *dev,
> 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;
> + if (sch->ops->ingress_block_get) {
> + 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;
> + if (sch->ops->egress_block_get) {
> + 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;
> + }
> }
> }
>
Hi Vector,
Thank you for fixing this issue!
Could you also add a test case to avoid regression in future?
We have BPF test cases that fails for this issue. However,
not everyone run BPF selftest for netdev changes.
It would be better to have a test case for net as well.
Powered by blists - more mailing lists