From: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: [PATCH rdma-core 2/5] mlx5: Report multi packet send WQE capability for mlx5 based hardware
Date: Mon, 6 Mar 2017 16:06:41 +0200 [thread overview]
Message-ID: <1488809204-30428-3-git-send-email-yishaih@mellanox.com> (raw)
In-Reply-To: <1488809204-30428-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
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 8025131..9a484b3 100644
--- a/providers/mlx5/mlx5-abi.h
+++ b/providers/mlx5/mlx5-abi.h
@@ -276,6 +276,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 87c85df..b7d737d 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 174b3f1..a04583d 100644
--- a/providers/mlx5/mlx5dv.h
+++ b/providers/mlx5/mlx5dv.h
@@ -71,7 +71,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 a659d3e..ff9220d 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
next prev parent reply other threads:[~2017-03-06 14:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-06 14:06 [PATCH rdma-core 0/5] Enable mlx5 vendor functionality Yishai Hadas
[not found] ` <1488809204-30428-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-06 14:06 ` [PATCH rdma-core 1/5] mlx5: Explicitly align mlx5 query device response to 64 bit Yishai Hadas
2017-03-06 14:06 ` Yishai Hadas [this message]
2017-03-06 14:06 ` [PATCH rdma-core 3/5] mlx5: Report CQE compression capabilities through mlx5 direct verbs Yishai Hadas
2017-03-06 14:06 ` [PATCH rdma-core 4/5] verbs: Add an option to provide vendor private data when creating a CQ Yishai Hadas
[not found] ` <1488809204-30428-5-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-06 18:07 ` Jason Gunthorpe
[not found] ` <20170306180723.GD11805-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-07 17:18 ` Yishai Hadas
[not found] ` <d3cc85f3-d5ef-5114-68a3-6989b5b26478-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-03-07 18:17 ` Jason Gunthorpe
[not found] ` <20170307181738.GC2228-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-07 22:10 ` Yishai Hadas
[not found] ` <6da2bd37-62c3-af73-fe81-5be57a327c2d-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-03-07 22:22 ` Jason Gunthorpe
[not found] ` <20170307222228.GB15314-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-14 15:14 ` Yishai Hadas
[not found] ` <b60069df-4c2f-6378-b9cb-b5e74acc8185-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-03-14 15:42 ` Jason Gunthorpe
2017-03-09 5:59 ` Hefty, Sean
2017-03-14 15:33 ` Doug Ledford
2017-03-06 14:06 ` [PATCH rdma-core 5/5] mlx5: Add support to create a CQ with compressed CQEs Yishai Hadas
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=1488809204-30428-3-git-send-email-yishaih@mellanox.com \
--to=yishaih-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
/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.