mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: "linux-xtensa@linux-xtensa.org" <linux-xtensa@linux-xtensa.org>,
	netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Chris Zankel <chris@zankel.net>, Marc Gauthier <marc@cadence.com>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH v2 4/4] net: ethoc: implement ethtool operations
Date: Thu, 30 Jan 2014 14:04:53 +0000	[thread overview]
Message-ID: <1391090693.4405.64.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <CAMo8Bf+9A-yh-_EBmZeJqMhUKrHN5+BPtckFj_gnZ44tfnX__w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

On Thu, 2014-01-30 at 07:04 +0400, Max Filippov wrote:
> On Thu, Jan 30, 2014 at 5:59 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Wed, 2014-01-29 at 10:00 +0400, Max Filippov wrote:
[...]
> >> +     priv->num_tx = rounddown_pow_of_two(ring->tx_pending);
> >
> > Range check?
> 
> May there be requested more than ring->tx_max_pending that we
> indicated in the get_ringparam?

Yes, the ethtool core doesn't check that for you.

> >> +     priv->num_rx = priv->num_bd - priv->num_tx;
> >> +     if (priv->num_rx > ring->rx_pending)
> >> +             priv->num_rx = ring->rx_pending;
> >
> > So the RX ring may only ever be shrunk?!  Did you mean to compare with
> > priv->num_bd instead?
> 
> First all non-TX descriptors are made RX, and if that's more than user
> requested I trim it.
[...]

OK, I get it.  But it would be clearer if you used min().

Ben.

-- 
Ben Hutchings
It is a miracle that curiosity survives formal education. - Albert Einstein

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2014-01-30 14:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  6:00 [PATCH v2 0/4] Max Filippov
2014-01-29  6:00 ` [PATCH v2 1/4] phy: provide accessors for 'advertising' and 'supported' fields Max Filippov
2014-01-29 17:14   ` Florian Fainelli
2014-01-29  6:00 ` [PATCH v2 2/4] net: ethoc: don't advertise gigabit speed on attached PHY Max Filippov
2014-01-29  6:47   ` Florian Fainelli
2014-01-29  7:01     ` Max Filippov
     [not found]       ` <CAGVrzcboHp8-qHZseGOVm14u1-cTcOjRZGExFxNu_nbK__XCSA@mail.gmail.com>
2014-01-29 18:32         ` Max Filippov
2014-01-31  6:07           ` Max Filippov
2014-02-01  0:40             ` Florian Fainelli
2014-02-01  0:54               ` Florian Fainelli
2014-02-01  1:10                 ` Max Filippov
2014-02-01  1:36                   ` Florian Fainelli
2014-01-29  6:00 ` [PATCH v2 3/4] net: ethoc: set up MII management bus clock Max Filippov
2014-01-29  7:01   ` Florian Fainelli
2014-01-30  0:14     ` Max Filippov
2014-01-29  6:00 ` [PATCH v2 4/4] net: ethoc: implement ethtool operations Max Filippov
2014-01-29  6:52   ` Florian Fainelli
2014-01-30  1:59   ` Ben Hutchings
2014-01-30  3:04     ` Max Filippov
2014-01-30 14:04       ` Ben Hutchings [this message]

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=1391090693.4405.64.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=marc@cadence.com \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®