netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
To: Tariq Toukan <tariqt@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eran Ben Elisha <eranbe@mellanox.com>
Subject: Re: [PATCH net-next 3/3] net/mlx4_core: Use msi_x module param to limit num of MSI-X irqs
Date: Wed, 9 May 2018 12:29:39 -0700	[thread overview]
Message-ID: <5AF34C23.80501@oracle.com> (raw)
In-Reply-To: <1525879744-1858-4-git-send-email-tariqt@mellanox.com>

Thanks Tariq.

Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>

On 05/09/2018 08:29 AM, Tariq Toukan wrote:
> Extend the boolean interpretation of msi_x module parameter
> to numerical, as follows:
>
> 0   - Don't use MSI-X.
> 1   - Use MSI-X, driver decides the num of MSI-X irqs.
>> =2 - Use MSI-X, limit number of MSI-X irqs to msi_x.
>        In SRIOV, this limits the number of MSI-X irqs per VF.
>
> Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
> Cc: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/main.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index b6aaf34d6648..80a75c80a463 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -73,7 +73,7 @@
>   
>   static int msi_x = 1;
>   module_param(msi_x, int, 0444);
> -MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");
> +MODULE_PARM_DESC(msi_x, "0 - don't use MSI-X, 1 - use MSI-X, >1 - limit number of MSI-X irqs to msi_x");
>   
>   #else /* CONFIG_PCI_MSI */
>   
> @@ -2815,6 +2815,9 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
>   				dev->caps.num_eqs - dev->caps.reserved_eqs,
>   				MAX_MSIX);
>   
> +		if (msi_x > 1)
> +			nreq = min_t(int, nreq, msi_x);
> +
>   		entries = kcalloc(nreq, sizeof(*entries), GFP_KERNEL);
>   		if (!entries)
>   			goto no_msi;
> @@ -4182,6 +4185,11 @@ static int mlx4_resume(struct pci_dev *pdev)
>   
>   static int __init mlx4_verify_params(void)
>   {
> +	if (msi_x < 0) {
> +		pr_warn("mlx4_core: bad msi_x: %d\n", msi_x);
> +		return -1;
> +	}
> +
>   	if ((log_num_mac < 0) || (log_num_mac > 7)) {
>   		pr_warn("mlx4_core: bad num_mac: %d\n", log_num_mac);
>   		return -1;

  reply	other threads:[~2018-05-09 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 15:29 [PATCH net-next 0/3] mlx4_core misc for 4.18 Tariq Toukan
2018-05-09 15:29 ` [PATCH net-next 1/3] net/mlx4_core: Report driver version to FW Tariq Toukan
2018-05-09 15:29 ` [PATCH net-next 2/3] net/mlx4_core: Add PCI calls for suspend/resume Tariq Toukan
2018-05-09 15:29 ` [PATCH net-next 3/3] net/mlx4_core: Use msi_x module param to limit num of MSI-X irqs Tariq Toukan
2018-05-09 19:29   ` Ajaykumar Hotchandani [this message]
2018-05-10 20:09 ` [PATCH net-next 0/3] mlx4_core misc for 4.18 David Miller

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=5AF34C23.80501@oracle.com \
    --to=ajaykumar.hotchandani@oracle.com \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@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).