All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "YU, Xiangning" <xiangning.yu@alibaba-inc.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc
Date: Mon, 6 Jul 2020 11:32:08 -0700	[thread overview]
Message-ID: <20200706113208.672ce199@hermes.lan> (raw)
In-Reply-To: <28bff9d7-fa2d-5284-f6d5-e08cd792c9c6@alibaba-inc.com>

On Tue, 07 Jul 2020 02:08:13 +0800
"YU, Xiangning" <xiangning.yu@alibaba-inc.com> wrote:

> +static inline s64 get_linkspeed(struct net_device *dev)

This is not performance sensitive and should not be marked inline.


> +{
> +	struct ethtool_link_ksettings ecmd;
> +
> +	ASSERT_RTNL();
> +	if (netif_running(dev) && !__ethtool_get_link_ksettings(dev, &ecmd))
> +		/* Convert to bytes per second */
> +		return ecmd.base.speed * 1000 * 1000L / 8;

You need to be more careful in handling of devices that return unknown for speed.

> +	return 0;
> +}
> +

  reply	other threads:[~2020-07-06 18:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 18:08 [PATCH net-next 2/2] net: sched: Lockless Token Bucket (LTB) Qdisc YU, Xiangning
2020-07-06 18:32 ` Stephen Hemminger [this message]
2020-07-06 18:37 ` Stephen Hemminger
2020-07-06 19:56   ` YU, Xiangning
2020-07-06 20:10 ` Cong Wang
2020-07-06 20:34   ` YU, Xiangning
2020-07-07 20:06     ` Cong Wang
2020-07-07 21:24       ` YU, Xiangning
2020-07-08 20:24         ` Cong Wang
2020-07-08 21:07           ` YU, Xiangning
2020-07-10  5:04             ` Cong Wang
2020-07-10  5:20               ` Cong Wang
2020-07-10  6:06                 ` YU, Xiangning
2020-07-10  6:21                   ` Cong Wang
2020-07-10 18:01                     ` YU, Xiangning
2020-07-10  5:48               ` YU, Xiangning
2020-07-10  6:09                 ` Cong Wang
2020-07-10 17:03                   ` YU, Xiangning
2020-07-06 20:29 ` David Miller
2020-07-06 22:08   ` YU, Xiangning
2020-07-07 15:42 ` kernel test robot
2020-07-07 15:42   ` kernel test robot

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=20200706113208.672ce199@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiangning.yu@alibaba-inc.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.