All of lore.kernel.org
 help / color / mirror / Atom feed
From: israelr@mellanox.com (Israel Rukshin)
Subject: [PATCH 2/5] nvme-rdma: Add TOS for rdma transport
Date: Sun, 18 Aug 2019 12:08:52 +0300	[thread overview]
Message-ID: <1566119335-15058-4-git-send-email-israelr@mellanox.com> (raw)
In-Reply-To: <1566119335-15058-1-git-send-email-israelr@mellanox.com>

For RDMA transports, TOS is an extension of IB QoS to provide clients
the ability to segregate traffic flows for different type of data.
RDMA CM abstract it for ULPs using rdma_set_service_type().
Internally, each traffic flow is represented by a connection with all of
its independent resources like that of a normal connection, and is
differentiated by service type. In other words, there can be multiple qp
connections between an IP pair and each supports a unique service type.

One of the TOS usage is bandwidth management which allows setting bandwidth
limits for QoS classes, e.g. 80% bandwidth to controllers at QoS class A
and 20% to controllers at QoS class B.

Note: In addition to the TOS configuration, QOS must be configured on the
relevant HCA on the target (send RDMA commands) and initiator to effect
the traffic.

usage examples:
nvme connect --tos=0 --transport=rdma --traddr=10.0.1.1 --nqn=test-nvme

Signed-off-by: Israel Rukshin <israelr at mellanox.com>
Reviewed-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/host/rdma.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index c029ef1..017e48a 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1536,16 +1536,18 @@ static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
 
 static int nvme_rdma_addr_resolved(struct nvme_rdma_queue *queue)
 {
+	struct nvme_ctrl *ctrl = &queue->ctrl->ctrl;
 	int ret;
 
 	ret = nvme_rdma_create_queue_ib(queue);
 	if (ret)
 		return ret;
 
+	if (ctrl->opts->tos >= 0)
+		rdma_set_service_type(queue->cm_id, ctrl->opts->tos);
 	ret = rdma_resolve_route(queue->cm_id, NVME_RDMA_CONNECT_TIMEOUT_MS);
 	if (ret) {
-		dev_err(queue->ctrl->ctrl.device,
-			"rdma_resolve_route failed (%d).\n",
+		dev_err(ctrl->device, "rdma_resolve_route failed (%d).\n",
 			queue->cm_error);
 		goto out_destroy_queue;
 	}
@@ -2040,7 +2042,8 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,
 	.required_opts	= NVMF_OPT_TRADDR,
 	.allowed_opts	= NVMF_OPT_TRSVCID | NVMF_OPT_RECONNECT_DELAY |
 			  NVMF_OPT_HOST_TRADDR | NVMF_OPT_CTRL_LOSS_TMO |
-			  NVMF_OPT_NR_WRITE_QUEUES | NVMF_OPT_NR_POLL_QUEUES,
+			  NVMF_OPT_NR_WRITE_QUEUES | NVMF_OPT_NR_POLL_QUEUES |
+			  NVMF_OPT_TOS,
 	.create_ctrl	= nvme_rdma_create_ctrl,
 };
 
-- 
1.8.3.1

  parent reply	other threads:[~2019-08-18  9:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18  9:08 [PATCH 0/5 V5] nvme: Add type of service (TOS) configuration Israel Rukshin
2019-08-18  9:08 ` [PATCH] nvme-cli/fabrics: Add tos param to connect cmd Israel Rukshin
2019-08-18  9:08 ` [PATCH 1/5] nvme-fabrics: Add type of service (TOS) configuration Israel Rukshin
2019-08-18  9:08 ` Israel Rukshin [this message]
2019-08-18  9:08 ` [PATCH 3/5] nvme-tcp: Use struct nvme_ctrl directly Israel Rukshin
2019-08-18  9:08 ` [PATCH 4/5] nvme-tcp: Add TOS for tcp transport Israel Rukshin
2019-08-18  9:08 ` [PATCH 5/5] nvmet-tcp: " Israel Rukshin
     [not found] ` <054fa45e-a2ee-d291-4c71-75f7a1872f9a@grimberg.me>
2019-09-01 11:18   ` [PATCH 0/5 V5] nvme: Add type of service (TOS) configuration Max Gurtovoy
2019-09-01 15:11     ` Keith Busch
  -- strict thread matches above, loose matches on Subject: below --
2019-08-15 13:33 [PATCH 0/5 V4] " Israel Rukshin
2019-08-15 13:33 ` [PATCH 2/5] nvme-rdma: Add TOS for rdma transport Israel Rukshin
2019-08-14 10:19 [PATCH 0/5 V3] nvme: Add type of service (TOS) configuration Israel Rukshin
2019-08-14 10:19 ` [PATCH 2/5] nvme-rdma: Add TOS for rdma transport Israel Rukshin
2019-08-13 13:17 [PATCH 0/5 V2] nvme: Add type of service (TOS) configuration Israel Rukshin
2019-08-13 13:17 ` [PATCH 2/5] nvme-rdma: Add TOS for rdma transport Israel Rukshin
2019-08-13 16:40   ` Sagi Grimberg

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=1566119335-15058-4-git-send-email-israelr@mellanox.com \
    --to=israelr@mellanox.com \
    /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.