Thread (40 messages) 40 messages, 5 authors, 2018-09-20

Re: [PATCH mlx5-next 03/25] net/mlx5: Set uid as part of RQ commands

From: Jason Gunthorpe <jgg@ziepe.ca>
Date: 2018-09-20 02:50:22
Also in: linux-rdma

On Wed, Sep 19, 2018 at 11:40:45AM -0700, Saeed Mahameed wrote:
On Wed, Sep 19, 2018 at 10:28 AM Jason Gunthorpe [off-list ref] wrote:
quoted
On Mon, Sep 17, 2018 at 02:03:56PM +0300, Leon Romanovsky wrote:
quoted
From: Yishai Hadas <redacted>

Set uid as part of RQ commands so that the firmware can manage the
RQ object in a secured way.

That will enable using an RQ that was created by verbs application
to be used by the DEVX flow in case the uid is equal.

Signed-off-by: Yishai Hadas <redacted>
Signed-off-by: Leon Romanovsky <redacted>
 drivers/net/ethernet/mellanox/mlx5/core/qp.c | 16 ++++++++++++++--
 include/linux/mlx5/mlx5_ifc.h                |  6 +++---
 2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/qp.c b/drivers/net/ethernet/mellanox/mlx5/core/qp.c
index 04f72a1cdbcc..0ca68ef54d93 100644
+++ b/drivers/net/ethernet/mellanox/mlx5/core/qp.c
@@ -540,6 +540,17 @@ int mlx5_core_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn)
 }
 EXPORT_SYMBOL_GPL(mlx5_core_xrcd_dealloc);

+static void destroy_rq_tracked(struct mlx5_core_dev *dev, u32 rqn, u16 uid)
+{
+     u32 in[MLX5_ST_SZ_DW(destroy_rq_in)]   = {0};
+     u32 out[MLX5_ST_SZ_DW(destroy_rq_out)] = {0};
= {} is the preferred version of this, right?

{0} explicitly initializes the first element to zero and only works if
the first element happens to be something integral..
Both are perfectly ok in our scenarios.
I remember one of the syntaxes yielded a statistic checker warning, i
don't remember which syntax and what static checker :) ..
{0} will throw a 'missing-field-initializers' compiler warning,
however it recognizes '= {}' as an idom meaning 'zero everything' and
does not throw a warning.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help