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 20/28] ib/sa: Export function to pack a path record into wire format
Date: Wed, 29 May 2013 10:09:26 -0700	[thread overview]
Message-ID: <1369847374-12176-21-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 converting from struct ib_sa_path_rec to the IB defined
SA path record wire format.  This will be used to report path
data from the rdma cm into user space.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/sa_query.c |    6 ++++++
 include/rdma/ib_sa.h               |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 934f45e..9838ca4 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -652,6 +652,12 @@ void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec)
 }
 EXPORT_SYMBOL(ib_sa_unpack_path);
 
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute)
+{
+	ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute);
+}
+EXPORT_SYMBOL(ib_sa_pack_path);
+
 static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
 				    int status,
 				    struct ib_sa_mad *mad)
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index 8275e53..125f871 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -402,6 +402,12 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
 			 struct ib_ah_attr *ah_attr);
 
 /**
+ * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec
+ * to IB MAD wire format.
+ */
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute);
+
+/**
  * ib_sa_unpack_path - Convert a path record from MAD format to struct
  * ib_sa_path_rec.
  */
@@ -418,4 +424,5 @@ int ib_sa_guid_info_rec_query(struct ib_sa_client *client,
 					       void *context),
 			      void *context,
 			      struct ib_sa_query **sa_query);
+
 #endif /* IB_SA_H */
-- 
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   ` [PATCH v5 12/28] rdma/cm: Add support for AF_IB to rdma_resolve_route sean.hefty-ral2JQCrhuEAvxtiuMwx3w
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   ` sean.hefty-ral2JQCrhuEAvxtiuMwx3w [this message]
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-21-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).