All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Devesh Sharma <devesh.sharma@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [for-next 1/2] RDMA/bnxt_re: Enable global atomic ops if platform supports
Date: Thu, 20 May 2021 10:50:32 +0300	[thread overview]
Message-ID: <YKYUyPOfeER2FVGD@unreal> (raw)
In-Reply-To: <20210517132522.774762-2-devesh.sharma@broadcom.com>

On Mon, May 17, 2021 at 06:55:21PM +0530, Devesh Sharma wrote:
> Enabling Atomic operations for Gen P5 devices if the underlying
> platform supports global atomic ops.
> 
> Fixes:7ff662b76167 ("Disable atomic capability on bnxt_re adapters")
> Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
> ---
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c  |  4 ++++
>  drivers/infiniband/hw/bnxt_re/main.c      |  4 ++++
>  drivers/infiniband/hw/bnxt_re/qplib_res.c | 15 +++++++++++++++
>  drivers/infiniband/hw/bnxt_re/qplib_res.h |  1 +
>  drivers/infiniband/hw/bnxt_re/qplib_sp.c  | 13 ++++++++++++-
>  drivers/infiniband/hw/bnxt_re/qplib_sp.h  |  2 --
>  6 files changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index 2efaa80bfbd2..8194ac52a484 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -163,6 +163,10 @@ int bnxt_re_query_device(struct ib_device *ibdev,
>  	ib_attr->max_qp_init_rd_atom = dev_attr->max_qp_init_rd_atom;
>  	ib_attr->atomic_cap = IB_ATOMIC_NONE;
>  	ib_attr->masked_atomic_cap = IB_ATOMIC_NONE;
> +	if (dev_attr->is_atomic) {
> +		ib_attr->atomic_cap = IB_ATOMIC_GLOB;
> +		ib_attr->masked_atomic_cap = IB_ATOMIC_GLOB;
> +	}
>  
>  	ib_attr->max_ee_rd_atom = 0;
>  	ib_attr->max_res_rd_atom = 0;
> diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
> index 8bfbf0231a9e..e91e987b7861 100644
> --- a/drivers/infiniband/hw/bnxt_re/main.c
> +++ b/drivers/infiniband/hw/bnxt_re/main.c
> @@ -128,6 +128,10 @@ static int bnxt_re_setup_chip_ctx(struct bnxt_re_dev *rdev, u8 wqe_mode)
>  	rdev->rcfw.res = &rdev->qplib_res;
>  
>  	bnxt_re_set_drv_mode(rdev, wqe_mode);
> +	if (bnxt_qplib_enable_atomic_ops_to_root(en_dev->pdev))
> +		ibdev_info(&rdev->ibdev,
> +			   "platform doesn't support global atomics.");
> +
>  	return 0;
>  }
>  
> diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c
> index 3ca47004b752..d2efb295e0f6 100644
> --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c
> +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c
> @@ -959,3 +959,18 @@ int bnxt_qplib_alloc_res(struct bnxt_qplib_res *res, struct pci_dev *pdev,
>  	bnxt_qplib_free_res(res);
>  	return rc;
>  }
> +
> +bool bnxt_qplib_enable_atomic_ops_to_root(struct pci_dev *dev)

Why do you need open-coded variant of pci_enable_atomic_ops_to_root()?

Thanks

  reply	other threads:[~2021-05-20  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 13:25 [for-next 0/2] Broadcom's driver add global atomics Devesh Sharma
2021-05-17 13:25 ` [for-next 1/2] RDMA/bnxt_re: Enable global atomic ops if platform supports Devesh Sharma
2021-05-20  7:50   ` Leon Romanovsky [this message]
2021-05-21 12:50     ` Devesh Sharma
2021-06-01 11:25       ` Leon Romanovsky
2021-06-01 14:15         ` Devesh Sharma
2021-06-01 14:47           ` Leon Romanovsky
2021-05-17 13:25 ` [for-next 2/2] bnxt_re: Update maintainers list Devesh Sharma

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=YKYUyPOfeER2FVGD@unreal \
    --to=leon@kernel.org \
    --cc=devesh.sharma@broadcom.com \
    --cc=linux-rdma@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 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.