Author: hselasky
Date: Tue Dec  1 12:51:35 2020
New Revision: 368221
URL: https://svnweb.freebsd.org/changeset/base/368221

Log:
  MFC r367717:
  Enhance the mlx5_core_create_cq() function in mlx5core.
  
  Enhance mlx5_core_create_cq() to get the command out buffer from the
  callers to let them use the output.
  
  Linux commit:
  38164b771947be9baf06e78ffdfb650f8f3e908e
  
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  stable/12/sys/dev/mlx5/cq.h
  stable/12/sys/dev/mlx5/mlx5_core/mlx5_cq.c
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/cq.h
==============================================================================
--- stable/12/sys/dev/mlx5/cq.h Tue Dec  1 12:45:47 2020        (r368220)
+++ stable/12/sys/dev/mlx5/cq.h Tue Dec  1 12:51:35 2020        (r368221)
@@ -157,7 +157,7 @@ static inline void mlx5_cq_arm(struct mlx5_core_cq *cq
 int mlx5_init_cq_table(struct mlx5_core_dev *dev);
 void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev);
 int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
-                       u32 *in, int inlen);
+                       u32 *in, int inlen, u32 *out, int outlen);
 int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
 int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
                       u32 *out, int outlen);

Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_cq.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_cq.c  Tue Dec  1 12:45:47 2020        
(r368220)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_cq.c  Tue Dec  1 12:51:35 2020        
(r368221)
@@ -100,16 +100,16 @@ void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn,
 
 
 int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
-                       u32 *in, int inlen)
+                       u32 *in, int inlen, u32 *out, int outlen)
 {
        struct mlx5_cq_table *table = &dev->priv.cq_table;
-       u32 out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
        u32 din[MLX5_ST_SZ_DW(destroy_cq_in)] = {0};
        u32 dout[MLX5_ST_SZ_DW(destroy_cq_out)] = {0};
        int err;
 
+       memset(out, 0, outlen);
        MLX5_SET(create_cq_in, in, opcode, MLX5_CMD_OP_CREATE_CQ);
-       err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
+       err = mlx5_cmd_exec(dev, in, inlen, out, outlen);
        if (err)
                return err;
 

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Tue Dec  1 12:45:47 
2020        (r368220)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Tue Dec  1 12:51:35 
2020        (r368221)
@@ -1978,6 +1978,7 @@ static int
 mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix)
 {
        struct mlx5_core_cq *mcq = &cq->mcq;
+       u32 out[MLX5_ST_SZ_DW(create_cq_out)];
        void *in;
        void *cqc;
        int inlen;
@@ -2006,7 +2007,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_p
            PAGE_SHIFT);
        MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma);
 
-       err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen);
+       err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen, out, 
sizeof(out));
 
        kvfree(in);
 

Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Tue Dec  1 12:45:47 2020        
(r368220)
+++ stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Tue Dec  1 12:51:35 2020        
(r368221)
@@ -905,6 +905,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibde
        int entries = attr->cqe;
        int vector = attr->comp_vector;
        struct mlx5_ib_dev *dev = to_mdev(ibdev);
+       u32 out[MLX5_ST_SZ_DW(create_cq_out)];
        struct mlx5_ib_cq *cq;
        int uninitialized_var(index);
        int uninitialized_var(inlen);
@@ -969,7 +970,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibde
        if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN)
                MLX5_SET(cqc, cqc, oi, 1);
 
-       err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);
+       err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen, out, 
sizeof(out));
        if (err)
                goto err_cqb;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to