All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: dev@dpdk.org, Nelio Laranjeiro <nelio.laranjeiro@6wind.com>,
	"Legacy, Allain" <Allain.Legacy@windriver.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH 1/1] net/mlx4: add port parameter
Date: Thu, 16 Mar 2017 12:04:09 +0100	[thread overview]
Message-ID: <20170316110409.GO3790@6wind.com> (raw)
In-Reply-To: <f49bbc965816575b851b22ba3cbcd657a847d9b2.1488550887.git.gaetan.rivet@6wind.com>

On Fri, Mar 03, 2017 at 04:40:06PM +0100, Gaetan Rivet wrote:
> Most ConnectX-3 adapters expose two physical ports on a single PCI bus
> address.
> 
> Add a new port parameter allowing the user to choose
> either or both physical ports to be used by the application.
> 
> This parameter is used as follows:
> 
> Selecting only the second port:
>    -w 00:00.0,port=1
> 
> Selecting both ports:
>    -w 00:00.0,port=0,port=1
> 
> If no parameter is given, the default behavior is unchanged: all ports
> are probed.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

I think this patch is good as is. Whatever value results from users
specifying random characters as argument to the port parameter is their
problem, as long as the resulting value is verified to be within bounds,
it's fine.

I'm not saying that checking all possible failure modes of strtoul() is
useless, just that it seems overkill in this specific case. Using atoi()
without any error checking would have been perfectly fine as well.

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

  parent reply	other threads:[~2017-03-16 11:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 15:40 [PATCH 1/1] net/mlx4: add port parameter Gaetan Rivet
2017-03-10 16:24 ` Legacy, Allain
2017-03-10 16:34   ` Stephen Hemminger
2017-03-10 17:11   ` Gaëtan Rivet
2017-03-10 17:49     ` Gaëtan Rivet
2017-03-11 11:32     ` Legacy, Allain
2017-03-16 11:04 ` Adrien Mazarguil [this message]
2017-03-20 13:24   ` Ferruh Yigit
2017-03-20 13:56     ` Adrien Mazarguil
2017-03-27 15:08 ` Ferruh Yigit
2017-03-27 15:46   ` Gaëtan Rivet
2017-03-27 15:41 ` [PATCH v2 " Gaetan Rivet
2017-03-27 16:42   ` Ferruh Yigit

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=20170316110409.GO3790@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=Allain.Legacy@windriver.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=stephen@networkplumber.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 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.