netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
To: roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v5 12/28] rdma/cm: Add support for AF_IB to rdma_resolve_route
Date: Wed, 29 May 2013 10:09:18 -0700	[thread overview]
Message-ID: <1369847374-12176-13-git-send-email-sean.hefty@intel.com> (raw)
In-Reply-To: <1369847374-12176-1-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

From: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Allow rdma_resolve_route to handle the case where the user
specified the source and destination addresses using AF_IB.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/cma.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 2b5dfee..f54169b 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1743,6 +1743,7 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms,
 	struct ib_sa_path_rec path_rec;
 	ib_sa_comp_mask comp_mask;
 	struct sockaddr_in6 *sin6;
+	struct sockaddr_ib *sib;
 
 	memset(&path_rec, 0, sizeof path_rec);
 	rdma_addr_get_sgid(dev_addr, &path_rec.sgid);
@@ -1756,13 +1757,21 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms,
 		    IB_SA_PATH_REC_PKEY | IB_SA_PATH_REC_NUMB_PATH |
 		    IB_SA_PATH_REC_REVERSIBLE | IB_SA_PATH_REC_SERVICE_ID;
 
-	if (cma_family(id_priv) == AF_INET) {
+	switch (cma_family(id_priv)) {
+	case AF_INET:
 		path_rec.qos_class = cpu_to_be16((u16) id_priv->tos);
 		comp_mask |= IB_SA_PATH_REC_QOS_CLASS;
-	} else {
+		break;
+	case AF_INET6:
 		sin6 = (struct sockaddr_in6 *) cma_src_addr(id_priv);
 		path_rec.traffic_class = (u8) (be32_to_cpu(sin6->sin6_flowinfo) >> 20);
 		comp_mask |= IB_SA_PATH_REC_TRAFFIC_CLASS;
+		break;
+	case AF_IB:
+		sib = (struct sockaddr_ib *) cma_src_addr(id_priv);
+		path_rec.traffic_class = (u8) (be32_to_cpu(sib->sib_flowinfo) >> 20);
+		comp_mask |= IB_SA_PATH_REC_TRAFFIC_CLASS;
+		break;
 	}
 
 	id_priv->query_id = ib_sa_path_rec_get(&sa_client, id_priv->id.device,
-- 
1.7.3

--
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:[~2013-05-29 17:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 17:09 [PATCH v5 00/28] rdma/cm: Add support for native IB addressing sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09 ` [PATCH v5 08/28] rdma/cm: Add helper functions to return id address information sean.hefty
     [not found] ` <1369847374-12176-1-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-05-29 17:09   ` [PATCH v5 01/28] rdma/cm: define native IB address sean.hefty-ral2JQCrhuEAvxtiuMwx3w
     [not found]     ` <1369847374-12176-2-git-send-email-sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-06-10 17:49       ` Hefty, Sean
2013-05-29 17:09   ` [PATCH v5 02/28] rdma/cm: Allow enabling reuseaddr in any state sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 03/28] rdma/cm: Include AF_IB in loopback and any address checks sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 04/28] ib/addr: Add AF_IB support to ip_addr_size sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 05/28] rdma/cm: Update port reservation to support AF_IB sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 06/28] rdma/cm: Allow user to specify AF_IB when binding sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 07/28] rdma/cm: Do not modify sa_family when setting loopback address sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 09/28] rdma/cm: Restrict AF_IB loopback to binding to IB devices only sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 10/28] rdma/cm: Verify that source and dest sa_family are the same sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 11/28] rdma/cm: Add support for AF_IB to rdma_resolve_addr sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` sean.hefty-ral2JQCrhuEAvxtiuMwx3w [this message]
2013-05-29 17:09   ` [PATCH v5 14/28] rdma/cm: Remove unused SDP related code sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 15/28] rdma/cm: Merge cma_get/save_net_info sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 16/28] rdma/cm: Expose private data when using AF_IB sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 18/28] rdma/cm: Only listen on IB devices " sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 19/28] rdma/ucm: Support querying for AF_IB addresses sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 20/28] ib/sa: Export function to pack a path record into wire format sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 21/28] rdma/ucm: Support querying when IB paths are not reversible sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 22/28] rdma/cm: Export cma_get_service_id sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 26/28] rdma/ucm: Allow user space to pass AF_IB into resolve sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 27/28] rdma/ucm: Allow user space to specify AF_IB when joining multicast sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09   ` [PATCH v5 28/28] rdma/cm: Export AF_IB statistics sean.hefty-ral2JQCrhuEAvxtiuMwx3w
2013-05-29 17:09 ` [PATCH v5 13/28] rdma/cm: Add support for AF_IB to cma_get_service_id sean.hefty
2013-05-29 17:09 ` [PATCH v5 17/28] rdma/cm: Set qkey for AF_IB sean.hefty
2013-05-29 17:09 ` [PATCH v5 23/28] rdma/ucm: Add ability to query GID addresses sean.hefty
2013-05-29 17:09 ` [PATCH v5 24/28] rdma/ucm: Name changes to indicate only IP addresses supported sean.hefty
2013-05-29 17:09 ` [PATCH v5 25/28] rdma/ucm: Allow user space to bind to AF_IB sean.hefty

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=1369847374-12176-13-git-send-email-sean.hefty@intel.com \
    --to=sean.hefty-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-BHEL68pLQRGGvPXPguhicg@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;
as well as URLs for NNTP newsgroup(s).