All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leandro Dorileo <l@dorileo.org>
To: Cong Wang <xiyou.wangcong@gmail.com>,
	Leandro Dorileo <leandro.maciel.dorileo@intel.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	vedang.patel@intel.com, andre.guedes@intel.com
Subject: Re: [PATCH net V5 1/2] net/sched: taprio: fix picos_per_byte miscalculation
Date: Fri, 29 Mar 2019 12:20:24 -0700	[thread overview]
Message-ID: <87bm1t1o93.fsf@intel.com> (raw)
In-Reply-To: <CAM_iQpWgLzm1ckzVQSGWqs1Qv4GBRy-hDKd48cgC6CCKDQjoFA@mail.gmail.com>


Hi,


Cong Wang <xiyou.wangcong@gmail.com> writes:

> On Thu, Mar 28, 2019 at 5:20 PM Leandro Dorileo
> <leandro.maciel.dorileo@intel.com> wrote:
>> +static int taprio_dev_notifier(struct notifier_block *nb, unsigned long event,
>> +                              void *ptr)
>> +{
>> +       struct net_device *dev = netdev_notifier_info_to_dev(ptr);
>> +       struct taprio_sched *q;
>> +       struct net_device *qdev;
>> +
>> +       ASSERT_RTNL();
>> +
>> +       if (event != NETDEV_UP && event != NETDEV_CHANGE)
>> +               return NOTIFY_DONE;
>> +
>> +       spin_lock(&taprio_list_lock);
>> +       list_for_each_entry(q, &taprio_list, taprio_list) {
>> +               qdev = qdisc_dev(q->root);
>> +               if (qdev == dev) {
>> +                       taprio_set_picos_per_byte(dev, q);
>> +                       break;
>
> Is it safe to call __ethtool_get_link_ksettings() with spinlock held?
> I mean is it blocking?
>
> Please audit all the dev->ethtool_ops->get_link_ksettings(),
> I just look at a few of them, it seems good.

Yep, you're right. There are some get_link_ksettings implementations that will lock
a mutex. I'm changing the implementation to avoid that.

Thanks for catching this up.

--
Dorileo

  reply	other threads:[~2019-03-29 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  0:19 [PATCH net V5 0/2] net/sched: taprio: fix picos_per_byte miscalculation Leandro Dorileo
2019-03-29  0:19 ` [PATCH net V5 1/2] " Leandro Dorileo
2019-03-29  1:12   ` Cong Wang
2019-03-29 19:20     ` Leandro Dorileo [this message]
2019-03-29 20:46   ` kbuild test robot
2019-03-30  6:19   ` kbuild test robot
2019-03-29  0:19 ` [PATCH net V5 2/2] net/sched: cbs: fix port_rate miscalculation Leandro Dorileo

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=87bm1t1o93.fsf@intel.com \
    --to=l@dorileo.org \
    --cc=andre.guedes@intel.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=leandro.maciel.dorileo@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=vedang.patel@intel.com \
    --cc=vinicius.gomes@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.