netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Stanislav Fomichev <sdf@fomichev.me>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Saeed Mahameed <saeed@kernel.org>
Subject: Re: [PATCH net-next v10 03/14] net: sched: wrap doit/dumpit methods
Date: Mon, 3 Mar 2025 07:33:49 -0800	[thread overview]
Message-ID: <Z8XL3T8sOM43BnEc@mini-arch> (raw)
In-Reply-To: <CAM0EoM=jOWv+xmDx_+=_Cq2t5S731b3uny=DWrVX4nba3yjv7w@mail.gmail.com>

On 03/02, Jamal Hadi Salim wrote:
> On Sat, Mar 1, 2025 at 7:09 PM Stanislav Fomichev <sdf@fomichev.me> wrote:
> >
> > In preparation for grabbing netdev instance lock around qdisc
> > operations, introduce tc_xxx wrappers that lookup netdev
> > and call respective __tc_xxx helper to do the actual work.
> > No functional changes.
> >
> > Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> > Cc: Cong Wang <xiyou.wangcong@gmail.com>
> > Cc: Jiri Pirko <jiri@resnulli.us>
> > Cc: Saeed Mahameed <saeed@kernel.org>
> > Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> > ---
> >  net/sched/sch_api.c | 190 ++++++++++++++++++++++++++++----------------
> >  1 file changed, 122 insertions(+), 68 deletions(-)
> >
> > diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> > index e3e91cf867eb..e0be3af4daa9 100644
> > --- a/net/sched/sch_api.c
> > +++ b/net/sched/sch_api.c
> > @@ -1505,27 +1505,18 @@ const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = {
> >   * Delete/get qdisc.
> >   */
> >
> [..]
> > +static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
> > +                          struct netlink_ext_ack *extack)
> > +{
> > +       struct net *net = sock_net(skb->sk);
> > +       struct tcmsg *tcm = nlmsg_data(n);
> > +       struct nlattr *tca[TCA_MAX + 1];
> > +       struct net_device *dev;
> > +       bool replay;
> > +       int err;
> > +
> > +replay:
> 
> For 1-1 mapping to original code, the line:
> struct tcmsg *tcm = nlmsg_data(n);
> 
> Should move below the replay goto..

Since nlmsg_data is just doing pointer arithmetics and the (pointer) argument
doesn't change I was assuming it's ok to reshuffle to make
tc_get_qdisc and tc_modify_qdisc look more consistent. LMK if you
disagree, happy to move them back.


> Other than that:
> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>

Thank you for the review!

  reply	other threads:[~2025-03-03 15:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-02  0:08 [PATCH net-next v10 00/14] net: Hold netdev instance lock during ndo operations Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 01/14] net: hold netdev instance lock during ndo_open/ndo_stop Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 02/14] net: hold netdev instance lock during nft ndo_setup_tc Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 03/14] net: sched: wrap doit/dumpit methods Stanislav Fomichev
2025-03-02 20:49   ` Jamal Hadi Salim
2025-03-03 15:33     ` Stanislav Fomichev [this message]
2025-03-04 16:43       ` Jamal Hadi Salim
2025-03-04 20:53         ` Cong Wang
2025-03-02  0:08 ` [PATCH net-next v10 04/14] net: hold netdev instance lock during qdisc ndo_setup_tc Stanislav Fomichev
2025-03-02 20:56   ` Jamal Hadi Salim
2025-03-03 15:35     ` Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 05/14] net: hold netdev instance lock during queue operations Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 06/14] net: hold netdev instance lock during rtnetlink operations Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 07/14] net: hold netdev instance lock during ioctl operations Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 08/14] net: hold netdev instance lock during sysfs operations Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 09/14] net: hold netdev instance lock during ndo_bpf Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 10/14] net: ethtool: try to protect all callback with netdev instance lock Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 11/14] net: replace dev_addr_sem " Stanislav Fomichev
2025-03-02  0:08 ` [PATCH net-next v10 12/14] net: add option to request " Stanislav Fomichev
2025-03-02  0:09 ` [PATCH net-next v10 13/14] docs: net: document new locking reality Stanislav Fomichev
2025-03-02  0:09 ` [PATCH net-next v10 14/14] eth: bnxt: remove most dependencies on RTNL Stanislav Fomichev
2025-03-03  4:22 ` [PATCH net-next v10 00/14] net: Hold netdev instance lock during ndo operations Lei Yang
  -- strict thread matches above, loose matches on Subject: below --
2025-03-05 16:37 Stanislav Fomichev
2025-03-05 16:37 ` [PATCH net-next v10 03/14] net: sched: wrap doit/dumpit methods Stanislav Fomichev

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=Z8XL3T8sOM43BnEc@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeed@kernel.org \
    --cc=sdf@fomichev.me \
    --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;
as well as URLs for NNTP newsgroup(s).