public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	RDMA mailing list
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-next v2 13/14] IB/mlx5: Don't advertise RAW QP support in dual port mode
Date: Thu,  4 Jan 2018 17:25:43 +0200	[thread overview]
Message-ID: <20180104152544.28919-14-leon@kernel.org> (raw)
In-Reply-To: <20180104152544.28919-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

From: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

When operating in dual port RoCE mode FW doesn't support steering for
raw QPs on the slave port. They still work on the master port, but
the user has no way of knowing which port is the master. The
capability is reported per device, not per port.

Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 653b56377e69..5d6fba986fa5 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -731,6 +731,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	int max_rq_sg;
 	int max_sq_sg;
 	u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
+	bool raw_support = !mlx5_core_mp_enabled(mdev);
 	struct mlx5_ib_query_device_resp resp = {};
 	size_t resp_len;
 	u64 max_tso;
@@ -794,7 +795,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	if (MLX5_CAP_GEN(mdev, block_lb_mc))
 		props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK;
 
-	if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) {
+	if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) && raw_support) {
 		if (MLX5_CAP_ETH(mdev, csum_cap)) {
 			/* Legacy bit to support old userspace libraries */
 			props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM;
@@ -843,7 +844,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 	}
 
 	if (MLX5_CAP_GEN(dev->mdev, rq_delay_drop) &&
-	    MLX5_CAP_GEN(dev->mdev, general_notification_event))
+	    MLX5_CAP_GEN(dev->mdev, general_notification_event) &&
+	    raw_support)
 		props->raw_packet_caps |= IB_RAW_PACKET_CAP_DELAY_DROP;
 
 	if (MLX5_CAP_GEN(mdev, ipoib_enhanced_offloads) &&
@@ -851,7 +853,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
 
 	if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) &&
-	    MLX5_CAP_ETH(dev->mdev, scatter_fcs)) {
+	    MLX5_CAP_ETH(dev->mdev, scatter_fcs) &&
+	    raw_support) {
 		/* Legacy bit to support old userspace libraries */
 		props->device_cap_flags |= IB_DEVICE_RAW_SCATTER_FCS;
 		props->raw_packet_caps |= IB_RAW_PACKET_CAP_SCATTER_FCS;
@@ -915,7 +918,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		props->device_cap_flags |= IB_DEVICE_VIRTUAL_FUNCTION;
 
 	if (mlx5_ib_port_link_layer(ibdev, 1) ==
-	    IB_LINK_LAYER_ETHERNET) {
+	    IB_LINK_LAYER_ETHERNET && raw_support) {
 		props->rss_caps.max_rwq_indirection_tables =
 			1 << MLX5_CAP_GEN(dev->mdev, log_max_rqt);
 		props->rss_caps.max_rwq_indirection_table_size =
@@ -952,7 +955,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		resp.response_length += sizeof(resp.cqe_comp_caps);
 	}
 
-	if (field_avail(typeof(resp), packet_pacing_caps, uhw->outlen)) {
+	if (field_avail(typeof(resp), packet_pacing_caps, uhw->outlen) &&
+	    raw_support) {
 		if (MLX5_CAP_QOS(mdev, packet_pacing) &&
 		    MLX5_CAP_GEN(mdev, qos)) {
 			resp.packet_pacing_caps.qp_rate_limit_max =
@@ -1011,7 +1015,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		}
 	}
 
-	if (field_avail(typeof(resp), striding_rq_caps, uhw->outlen)) {
+	if (field_avail(typeof(resp), striding_rq_caps, uhw->outlen) &&
+	    raw_support) {
 		resp.response_length += sizeof(resp.striding_rq_caps);
 		if (MLX5_CAP_GEN(mdev, striding_rq)) {
 			resp.striding_rq_caps.min_single_stride_log_num_of_bytes =
@@ -3681,12 +3686,14 @@ static u32 get_core_cap_flags(struct ib_device *ibdev)
 	enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, 1);
 	u8 l3_type_cap = MLX5_CAP_ROCE(dev->mdev, l3_type);
 	u8 roce_version_cap = MLX5_CAP_ROCE(dev->mdev, roce_version);
+	bool raw_support = !mlx5_core_mp_enabled(dev->mdev);
 	u32 ret = 0;
 
 	if (ll == IB_LINK_LAYER_INFINIBAND)
 		return RDMA_CORE_PORT_IBA_IB;
 
-	ret = RDMA_CORE_PORT_RAW_PACKET;
+	if (raw_support)
+		ret = RDMA_CORE_PORT_RAW_PACKET;
 
 	if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV4_CAP))
 		return ret;
-- 
2.15.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

  parent reply	other threads:[~2018-01-04 15:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 15:25 [PATCH rdma-next v2 00/14] index e382a3ca759e..d4a471a76d82 100644 Leon Romanovsky
     [not found] ` <20180104152544.28919-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-04 15:25   ` [PATCH rdma-next v2 01/14] net/mlx5: Fix race for multiple RoCE enable Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 02/14] net/mlx5: Set software owner ID during init HCA Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 03/14] IB/core: Change roce_rescan_device to return void Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 04/14] IB/mlx5: Reduce the use of num_port capability Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 05/14] IB/mlx5: Make netdev notifications multiport capable Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 06/14] {net,IB}/mlx5: Manage port association for multiport RoCE Leon Romanovsky
     [not found]     ` <20180104152544.28919-7-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-01-04 23:33       ` Jason Gunthorpe
     [not found]         ` <20180104233334.GA18993-uk2M96/98Pc@public.gmane.org>
2018-01-05  6:36           ` Leon Romanovsky
2018-01-05 13:47           ` Daniel Jurgens
2018-01-04 15:25   ` [PATCH rdma-next v2 07/14] IB/mlx5: Move IB event processing onto a workqueue Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 08/14] IB/mlx5: Implement dual port functionality in query routines Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 09/14] IB/mlx5: Change debugfs to have per port contents Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 10/14] IB/mlx5: Update counter implementation for dual port RoCE Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 11/14] {net,IB}/mlx5: Change set_roce_gid to take a port number Leon Romanovsky
2018-01-04 15:25   ` [PATCH rdma-next v2 12/14] IB/mlx5: Route MADs for dual port RoCE Leon Romanovsky
2018-01-04 15:25   ` Leon Romanovsky [this message]
2018-01-04 15:25   ` [PATCH rdma-next v2 14/14] net/mlx5: Set num_vhca_ports capability Leon Romanovsky
2018-01-04 19:53   ` [PATCH rdma-next v2 00/14] index e382a3ca759e..d4a471a76d82 100644 Or Gerlitz
     [not found]     ` <CAJ3xEMjptQf99ZdGxkB6kTh9LkQ7-pjiObMh+knDWXFStPOg7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04 21:50       ` Daniel Jurgens
     [not found]         ` <2618f285-6fa4-06ac-4b4a-51d0b2660b61-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-05 14:59           ` Or Gerlitz
     [not found]             ` <CAJ3xEMhVxBqJUwdRn3BXJPnf9J-_gXtrWrQgun3bCEW7W7Oq1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 15:03               ` Daniel Jurgens
     [not found]                 ` <792bac90-b1eb-110f-399c-08d5309d92dd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-05 15:22                   ` Or Gerlitz
     [not found]                     ` <CAJ3xEMjOGEQQf+y4wEEPiS_F9fhYmDwBmd=ucUDQX_9416gzKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-05 15:57                       ` Daniel Jurgens
     [not found]                         ` <d15d980b-1d67-277e-60f8-0b7e92035a06-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-05 20:44                           ` Or Gerlitz
2018-01-09  2:51   ` Jason Gunthorpe

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=20180104152544.28919-14-leon@kernel.org \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=parav-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox