From: Alexey Kardashevskiy <aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
To: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH net-next] net/mlx4_core: Fix backward compatibility on VFs
Date: Fri, 18 Mar 2016 20:45:19 +1100 [thread overview]
Message-ID: <56EBCE2F.40902@ozlabs.ru> (raw)
In-Reply-To: <1458233382-12871-1-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On 03/18/2016 03:49 AM, Eli Cohen wrote:
> Commit 85743f1eb345 ("net/mlx4_core: Set UAR page size to 4KB regardless
> of system page size") introduced dependency where old VF drivers without
> this fix fail to load if the PF driver runs with this commit.
>
> To resolve this add a module parameter which disables that functionality
> by default. If both the PF and VFs are running with a driver with that
> commit the administrator may set the module param to true.
>
> The module parameter is called enable_4k_uar.
>
> Fixes: 85743f1eb345 ('net/mlx4_core: Set UAR page size to 4KB ...')
> Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Thanks!
Tested-by: Alexey Kardashevskiy <aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
> ---
> drivers/net/ethernet/mellanox/mlx4/main.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 503ec23e84cc..358f7230da58 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -105,6 +105,11 @@ module_param(enable_64b_cqe_eqe, bool, 0444);
> MODULE_PARM_DESC(enable_64b_cqe_eqe,
> "Enable 64 byte CQEs/EQEs when the FW supports this (default: True)");
>
> +static bool enable_4k_uar;
> +module_param(enable_4k_uar, bool, 0444);
> +MODULE_PARM_DESC(enable_4k_uar,
> + "Enable using 4K UAR. Should not be enabled if have VFs which do not support 4K UARs (default: false)");
> +
> #define PF_CONTEXT_BEHAVIOUR_MASK (MLX4_FUNC_CAP_64B_EQE_CQE | \
> MLX4_FUNC_CAP_EQE_CQE_STRIDE | \
> MLX4_FUNC_CAP_DMFS_A0_STATIC)
> @@ -423,7 +428,11 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
> /* Virtual PCI function needs to determine UAR page size from
> * firmware. Only master PCI function can set the uar page size
> */
> - dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
> + if (enable_4k_uar)
> + dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
> + else
> + dev->uar_page_shift = PAGE_SHIFT;
> +
> mlx4_set_num_reserved_uars(dev, dev_cap);
> }
>
> @@ -2233,11 +2242,14 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
>
> dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
>
> - /* Always set UAR page size 4KB, set log_uar_sz accordingly */
> - init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
> - PAGE_SHIFT -
> - DEFAULT_UAR_PAGE_SHIFT;
> - init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
> + if (enable_4k_uar) {
> + init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
> + PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT;
> + init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;
> + } else {
> + init_hca.log_uar_sz = ilog2(dev->caps.num_uars);
> + init_hca.uar_page_sz = PAGE_SHIFT - 12;
> + }
>
> init_hca.mw_enabled = 0;
> if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW ||
>
--
Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-03-18 9:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 16:49 [PATCH net-next] net/mlx4_core: Fix backward compatibility on VFs Eli Cohen
[not found] ` <1458233382-12871-1-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-03-18 9:45 ` Alexey Kardashevskiy [this message]
[not found] ` <56EBCE2F.40902-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
2016-03-21 5:02 ` Alexey Kardashevskiy
[not found] ` <56EF8058.2060203-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
2016-03-21 13:56 ` Eli Cohen
[not found] ` <20160321135630.GA95906-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2016-03-22 1:24 ` Alexey Kardashevskiy
2016-03-19 3:11 ` David Miller
[not found] ` <20160318.231106.2099055485546956238.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2016-03-20 7:07 ` Yuval Shaia
2016-03-20 7:07 ` Yuval Shaia
2016-03-20 7:21 ` 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=56EBCE2F.40902@ozlabs.ru \
--to=aik-slphqdys0b2hxe+lvdladg@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.