public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox•com>
To: David Miller <davem@davemloft•net>
Cc: <john.r.fastabend@intel•com>, <netdev@vger•kernel.org>,
	<amirv@mellanox•com>, <idos@mellanox•com>, <matanb@mellanox•com>
Subject: Re: [PATCH net-next V1 1/3] net: Add max rate tx queue attribute
Date: Sun, 15 Mar 2015 09:41:54 +0200	[thread overview]
Message-ID: <550537C2.3080107@mellanox.com> (raw)
In-Reply-To: <20150315.010727.1396856705582316764.davem@davemloft.net>

On 3/15/2015 7:07 AM, David Miller wrote:
> From: Or Gerlitz <ogerlitz@mellanox•com>
> Date: Thu, 12 Mar 2015 10:53:23 +0200
>
>> +	if (dev->netdev_ops->ndo_set_tx_maxrate) {
>> +		err = dev->netdev_ops->ndo_set_tx_maxrate(dev, index, rate);
>> +	} else {
>> +		rtnl_unlock();
>> +		return -EOPNOTSUPP;
>> +	}
>> +
>> +	rtnl_unlock();
>> +	if (!err) {
>> +		queue->tx_maxrate = rate;
>> +		return len;
>> +	}
> This is more succinctly expressed as:
>
> 	err = -EOPNOTSUPP;
> 	if (dev->netdev_ops->ndo_set_tx_maxrate) {
> 		err = dev->netdev_ops->ndo_set_tx_maxrate(dev, index, rate);
> 	if (!err) {
> 		queue->tx_maxrate = rate;
> 		return len;
> 	}
> 	return err;
>

sure, I'll fix that.

  reply	other threads:[~2015-03-15  7:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12  8:53 [PATCH net-next V1 0/3] Add max rate TXQ attribute Or Gerlitz
2015-03-12  8:53 ` [PATCH net-next V1 1/3] net: Add max rate tx queue attribute Or Gerlitz
2015-03-15  5:07   ` David Miller
2015-03-15  7:41     ` Or Gerlitz [this message]
2015-03-16 20:01       ` Florian Fainelli
2015-03-16 21:37         ` Tom Herbert
2015-03-12  8:53 ` [PATCH net-next V1 2/3] net/mlx4_core: Add basic support for QP max-rate limiting Or Gerlitz
2015-03-12  8:53 ` [PATCH net-next V1 3/3] net/mlx4_en: Add tx queue maxrate support Or Gerlitz

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=550537C2.3080107@mellanox.com \
    --to=ogerlitz@mellanox$(echo .)com \
    --cc=amirv@mellanox$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=idos@mellanox$(echo .)com \
    --cc=john.r.fastabend@intel$(echo .)com \
    --cc=matanb@mellanox$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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