public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next 3/4] net/sched: switch tc_dump_qdisc() to for_each_netdev_dump()
Date: Wed, 29 Apr 2026 19:00:04 -0700	[thread overview]
Message-ID: <20260429190004.2bb674d4@kernel.org> (raw)
In-Reply-To: <20260428170414.250566-4-edumazet@google.com>

On Tue, 28 Apr 2026 17:04:13 +0000 Eric Dumazet wrote:
>  static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
>  {

> +	struct {
> +		unsigned long ifindex;
> +		int q_idx;
> +	} *ctx = (void *)cb->ctx;
> +	unsigned long s_ifindex;
> +	struct net_device *dev;
> +	int s_q_idx, q_idx;
>  	int err;
>  
> -	s_idx = cb->args[0];
> -	s_q_idx = q_idx = cb->args[1];
> -
> -	idx = 0;
>  	ASSERT_RTNL();
>  
>  	err = nlmsg_parse_deprecated(nlh, sizeof(struct tcmsg), tca, TCA_MAX,
> @@ -1896,42 +1896,40 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
>  	if (err < 0)
>  		return err;
>  
> -	for_each_netdev(net, dev) {
> +	s_ifindex = ctx->ifindex;
> +	s_q_idx = ctx->q_idx;
> +
> +	for_each_netdev_dump(net, dev, ctx->ifindex) {

compilers point out that s_ifindex is set but not used since we iterate
directly on ctx->ifindex
-- 
pw-bot: cr

  reply	other threads:[~2026-04-30  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 17:04 [PATCH v2 net-next 0/4] net/sched: tc_dump_qdisc() optimizations Eric Dumazet
2026-04-28 17:04 ` [PATCH v2 net-next 1/4] net/sched: propagate tc_fill_tclass() error Eric Dumazet
2026-04-28 17:04 ` [PATCH v2 net-next 2/4] net/sched: tc_dump_qdisc_root() refactor Eric Dumazet
2026-04-28 17:04 ` [PATCH v2 net-next 3/4] net/sched: switch tc_dump_qdisc() to for_each_netdev_dump() Eric Dumazet
2026-04-30  2:00   ` Jakub Kicinski [this message]
2026-04-30  2:16     ` Eric Dumazet
2026-04-28 17:04 ` [PATCH v2 net-next 4/4] net/sched: speedup tc_dump_qdisc() when tcm_ifindex is provided Eric Dumazet

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=20260429190004.2bb674d4@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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