Skip to contentSkip to conversation

libibmad: Add ib_resolve_noderecord_via API

PATCH In review Sarat Kakarla 3 participants 9 messages Feb 12, 2013 – Feb 18, 2013 7 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libibmad: Add ib_resolve_noderecord_via API

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 10:32:05.000000000 -0800 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -934,6 +934,8 @@
     DEPRECATED;
 MAD_EXPORT int ib_resolve_self(ib_portid_t * portid, int *portnum,
             ibmad_gid_t * gid) DEPRECATED;
+MAD_EXPORT int ib_resolve_noderecord_via(char *addr_str,
+                                         const struct ibmad_port *srcport);
 
 /* resolve.c new interface */
 MAD_EXPORT int ib_resolve_smlid_via(ib_portid_t * sm_id, int timeout,
libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 10:47:13.000000000 -0800 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +1 -0
@@ -105,6 +105,7 @@
    ib_resolve_gid_via;
    ib_resolve_portid_str_via;
    ib_resolve_self_via;
+    ib_resolve_noderecord_via;
    mad_field_name;
    bm_call_via;
  local: *;
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 10:46:10.000000000 -0800 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +17 -0
@@ -226,3 +226,21 @@
 {
  return ib_resolve_self_via(portid, portnum, gid, ibmp);
 }
+
+int ib_resolve_noderecord_via(char *addr_str, const struct ibmad_port *srcport)
+{
+   uint64_t    guid;
+   ib_portid_t sm_id;
+   char        buf[IB_SA_DATA_SIZE] = { 0 };
+
+   if (!(guid = strtoull(addr_str, 0, 0)))
+     return -1;
+
+   if (ib_resolve_smlid_via(&sm_id, MAD_DEF_TIMEOUT_MS, srcport) < 0)
+      return -1;
+
+   return ib_node_query_via(srcport, guid, &sm_id, buf);
+}
+
+

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · Sarat Kakarla

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

Note that this patch depends on a patch previously submitted on 1/31 but not yet accepted: "libibmad: Add NodeRecord query API" due to it's use of ib_node_query_via below.

Quoted 19 lines
libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +0 -0

10:32:05.000000000 -0800

libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -934,6 +934,8 @@
     DEPRECATED;
 MAD_EXPORT int ib_resolve_self(ib_portid_t * portid, int *portnum,
             ibmad_gid_t * gid) DEPRECATED;
+MAD_EXPORT int ib_resolve_noderecord_via(char *addr_str,
+                                         const struct ibmad_port
 *srcport);
 
 /* resolve.c new interface */

MAD_EXPORT int ib_resolve_smlid_via(ib_portid_t * sm_id, int timeout,

libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +0 -0

10:47:13.000000000 -0800

libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 line 108

Quoted 4 lines
libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +1 -0
@@ -105,6 +105,7 @@
    ib_resolve_gid_via;
    ib_resolve_portid_str_via;
    ib_resolve_self_via;
+    ib_resolve_noderecord_via;

Formatting looks wrong to me here and other places. Is this using spaces rather than tabs ?

Quoted 13 lines
libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +0 -0
    mad_field_name;
    bm_call_via;
  local: *;
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +0 -0

10:46:10.000000000 -0800

libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -226,3 +226,21 @@
 {
  return ib_resolve_self_via(portid, portnum, gid, ibmp);
 }
+
+int ib_resolve_noderecord_via(char *addr_str, const struct ibmad_port

*srcport)

libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11

Quoted 9 lines
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +9 -0
+{
+   uint64_t    guid;
+   ib_portid_t sm_id;
+   char        buf[IB_SA_DATA_SIZE] = { 0 };
+
+   if (!(guid = strtoull(addr_str, 0, 0)))
+     return -1;
+
+   if (ib_resolve_smlid_via(&sm_id, MAD_DEF_TIMEOUT_MS, srcport) < 0)

Should second parameter be timeout rather than MAD_DEF_TIMEOUT_MS ?

-- Hal

Quoted 12 lines
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +6 -0
+      return -1;
+
+   return ib_node_query_via(srcport, guid, &sm_id, buf);
+}
+
+
Signature · 4 lines
-- 
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 511AC06B.3030005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#4 lore raw

Hal,

Thanks for reviewing it. My answers are in-lined with [SK] prefix.

Sarat

Quoted 20 lines · Hal Rosenstock
Quoted 1 line · Sarat Kakarla

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

Note that this patch depends on a patch previously submitted on 1/31 but not yet accepted: "libibmad: Add NodeRecord query API" due to it's use of ib_node_query_via below.

Quoted 13 lines
libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +0 -0

10:32:05.000000000 -0800

libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -934,6 +934,8 @@
      DEPRECATED;
  MAD_EXPORT int ib_resolve_self(ib_portid_t * portid, int *portnum,
              ibmad_gid_t * gid) DEPRECATED;
+MAD_EXPORT int ib_resolve_noderecord_via(char *addr_str,
+                                         const struct ibmad_port
 *srcport);
 
Quoted 13 lines

libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 line 108

Quoted 10 lines
libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +0 -0
  /* resolve.c new interface */

MAD_EXPORT int ib_resolve_smlid_via(ib_portid_t * sm_id, int timeout,

libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +0 -0

10:47:13.000000000 -0800

libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +1 -0
@@ -105,6 +105,7 @@
     ib_resolve_gid_via;
     ib_resolve_portid_str_via;
     ib_resolve_self_via;
+    ib_resolve_noderecord_via;

Formatting looks wrong to me here and other places. Is this using spaces rather than tabs ?

[SK] By habit I have used spaces I will replace them with the tabs.

Quoted 17 lines
Quoted 17 lines
libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +0 -0
     mad_field_name;
     bm_call_via;
   local: *;
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +0 -0

10:46:10.000000000 -0800

libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -226,3 +226,21 @@
  {
   return ib_resolve_self_via(portid, portnum, gid, ibmp);
  }
+
+int ib_resolve_noderecord_via(char *addr_str, const struct ibmad_port

*srcport)

libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +3 -0
+{
+   uint64_t    guid;
+   ib_portid_t sm_id;
Quoted 8 lines

libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11

Quoted 6 lines
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +6 -0
+   char        buf[IB_SA_DATA_SIZE] = { 0 };
+
+   if (!(guid = strtoull(addr_str, 0, 0)))
+     return -1;
+
+   if (ib_resolve_smlid_via(&sm_id, MAD_DEF_TIMEOUT_MS, srcport) < 0)

Should second parameter be timeout rather than MAD_DEF_TIMEOUT_MS ?

[SK] I wanted to make ib_resolve_noderecord_via look like ib_resolve_portid_str_via API which does not take any timeout parameter.
I can pass '0' instead of MAD_DEF_TIMEOUT_MS, that's what passed as timeout to ib_resolve_guid_via function from ib_resolve_portid_str_via function.

Quoted 10 lines

-- Hal

Quoted 7 lines
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +6 -0
+      return -1;
+
+   return ib_node_query_via(srcport, guid, &sm_id, buf);
+}
+
+
Quoted 6 lines
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 4 lines · Sarat Kakarla

[SK] I wanted to make ib_resolve_noderecord_via look like ib_resolve_portid_str_via API which does not take any timeout parameter.

I can pass '0' instead of MAD_DEF_TIMEOUT_MS, that's what passed as timeout to ib_resolve_guid_via function from ib_resolve_portid_str_via function.

Are you looking at an older version of libibmad ? The upstream ib_resolve_guid_via has timeout as second parameter as do other similar calls to ib_resolve_smlid_via.

-- Hal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 511ACDE4.1080006-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#8 lore raw

Hal,

ib_resolve_guid_via has timeout parameter but when it is getting called from ib_resolve_portid_str_via the value is specified as 0.

int ib_resolve_portid_str_via(ib_portid_t * portid, char *addr_str,
enum MAD_DEST dest_type, ib_portid_t * sm_id, const struct ibmad_port *srcport)
{

case IB_DEST_GUID:

    if (!(guid = strtoull(addr_str, 0, 0)))
      return -1;

    /* keep guid in portid? */
    return ib_resolve_guid_via(portid, &guid, sm_id, 0, srcport);

Thanks
Sarat

Quoted 12 lines · Hal Rosenstock
Quoted 4 lines · Sarat Kakarla

[SK] I wanted to make ib_resolve_noderecord_via look like ib_resolve_portid_str_via API which does not take any timeout parameter.

I can pass '0' instead of MAD_DEF_TIMEOUT_MS, that's what passed as timeout to ib_resolve_guid_via function from ib_resolve_portid_str_via function.

Are you looking at an older version of libibmad ? The upstream ib_resolve_guid_via has timeout as second parameter as do other similar calls to ib_resolve_smlid_via.

-- Hal

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to a message not in the archive
Quoted 1 line · On Tue, 12 Feb 2013 12:39:44 -0800 Sarat Kakarla…

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

I have a more fundamental question: Do you have a use case for this?

Ira

Quoted 52 lines
libibmad-1.3.3.wrapper/include/infiniband/mad.h 2013-02-07 10:32:05.000000000 -0800 renamed from infiniband/mad.h 2009-11-01 16:17:12.000000000 -0800 +2 -0
@@ -934,6 +934,8 @@
      DEPRECATED;
  MAD_EXPORT int ib_resolve_self(ib_portid_t * portid, int *portnum,
              ibmad_gid_t * gid) DEPRECATED;
+MAD_EXPORT int ib_resolve_noderecord_via(char *addr_str,
+                                         const struct ibmad_port *srcport);
 
  /* resolve.c new interface */
  MAD_EXPORT int ib_resolve_smlid_via(ib_portid_t * sm_id, int timeout,
libibmad-1.3.3.wrapper/src/libibmad.map 2013-02-11 10:47:13.000000000 -0800 renamed from libibmad.map 2009-10-29 18:18:01.000000000 -0700 +1 -0
@@ -105,6 +105,7 @@
     ib_resolve_gid_via;
     ib_resolve_portid_str_via;
     ib_resolve_self_via;
+    ib_resolve_noderecord_via;
     mad_field_name;
     bm_call_via;
   local: *;
libibmad-1.3.3.wrapper/src/resolve.c 2013-02-11 10:46:10.000000000 -0800 renamed from resolve.c 2009-11-01 16:17:12.000000000 -0800 +17 -1
@@ -226,3 +226,21 @@
  {
   return ib_resolve_self_via(portid, portnum, gid, ibmp);
  }
+
+int ib_resolve_noderecord_via(char *addr_str, const struct ibmad_port *srcport)
+{
+   uint64_t    guid;
+   ib_portid_t sm_id;
+   char        buf[IB_SA_DATA_SIZE] = { 0 };
+
+   if (!(guid = strtoull(addr_str, 0, 0)))
+     return -1;
+
+   if (ib_resolve_smlid_via(&sm_id, MAD_DEF_TIMEOUT_MS, srcport) < 0)
+      return -1;
+
+   return ib_node_query_via(srcport, guid, &sm_id, buf);
+}
+
+
 
--

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 9 lines
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20130212152859.b62c4d6df7bd5bf0a393fa4a-i2BcT+NCU+M@public.gmane.org

#11 lore raw
Quoted 9 lines · Ira Weiny
Quoted 1 line · On Tue, 12 Feb 2013 12:39:44 -0800 Sarat Kakarla…

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

I have a more fundamental question: Do you have a use case for this?

Ira

The main purpose of this wrapper to make ib_resolve_noderecord_via as a single API call to resolve a node by looking at node record. From oracle's point of view since we have already included the name and signature of this ib_resolve_noderecord_via in our executable we thought it would be helpful to have this wrapper so that we can just drop the new library without changing/rebuilding our binaries.

Thanks
Sarat

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 6 lines · On Tue, 12 Feb 2013 15:36:11 -0800 Sarat Kakarla…
Quoted 3 lines · Ira Weiny

On Tue, 12 Feb 2013 12:39:44 -0800
Sarat Kakarla <[email protected]> wrote:

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

I have a more fundamental question: Do you have a use case for this?

Ira

The main purpose of this wrapper to make ib_resolve_noderecord_via as a single API call to resolve a node by looking at node record.

But this does not actually "resolve" anything. AFAICT it just returns if a NodeRecord exists.

Ira

Quoted 11 lines

From oracle's point of view since we have
already included the name and signature of this ib_resolve_noderecord_via in our executable we thought it would be helpful to have this wrapper so that we can just drop the new library without changing/rebuilding our binaries.

Thanks
Sarat

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 9 lines
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20130212154949.2ff378f25c6cce7e6119137c-i2BcT+NCU+M@public.gmane.org

#15 lore raw

Ira & Hal,

I have talked to my management about this wrapper and decided to add it to our code instead of libibmad, so for now I am dropping the merge request.

Thanks
Sarat

Quoted 13 lines · Ira Weiny
Quoted 10 lines · On Tue, 12 Feb 2013 15:36:11 -0800 Sarat Kakarla…
Quoted 7 lines · Ira Weiny
Quoted 1 line · On Tue, 12 Feb 2013 12:39:44 -0800 Sarat Kakarla…

Add ib_resolve_noderecord_via wrapper similar to ib_resolve_portid_str_via

I have a more fundamental question: Do you have a use case for this?

Quoted 21 lines
Quoted 3 lines
Quoted 2 lines

Ira

The main purpose of this wrapper to make ib_resolve_noderecord_via as a single API call to resolve a node by looking at node record.

But this does not actually "resolve" anything. AFAICT it just returns if a NodeRecord exists.

Ira

Quoted 11 lines

From oracle's point of view since we have
already included the name and signature of this ib_resolve_noderecord_via in our executable we thought it would be helpful to have this wrapper so that we can just drop the new library without changing/rebuilding our binaries.

Thanks
Sarat

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html