* [PATCH V2 rdma-core 1/6] mlx5: Explicitly align mlx5 query device response to 64 bit
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2017-03-23 13:55 ` Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 2/6] mlx5: Report multi packet send WQE capability for mlx5 based hardware Yishai Hadas
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Explicitly align packet pacing response to 64 bit so that further
capabilities that going to be read will match to mlx5 kernel response.
Signed-off-by: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
providers/mlx5/mlx5-abi.h | 7 ++++++-
providers/mlx5/verbs.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h
index e6ea428..dde46b9 100644
--- a/providers/mlx5/mlx5-abi.h
+++ b/providers/mlx5/mlx5-abi.h
@@ -264,6 +264,11 @@ struct mlx5_rss_caps {
__u8 reserved[7];
};
+struct mlx5_packet_pacing_caps {
+ struct ibv_packet_pacing_caps caps;
+ __u32 reserved;
+};
+
struct mlx5_query_device_ex_resp {
struct ibv_query_device_resp_ex ibv_resp;
__u32 comp_mask;
@@ -271,7 +276,7 @@ struct mlx5_query_device_ex_resp {
struct ibv_tso_caps tso_caps;
struct mlx5_rss_caps rss_caps; /* vendor data channel */
__u64 reserved_cqe_comp;
- struct ibv_packet_pacing_caps packet_pacing_caps;
+ struct mlx5_packet_pacing_caps packet_pacing_caps;
};
#endif /* MLX5_ABI_H */
diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
index 67f9748..aba1631 100644
--- a/providers/mlx5/verbs.c
+++ b/providers/mlx5/verbs.c
@@ -1922,7 +1922,7 @@ int mlx5_query_device_ex(struct ibv_context *context,
attr->tso_caps = resp.tso_caps;
attr->rss_caps.rx_hash_fields_mask = resp.rss_caps.rx_hash_fields_mask;
attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function;
- attr->packet_pacing_caps = resp.packet_pacing_caps;
+ attr->packet_pacing_caps = resp.packet_pacing_caps.caps;
major = (raw_fw_ver >> 32) & 0xffff;
minor = (raw_fw_ver >> 16) & 0xffff;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 rdma-core 2/6] mlx5: Report multi packet send WQE capability for mlx5 based hardware
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-23 13:55 ` [PATCH V2 rdma-core 1/6] mlx5: Explicitly align mlx5 query device response to 64 bit Yishai Hadas
@ 2017-03-23 13:55 ` Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 3/6] mlx5: Report CQE compression capabilities through mlx5 direct verbs Yishai Hadas
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Report whether multi packet send WQE is supported or not through mlx5
direct verbs.
Signed-off-by: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
providers/mlx5/man/mlx5dv_query_device.3 | 1 +
providers/mlx5/mlx5-abi.h | 2 ++
providers/mlx5/mlx5.c | 8 +++++++-
providers/mlx5/mlx5.h | 5 +++++
providers/mlx5/mlx5dv.h | 3 ++-
providers/mlx5/verbs.c | 3 +++
6 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/providers/mlx5/man/mlx5dv_query_device.3 b/providers/mlx5/man/mlx5dv_query_device.3
index 1954714..b33a75b 100644
--- a/providers/mlx5/man/mlx5dv_query_device.3
+++ b/providers/mlx5/man/mlx5dv_query_device.3
@@ -35,6 +35,7 @@ enum mlx5dv_context_flags {
* This flag indicates if CQE version 0 or 1 is needed.
*/
MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0),
+ MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Multi packet WQE is supported or not */
.in -8
};
.fi
diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h
index dde46b9..3574594 100644
--- a/providers/mlx5/mlx5-abi.h
+++ b/providers/mlx5/mlx5-abi.h
@@ -277,6 +277,8 @@ struct mlx5_query_device_ex_resp {
struct mlx5_rss_caps rss_caps; /* vendor data channel */
__u64 reserved_cqe_comp;
struct mlx5_packet_pacing_caps packet_pacing_caps;
+ __u32 support_multi_pkt_send_wqe;
+ __u32 reserved;
};
#endif /* MLX5_ABI_H */
diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c
index eeaf5ac..7af6a0a 100644
--- a/providers/mlx5/mlx5.c
+++ b/providers/mlx5/mlx5.c
@@ -612,13 +612,18 @@ static int mlx5_map_internal_clock(struct mlx5_device *mdev,
int mlx5dv_query_device(struct ibv_context *ctx_in,
struct mlx5dv_context *attrs_out)
{
+ struct mlx5_context *mctx = to_mctx(ctx_in);
+
attrs_out->comp_mask = 0;
attrs_out->version = 0;
attrs_out->flags = 0;
- if (to_mctx(ctx_in)->cqe_version == MLX5_CQE_VERSION_V1)
+ if (mctx->cqe_version == MLX5_CQE_VERSION_V1)
attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_CQE_V1;
+ if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_MPW)
+ attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_MPW;
+
return 0;
}
@@ -827,6 +832,7 @@ static int mlx5_init_context(struct verbs_device *vdev,
}
context->cmds_supp_uhw = resp.cmds_supp_uhw;
+ context->vendor_cap_flags = 0;
pthread_mutex_init(&context->qp_table_mutex, NULL);
pthread_mutex_init(&context->srq_table_mutex, NULL);
diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h
index 57ed1a1..86f2438 100644
--- a/providers/mlx5/mlx5.h
+++ b/providers/mlx5/mlx5.h
@@ -180,6 +180,10 @@ enum {
MLX5_USER_CMDS_SUPP_UHW_CREATE_AH = 1 << 1,
};
+enum mlx5_vendor_cap_flags {
+ MLX5_VENDOR_CAP_FLAGS_MPW = 1 << 0,
+};
+
struct mlx5_resource {
enum mlx5_rsc_type type;
uint32_t rsn;
@@ -258,6 +262,7 @@ struct mlx5_context {
struct ibv_tso_caps cached_tso_caps;
int cmds_supp_uhw;
uint32_t uar_size;
+ uint64_t vendor_cap_flags; /* Use enum mlx5_vendor_cap_flags */
};
struct mlx5_bitmap {
diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h
index 2e4995f..c09fad2 100644
--- a/providers/mlx5/mlx5dv.h
+++ b/providers/mlx5/mlx5dv.h
@@ -67,7 +67,8 @@ enum mlx5dv_context_flags {
/*
* This flag indicates if CQE version 0 or 1 is needed.
*/
- MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0),
+ MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0),
+ MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1),
};
/*
diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
index aba1631..cea9e46 100644
--- a/providers/mlx5/verbs.c
+++ b/providers/mlx5/verbs.c
@@ -1924,6 +1924,9 @@ int mlx5_query_device_ex(struct ibv_context *context,
attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function;
attr->packet_pacing_caps = resp.packet_pacing_caps.caps;
+ if (resp.support_multi_pkt_send_wqe)
+ mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_MPW;
+
major = (raw_fw_ver >> 32) & 0xffff;
minor = (raw_fw_ver >> 16) & 0xffff;
sub_minor = raw_fw_ver & 0xffff;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 rdma-core 3/6] mlx5: Report CQE compression capabilities through mlx5 direct verbs
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-23 13:55 ` [PATCH V2 rdma-core 1/6] mlx5: Explicitly align mlx5 query device response to 64 bit Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 2/6] mlx5: Report multi packet send WQE capability for mlx5 based hardware Yishai Hadas
@ 2017-03-23 13:55 ` Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 4/6] verbs: Expose verbs init CQ helper API Yishai Hadas
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Report max number of compressed and aggregated CQEs in a single
merged CQE and the formats of mini CQE supported for responder.
Signed-off-by: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
providers/mlx5/mlx5-abi.h | 3 ++-
providers/mlx5/mlx5.c | 9 ++++++++-
providers/mlx5/mlx5.h | 1 +
providers/mlx5/mlx5dv.h | 17 +++++++++++++++++
providers/mlx5/verbs.c | 2 ++
5 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h
index 3574594..487de3a 100644
--- a/providers/mlx5/mlx5-abi.h
+++ b/providers/mlx5/mlx5-abi.h
@@ -35,6 +35,7 @@
#include <infiniband/kern-abi.h>
#include <infiniband/verbs.h>
+#include "mlx5dv.h"
#define MLX5_UVERBS_MIN_ABI_VERSION 1
#define MLX5_UVERBS_MAX_ABI_VERSION 1
@@ -275,7 +276,7 @@ struct mlx5_query_device_ex_resp {
__u32 response_length;
struct ibv_tso_caps tso_caps;
struct mlx5_rss_caps rss_caps; /* vendor data channel */
- __u64 reserved_cqe_comp;
+ struct mlx5dv_cqe_comp_caps cqe_comp_caps;
struct mlx5_packet_pacing_caps packet_pacing_caps;
__u32 support_multi_pkt_send_wqe;
__u32 reserved;
diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c
index 7af6a0a..edb6d35 100644
--- a/providers/mlx5/mlx5.c
+++ b/providers/mlx5/mlx5.c
@@ -613,8 +613,8 @@ int mlx5dv_query_device(struct ibv_context *ctx_in,
struct mlx5dv_context *attrs_out)
{
struct mlx5_context *mctx = to_mctx(ctx_in);
+ uint64_t comp_mask_out = 0;
- attrs_out->comp_mask = 0;
attrs_out->version = 0;
attrs_out->flags = 0;
@@ -624,6 +624,13 @@ int mlx5dv_query_device(struct ibv_context *ctx_in,
if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_MPW)
attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_MPW;
+ if (attrs_out->comp_mask & MLX5DV_CONTEXT_MASK_CQE_COMPRESION) {
+ attrs_out->cqe_comp_caps = mctx->cqe_comp_caps;
+ comp_mask_out |= MLX5DV_CONTEXT_MASK_CQE_COMPRESION;
+ }
+
+ attrs_out->comp_mask = comp_mask_out;
+
return 0;
}
diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h
index 86f2438..bb383d4 100644
--- a/providers/mlx5/mlx5.h
+++ b/providers/mlx5/mlx5.h
@@ -263,6 +263,7 @@ struct mlx5_context {
int cmds_supp_uhw;
uint32_t uar_size;
uint64_t vendor_cap_flags; /* Use enum mlx5_vendor_cap_flags */
+ struct mlx5dv_cqe_comp_caps cqe_comp_caps;
};
struct mlx5_bitmap {
diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h
index c09fad2..a2f7acf 100644
--- a/providers/mlx5/mlx5dv.h
+++ b/providers/mlx5/mlx5dv.h
@@ -54,6 +54,16 @@ enum {
MLX5_SND_DBR = 1,
};
+enum mlx5dv_context_comp_mask {
+ MLX5DV_CONTEXT_MASK_CQE_COMPRESION = 1 << 0,
+ MLX5DV_CONTEXT_MASK_RESERVED = 1 << 1,
+};
+
+struct mlx5dv_cqe_comp_caps {
+ uint32_t max_num;
+ uint32_t supported_format; /* enum mlx5dv_cqe_comp_res_format */
+};
+
/*
* Direct verbs device-specific attributes
*/
@@ -61,6 +71,7 @@ struct mlx5dv_context {
uint8_t version;
uint64_t flags;
uint64_t comp_mask;
+ struct mlx5dv_cqe_comp_caps cqe_comp_caps;
};
enum mlx5dv_context_flags {
@@ -277,6 +288,12 @@ struct mlx5_cqe64 {
uint8_t op_own;
};
+enum mlx5dv_cqe_comp_res_format {
+ MLX5DV_CQE_RES_FORMAT_HASH = 1 << 0,
+ MLX5DV_CQE_RES_FORMAT_CSUM = 1 << 1,
+ MLX5DV_CQE_RES_FORMAT_RESERVED = 1 << 2,
+};
+
static MLX5DV_ALWAYS_INLINE
uint8_t mlx5dv_get_cqe_owner(struct mlx5_cqe64 *cqe)
{
diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
index cea9e46..a223291 100644
--- a/providers/mlx5/verbs.c
+++ b/providers/mlx5/verbs.c
@@ -1927,6 +1927,8 @@ int mlx5_query_device_ex(struct ibv_context *context,
if (resp.support_multi_pkt_send_wqe)
mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_MPW;
+ mctx->cqe_comp_caps = resp.cqe_comp_caps;
+
major = (raw_fw_ver >> 32) & 0xffff;
minor = (raw_fw_ver >> 16) & 0xffff;
sub_minor = raw_fw_ver & 0xffff;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 rdma-core 4/6] verbs: Expose verbs init CQ helper API
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
` (2 preceding siblings ...)
2017-03-23 13:55 ` [PATCH V2 rdma-core 3/6] mlx5: Report CQE compression capabilities through mlx5 direct verbs Yishai Hadas
@ 2017-03-23 13:55 ` Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 5/6] mlx5: Expose direct create_cq with private data Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 6/6] Bump version and update debian Yishai Hadas
5 siblings, 0 replies; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
This patch exposes to providers an helper function to init a CQ
post its creation.
The internal library code was refactored to use this helper
API to have a shared code for all creation flows (i.e. create_cq and
create_cq_ex).
As part of this refactoring reduced the scope of the lock that was taken
as part of creating/destroying a CQ to protect only what it was intended
to do. (i.e. channel->refcnt)
It's the application responsibility not to call concurrently to create a
CQ with a given completion channel and in the same time destroy it from
other thread, no change at that point from the original code.
The helper function going to be used in downstream patch in this
series.
Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
libibverbs/device.c | 38 +++++++++++++++++++++++---------------
libibverbs/driver.h | 3 +++
libibverbs/ibverbs.h | 2 +-
libibverbs/libibverbs.map | 3 ++-
libibverbs/verbs.c | 26 ++++++--------------------
5 files changed, 35 insertions(+), 37 deletions(-)
diff --git a/libibverbs/device.c b/libibverbs/device.c
index 6ef670a..ebf4970 100644
--- a/libibverbs/device.c
+++ b/libibverbs/device.c
@@ -132,6 +132,26 @@ __be64 __ibv_get_device_guid(struct ibv_device *device)
}
default_symver(__ibv_get_device_guid, ibv_get_device_guid);
+void verbs_init_cq(struct ibv_cq *cq, struct ibv_context *context,
+ struct ibv_comp_channel *channel,
+ void *cq_context)
+{
+ cq->context = context;
+ cq->channel = channel;
+
+ if (cq->channel) {
+ pthread_mutex_lock(&context->mutex);
+ ++cq->channel->refcnt;
+ pthread_mutex_unlock(&context->mutex);
+ }
+
+ cq->cq_context = cq_context;
+ cq->comp_events_completed = 0;
+ cq->async_events_completed = 0;
+ pthread_mutex_init(&cq->mutex, NULL);
+ pthread_cond_init(&cq->cond, NULL);
+}
+
static struct ibv_cq_ex *
__lib_ibv_create_cq_ex(struct ibv_context *context,
struct ibv_cq_init_attr_ex *cq_attr)
@@ -144,23 +164,11 @@ __lib_ibv_create_cq_ex(struct ibv_context *context,
return NULL;
}
- pthread_mutex_lock(&context->mutex);
-
cq = vctx->priv->create_cq_ex(context, cq_attr);
- if (cq) {
- cq->context = context;
- cq->channel = cq_attr->channel;
- if (cq->channel)
- ++cq->channel->refcnt;
- cq->cq_context = cq_attr->cq_context;
- cq->comp_events_completed = 0;
- cq->async_events_completed = 0;
- pthread_mutex_init(&cq->mutex, NULL);
- pthread_cond_init(&cq->cond, NULL);
- }
-
- pthread_mutex_unlock(&context->mutex);
+ if (cq)
+ verbs_init_cq(ibv_cq_ex_to_cq(cq), context,
+ cq_attr->channel, cq_attr->cq_context);
return cq;
}
diff --git a/libibverbs/driver.h b/libibverbs/driver.h
index e3ac3f7..ec87afd 100644
--- a/libibverbs/driver.h
+++ b/libibverbs/driver.h
@@ -130,6 +130,9 @@ verbs_get_device(const struct ibv_device *dev)
typedef struct verbs_device *(*verbs_driver_init_func)(const char *uverbs_sys_path,
int abi_version);
void verbs_register_driver(const char *name, verbs_driver_init_func init_func);
+void verbs_init_cq(struct ibv_cq *cq, struct ibv_context *context,
+ struct ibv_comp_channel *channel,
+ void *cq_context);
int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmd,
size_t cmd_size, struct ibv_get_context_resp *resp,
diff --git a/libibverbs/ibverbs.h b/libibverbs/ibverbs.h
index 3b08476..eb304ba 100644
--- a/libibverbs/ibverbs.h
+++ b/libibverbs/ibverbs.h
@@ -48,7 +48,7 @@
#define default_symver(name, api) \
asm(".symver " #name "," #api "@@" DEFAULT_ABI)
#define private_symver(name, api) \
- asm(".symver " #name "," #api "@@IBVERBS_PRIVATE_13")
+ asm(".symver " #name "," #api "@@IBVERBS_PRIVATE_14")
#define PFX "libibverbs: "
diff --git a/libibverbs/libibverbs.map b/libibverbs/libibverbs.map
index 656c21d..5401241 100644
--- a/libibverbs/libibverbs.map
+++ b/libibverbs/libibverbs.map
@@ -86,7 +86,7 @@ IBVERBS_1.1 {
/* If any symbols in this stanza change ABI then the entire staza gets a new symbol
version. Also see the private_symver() macro */
-IBVERBS_PRIVATE_13 {
+IBVERBS_PRIVATE_14 {
global:
/* These historical symbols are now private to libibverbs */
ibv_cmd_alloc_mw;
@@ -138,4 +138,5 @@ IBVERBS_PRIVATE_13 {
ibv_query_gid_type;
ibv_register_driver;
verbs_register_driver;
+ verbs_init_cq;
};
diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c
index e84a2dd..e54fd77 100644
--- a/libibverbs/verbs.c
+++ b/libibverbs/verbs.c
@@ -441,23 +441,10 @@ struct ibv_cq *__ibv_create_cq(struct ibv_context *context, int cqe, void *cq_co
{
struct ibv_cq *cq;
- pthread_mutex_lock(&context->mutex);
-
cq = context->ops.create_cq(context, cqe, channel, comp_vector);
- if (cq) {
- cq->context = context;
- cq->channel = channel;
- if (channel)
- ++channel->refcnt;
- cq->cq_context = cq_context;
- cq->comp_events_completed = 0;
- cq->async_events_completed = 0;
- pthread_mutex_init(&cq->mutex, NULL);
- pthread_cond_init(&cq->cond, NULL);
- }
-
- pthread_mutex_unlock(&context->mutex);
+ if (cq)
+ verbs_init_cq(cq, context, channel, cq_context);
return cq;
}
@@ -477,15 +464,14 @@ int __ibv_destroy_cq(struct ibv_cq *cq)
struct ibv_comp_channel *channel = cq->channel;
int ret;
- if (channel)
- pthread_mutex_lock(&channel->context->mutex);
-
ret = cq->context->ops.destroy_cq(cq);
if (channel) {
- if (!ret)
+ if (!ret) {
+ pthread_mutex_lock(&channel->context->mutex);
--channel->refcnt;
- pthread_mutex_unlock(&channel->context->mutex);
+ pthread_mutex_unlock(&channel->context->mutex);
+ }
}
return ret;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 rdma-core 5/6] mlx5: Expose direct create_cq with private data
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
` (3 preceding siblings ...)
2017-03-23 13:55 ` [PATCH V2 rdma-core 4/6] verbs: Expose verbs init CQ helper API Yishai Hadas
@ 2017-03-23 13:55 ` Yishai Hadas
2017-03-23 13:55 ` [PATCH V2 rdma-core 6/6] Bump version and update debian Yishai Hadas
5 siblings, 0 replies; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
This patch exposes an API named mlx5dv_create_cq to enable creating a
CQ with some mlx5 private data.
Specifically, it enables creating a CQ in a mode that
few CQEs may be compressed into a single CQE.
To use the shared code of libibverbs when a CQ is created it uses the
verbs_init_cq() helper API that was introduced in previous patch.
Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
providers/mlx5/libmlx5.map | 5 +++++
providers/mlx5/mlx5-abi.h | 3 +++
providers/mlx5/mlx5dv.h | 13 +++++++++++++
providers/mlx5/verbs.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
4 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/providers/mlx5/libmlx5.map b/providers/mlx5/libmlx5.map
index 7ce3eb1..ffd7b5c 100644
--- a/providers/mlx5/libmlx5.map
+++ b/providers/mlx5/libmlx5.map
@@ -6,3 +6,8 @@ MLX5_1.0 {
mlx5dv_init_obj;
local: *;
};
+
+MLX5_1.14 {
+ global:
+ mlx5dv_create_cq;
+} MLX5_1.0;
diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h
index 487de3a..d05cb40 100644
--- a/providers/mlx5/mlx5-abi.h
+++ b/providers/mlx5/mlx5-abi.h
@@ -119,6 +119,9 @@ struct mlx5_create_cq {
__u64 buf_addr;
__u64 db_addr;
__u32 cqe_size;
+ __u8 cqe_comp_en;
+ __u8 cqe_comp_res_format;
+ __u16 reserved;
};
struct mlx5_create_cq_resp {
diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h
index a2f7acf..a03b1d7 100644
--- a/providers/mlx5/mlx5dv.h
+++ b/providers/mlx5/mlx5dv.h
@@ -82,6 +82,19 @@ enum mlx5dv_context_flags {
MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1),
};
+enum mlx5dv_cq_init_attr_mask {
+ MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE = 1 << 0,
+ MLX5DV_CQ_INIT_ATTR_MASK_RESERVED = 1 << 1,
+};
+
+struct mlx5dv_cq_init_attr {
+ uint64_t comp_mask; /* Use enum mlx5dv_cq_init_attr_mask */
+ uint8_t cqe_comp_res_format; /* Use enum mlx5dv_cqe_comp_res_format */
+};
+
+struct ibv_cq_ex *mlx5dv_create_cq(struct ibv_context *context,
+ struct ibv_cq_init_attr_ex *cq_attr,
+ struct mlx5dv_cq_init_attr *mlx5_cq_attr);
/*
* Most device capabilities are exported by ibv_query_device(...),
* but there is HW device-specific information which is important
diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c
index a223291..b7a8502 100644
--- a/providers/mlx5/verbs.c
+++ b/providers/mlx5/verbs.c
@@ -341,7 +341,8 @@ enum {
static struct ibv_cq_ex *create_cq(struct ibv_context *context,
const struct ibv_cq_init_attr_ex *cq_attr,
- int cq_alloc_flags)
+ int cq_alloc_flags,
+ struct mlx5dv_cq_init_attr *mlx5cq_attr)
{
struct mlx5_create_cq cmd;
struct mlx5_create_cq_resp resp;
@@ -349,6 +350,7 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context,
int cqe_sz;
int ret;
int ncqe;
+ struct mlx5_context *mctx = to_mctx(context);
FILE *fp = to_mctx(context)->dbg_fp;
if (!cq_attr->cqe) {
@@ -428,6 +430,28 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context,
cmd.db_addr = (uintptr_t) cq->dbrec;
cmd.cqe_size = cqe_sz;
+ if (mlx5cq_attr) {
+ if (mlx5cq_attr->comp_mask & ~(MLX5DV_CQ_INIT_ATTR_MASK_RESERVED - 1)) {
+ mlx5_dbg(fp, MLX5_DBG_CQ,
+ "Unsupported vendor comp_mask for create_cq\n");
+ errno = EINVAL;
+ goto err_db;
+ }
+
+ if (mlx5cq_attr->comp_mask & MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE) {
+ if (mctx->cqe_comp_caps.max_num &&
+ (mlx5cq_attr->cqe_comp_res_format &
+ mctx->cqe_comp_caps.supported_format)) {
+ cmd.cqe_comp_en = 1;
+ cmd.cqe_comp_res_format = mlx5cq_attr->cqe_comp_res_format;
+ } else {
+ mlx5_dbg(fp, MLX5_DBG_CQ, "CQE Compression is not supported\n");
+ errno = EINVAL;
+ goto err_db;
+ }
+ }
+ }
+
ret = ibv_cmd_create_cq(context, ncqe - 1, cq_attr->channel,
cq_attr->comp_vector,
ibv_cq_ex_to_cq(&cq->ibv_cq), &cmd.ibv_cmd,
@@ -478,14 +502,29 @@ struct ibv_cq *mlx5_create_cq(struct ibv_context *context, int cqe,
return NULL;
}
- cq = create_cq(context, &cq_attr, 0);
+ cq = create_cq(context, &cq_attr, 0, NULL);
return cq ? ibv_cq_ex_to_cq(cq) : NULL;
}
struct ibv_cq_ex *mlx5_create_cq_ex(struct ibv_context *context,
struct ibv_cq_init_attr_ex *cq_attr)
{
- return create_cq(context, cq_attr, MLX5_CQ_FLAGS_EXTENDED);
+ return create_cq(context, cq_attr, MLX5_CQ_FLAGS_EXTENDED, NULL);
+}
+
+struct ibv_cq_ex *mlx5dv_create_cq(struct ibv_context *context,
+ struct ibv_cq_init_attr_ex *cq_attr,
+ struct mlx5dv_cq_init_attr *mlx5_cq_attr)
+{
+ struct ibv_cq_ex *cq;
+
+ cq = create_cq(context, cq_attr, MLX5_CQ_FLAGS_EXTENDED, mlx5_cq_attr);
+ if (!cq)
+ return NULL;
+
+ verbs_init_cq(ibv_cq_ex_to_cq(cq), context,
+ cq_attr->channel, cq_attr->cq_context);
+ return cq;
}
int mlx5_resize_cq(struct ibv_cq *ibcq, int cqe)
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 rdma-core 6/6] Bump version and update debian
[not found] ` <1490277329-8738-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
` (4 preceding siblings ...)
2017-03-23 13:55 ` [PATCH V2 rdma-core 5/6] mlx5: Expose direct create_cq with private data Yishai Hadas
@ 2017-03-23 13:55 ` Yishai Hadas
[not found] ` <1490277329-8738-7-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
5 siblings, 1 reply; 15+ messages in thread
From: Yishai Hadas @ 2017-03-23 13:55 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
yishaih-VPRAkNaXOzVWk0Htik3J/w, bodong-VPRAkNaXOzVWk0Htik3J/w,
majd-VPRAkNaXOzVWk0Htik3J/w,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
CMakeLists.txt | 2 +-
debian/changelog | 5 ++++-
debian/ibverbs-providers.symbols | 2 ++
debian/libibverbs1.symbols | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da80344..24542a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,7 @@ endif()
set(PACKAGE_NAME "RDMA")
# See Documentation/versioning.md
-set(PACKAGE_VERSION "13")
+set(PACKAGE_VERSION "14")
#-------------------------
# Basic standard paths
diff --git a/debian/changelog b/debian/changelog
index 3defc05..f47fcec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
-rdma-core (13-1) unstable; urgency=low
+rdma-core (14-1) unstable; urgency=low
+
+ * Bump version.
+rdma-core (13-1) unstable; urgency=low
* New version.
* Adding debian/copyright.
* Close ITP (Closes: #848971).
diff --git a/debian/ibverbs-providers.symbols b/debian/ibverbs-providers.symbols
index b114deb..9c10852 100644
--- a/debian/ibverbs-providers.symbols
+++ b/debian/ibverbs-providers.symbols
@@ -1,4 +1,6 @@
libmlx5.so.1 ibverbs-providers #MINVER#
MLX5_1.0@MLX5_1.0 13-1
+ MLX5_1.14@MLX5_1.14 14-1
mlx5dv_init_obj@MLX5_1.0 13-1
mlx5dv_query_device@MLX5_1.0 13-1
+ mlx5dv_create_cq@MLX5_1.14 14-1
diff --git a/debian/libibverbs1.symbols b/debian/libibverbs1.symbols
index d70afd0..b96ef46 100644
--- a/debian/libibverbs1.symbols
+++ b/debian/libibverbs1.symbols
@@ -1,7 +1,7 @@
libibverbs.so.1 libibverbs1 #MINVER#
IBVERBS_1.0@IBVERBS_1.0 1.1.6
IBVERBS_1.1@IBVERBS_1.1 1.1.6
- (symver)IBVERBS_PRIVATE_13 13
+ (symver)IBVERBS_PRIVATE_14 14
ibv_ack_async_event@IBVERBS_1.0 1.1.6
ibv_ack_async_event@IBVERBS_1.1 1.1.6
ibv_ack_cq_events@IBVERBS_1.0 1.1.6
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 15+ messages in thread