From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
linux-rdma@vger.kernel.org, Mark Zhang <markz@mellanox.com>
Subject: [PATCH rdma-next 2/3] RDMA/mlx5: Don't rely on FW to set zeros in ECE response
Date: Tue, 2 Jun 2020 15:55:47 +0300 [thread overview]
Message-ID: <20200602125548.172654-3-leon@kernel.org> (raw)
In-Reply-To: <20200602125548.172654-1-leon@kernel.org>
From: Leon Romanovsky <leonro@mellanox.com>
The FW returns zeros in case feature is not enabled, but it is better
to have the capability check and ensure that returned result is cleared.
Fixes: 3e09a427ae7a ("RDMA/mlx5: Get ECE options from FW during create QP")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/hw/mlx5/qp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index e8427231cf15..494e305cf761 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1906,7 +1906,8 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
base->container_mibqp = qp;
base->mqp.event = mlx5_ib_qp_event;
- params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
+ if (MLX5_CAP_GEN(mdev, ece_support))
+ params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
spin_lock_irqsave(&dev->reset_flow_resource_lock, flags);
list_add_tail(&qp->qps_list, &dev->qp_list);
@@ -2082,7 +2083,8 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
base->container_mibqp = qp;
base->mqp.event = mlx5_ib_qp_event;
- params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
+ if (MLX5_CAP_GEN(mdev, ece_support))
+ params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
get_cqs(qp->type, init_attr->send_cq, init_attr->recv_cq,
&send_cq, &recv_cq);
--
2.26.2
next prev parent reply other threads:[~2020-06-02 12:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 12:55 [PATCH rdma-next 0/3] mlx5 ECE fixes DC ECE code Leon Romanovsky
2020-06-02 12:55 ` [PATCH rdma-next 1/3] RDMA/mlx5: Return an error if copy_to_user fails Leon Romanovsky
2020-06-02 12:55 ` Leon Romanovsky [this message]
2020-06-02 12:55 ` [PATCH mlx5-next 3/3] RDMA/mlx5: Return ECE DC support Leon Romanovsky
2020-06-03 18:48 ` [PATCH rdma-next 0/3] mlx5 ECE fixes DC ECE code Jason Gunthorpe
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=20200602125548.172654-3-leon@kernel.org \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=markz@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 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.