From: Or Gerlitz <or.gerlitz@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Amir Vadai <amirv@mellanox.com>,
"David S. Miller" <davem@davemloft.net>,
Or Gerlitz <ogerlitz@mellanox.com>, Oren Duer <oren@mellanox.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v1 3/3] net/mlx4_en: Set number of rx/tx channels using ethtool
Date: Sat, 1 Dec 2012 17:50:09 +0200 [thread overview]
Message-ID: <CAJZOPZK98UOsK2HFSC3V6fdzvJfWVKg6pZzxptE97MTgOAk7-w@mail.gmail.com> (raw)
In-Reply-To: <1354319925.2640.3.camel@bwh-desktop.uk.solarflarecom.com>
On Sat, Dec 1, 2012 at 1:58 AM, Ben Hutchings <bhutchings@solarflare.com> wrote:
>
> On Thu, 2012-11-29 at 21:21 +0200, Amir Vadai wrote:
> > Add support to changing number of rx/tx channels using
> > ethtool ('ethtool -[lL]'). Where the number of tx channels specified in
> > ethtool
> > is the number of rings per user priority - not total number of tx rings.
> >
> > Signed-off-by: Amir Vadai <amirv@mellanox.com>
> > ---
> > drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 69
> > +++++++++++++++++++++++
> > drivers/net/ethernet/mellanox/mlx4/en_main.c | 2 +-
> > drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 26 +++++----
> > drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 +-
> > drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 8 ++-
> > 5 files changed, 93 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> > b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> > index dc8ccb4..681bc1b 100644
> > --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> > @@ -999,6 +999,73 @@ static int mlx4_en_set_rxnfc(struct net_device
> > *dev, struct ethtool_rxnfc *cmd)
> [...]
> > +static int mlx4_en_set_channels(struct net_device *dev,
> > + struct ethtool_channels *channel)
> > +{
> > + struct mlx4_en_priv *priv = netdev_priv(dev);
> > + struct mlx4_en_dev *mdev = priv->mdev;
> > + int port_up;
> > + int err = 0;
> > +
> > + if (channel->other_count || channel->combined_count ||
> > + channel->tx_count > channel->max_tx ||
> > + channel->rx_count > channel->max_rx ||
>
> The values of max_tx and max_rx are passed in from userland, so you
> can't trust them.
Is this a general statement re ethtool values passed from user space
or something specific here? can't one assume that the ethtool process
runs under the appropriate admin permission?
>> + !channel->tx_count || !channel->rx_count)
>> + return -EINVAL;
> [...]
next prev parent reply other threads:[~2012-12-01 15:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-29 19:21 [PATCH net-next v1 0/3] mlx4_en: set number of rx/tx channels using ethtool Amir Vadai
2012-11-29 19:21 ` [PATCH net-next v1 1/3] MAINTAINERS: Add Mellanox ethernet driver - mlx4_en Amir Vadai
2012-11-29 19:21 ` [PATCH net-next v1 2/3] net/mlx4_en: Fix TX moderation info loss after set_ringparam is called Amir Vadai
2012-11-29 19:21 ` [PATCH net-next v1 3/3] net/mlx4_en: Set number of rx/tx channels using ethtool Amir Vadai
2012-11-30 17:16 ` David Miller
2012-11-30 23:58 ` Ben Hutchings
2012-12-01 15:50 ` Or Gerlitz [this message]
2012-12-01 16:18 ` Ben Hutchings
2012-12-01 16:25 ` David Miller
2012-12-02 12:23 ` 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=CAJZOPZK98UOsK2HFSC3V6fdzvJfWVKg6pZzxptE97MTgOAk7-w@mail.gmail.com \
--to=or.gerlitz@gmail.com \
--cc=amirv@mellanox.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=oren@mellanox.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).