search for: mlx5_st_sz_byte

Displaying 8 results from an estimated 8 matches for "mlx5_st_sz_byte".

Did you mean: mlx5_st_sz_bytes
2020 Aug 06
1
[PATCH][next] vdpa/mlx5: fix memory allocation failure checks
...ers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 3ec44a4f0e45..55bc58e1dae9 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); *in = kzalloc(*inlen, GFP_KERNEL); *out = kzalloc(*outlen, GFP_KERNEL); - if (!in || !out) + if (!*in || !*out) goto outerr; MLX5_SET(qp_2rst_in, *in, opcode, cmd); @@ -879,7 +879,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl...
2020 Aug 07
1
[PATCH] vdpa/mlx5: Fix erroneous null pointer checks
...t.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index 3ec44a4f0e45..bcb6600c2839 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl > *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); > *in = kzalloc(*inlen, GFP_KERNEL); > *out = kzalloc(*outlen, GFP_KERNEL); > - if (!in || !out) > + if (!*in || !*out) > goto outerr; > > MLX5_SET(qp_2rst_in, *in, opcode, cmd); > @@ -879,7 +879,7 @@ static void alloc_inout(struct mlx5_v...
2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...+{ > + mlx5_frag_buf_free(ndev->mvdev.mdev, &vqp->frag_buf); > +} > + > +static int qp_create(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq, > + struct mlx5_vdpa_qp *vqp) > +{ > + struct mlx5_core_dev *mdev = ndev->mvdev.mdev; > + int inlen = MLX5_ST_SZ_BYTES(create_qp_in); > + u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {}; > + void *qpc; > + void *in; > + int err; > + > + if (!vqp->fw) { > + vqp = &mvq->vqqp; > + err = rq_buf_alloc(ndev, vqp, mvq->num_ent); > + if (err) > + return err; > + > + err =...
2023 Mar 21
0
[PATCH v3 1/2] vdpa/mlx5: Extend driver support for new features
...tures & BIT_ULL(VIRTIO_NET_F_HOST_TSO4)) << MLX5_VIRTIO_NET_F_HOST_TSO4); > } > > static bool counters_supported(const struct mlx5_vdpa_dev *mvdev) > @@ -797,6 +813,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtque > int inlen = MLX5_ST_SZ_BYTES(create_virtio_net_q_in); > u32 out[MLX5_ST_SZ_DW(create_virtio_net_q_out)] = {}; > void *obj_context; > + u16 mlx_features; > void *cmd_hdr; > void *vq_ctx; > void *in; > @@ -812,6 +829,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdp...
2023 Mar 17
0
[PATCH v2 1/2] vdpa/mlx5: Extend driver support for new features
...tures & BIT_ULL(VIRTIO_NET_F_HOST_TSO4)) << MLX5_VIRTIO_NET_F_HOST_TSO4); > } > > static bool counters_supported(const struct mlx5_vdpa_dev *mvdev) > @@ -797,6 +817,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtque > int inlen = MLX5_ST_SZ_BYTES(create_virtio_net_q_in); > u32 out[MLX5_ST_SZ_DW(create_virtio_net_q_out)] = {}; > void *obj_context; > + u16 mlx_features; > void *cmd_hdr; > void *vq_ctx; > void *in; > @@ -812,6 +833,7 @@ static int create_virtqueue(struct mlx5_...
2023 Aug 31
2
[PATCH v2] vdpa/mlx5: Fix firmware error on creation of 1k VQs
...mem_params(struct mlx5_vdpa_net *ndev) +{ + u32 in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {}; + u16 opmod = (MLX5_CAP_VDPA_EMULATION << 1) | (HCA_CAP_OPMOD_GET_CUR & 0x01); + struct mlx5_core_dev *mdev = ndev->mvdev.mdev; + int out_size; + void *caps; + void *out; + int err; + + out_size = MLX5_ST_SZ_BYTES(query_hca_cap_out); + out = kzalloc(out_size, GFP_KERNEL); + if (!out) + return -ENOMEM; + + MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP); + MLX5_SET(query_hca_cap_in, in, op_mod, opmod); + err = mlx5_cmd_exec_inout(mdev, query_hca_cap, in, out); + if (err) { + mlx5_vdpa_war...
2023 Apr 03
0
[Patch v3] vdpa/mlx5: Avoid losing link state updates
...; > >> - } > >> - return ret; > >> - } > >> - return ret; > >> -} > >> - > >> static int config_func_mtu(struct mlx5_core_dev *mdev, u16 mtu) > >> { > >> int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); > >> @@ -3282,9 +3312,6 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, > >> goto err_res2; > >> } > >> > >> - ndev->nb.notifier_call = event_handler; >...
2020 Jul 16
0
[PATCH vhost next 08/10] vdpa/mlx5: Add support library for mlx5 VDPA implementation
...dpa_dev *mvdev, u16 *uid) 51 { > 52 u32 out[MLX5_ST_SZ_DW(create_uctx_out)] = {}; 53 int inlen; 54 void *in; 55 int err; 56 57 /* 0 means not supported */ 58 if (!MLX5_CAP_GEN(mvdev->mdev, log_max_uctx)) 59 return -EOPNOTSUPP; 60 61 inlen = MLX5_ST_SZ_BYTES(create_uctx_in); 62 in = kzalloc(inlen, GFP_KERNEL); 63 if (!in) 64 return -ENOMEM; 65 66 MLX5_SET(create_uctx_in, in, opcode, MLX5_CMD_OP_CREATE_UCTX); 67 MLX5_SET(create_uctx_in, in, uctx.cap, MLX5_UCTX_CAP_RAW_TX); 68 69 err = mlx5_cmd_exec(mvdev->mde...