Re: partitions / ib_read_bw

2013-06-22 Thread Hal Rosenstock
On 6/21/2013 5:48 PM, Coulter, Susan K wrote:
 
 One of my test clusters is running with multiple partitions.
 The partitions look correct (using smpquery pkey) and the path records look 
 correct (using saquery pr).
 
 I'd like a simple user-level test to validate who is allowed to talk to who; 
 and hoped to use ib_read_bw.
 Alas, ib_read_bw does not honor partitions.
 
 Below is a patch I wrote to try and add pkey support to ib_read_bw.  No joy.
 
 The server shows it is populating ibv_qp_attr with the pkey(s) of any full 
 partition it is a member of, 
 but the client does not get that same pkey in ibv_wc.
 
 What am I missing?

The QPs need to be bound to the proper pkey index. An additional command
line pkey parameter is needed on client and maybe also server side.
Server side pkey parameter could be avoided if QPs are initialized for
all pkeys configured.

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


Re: [PATCH V2] libibverbs: Allow arbitrary int values for MTU.

2013-06-22 Thread Jeff Squyres (jsquyres)
On Jun 21, 2013, at 5:20 PM, Jason Gunthorpe jguntho...@obsidianresearch.com 
wrote:

 Jeff: If you are still reading -

I am still reading, just didn't have much to contribute until now.  :-)

 one concrete suggestion, I think, is
 to ensure compile-time failure when the new-format MTU variable is
 touched.  This is trivially done by wrapping it in a struct:
 
 struct ibv_mtu_t {int __mtu;};

Sure, I can work up a patch that does this.

Do others agree?  Roland?

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

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


[PATCHv3 infiniband-diags] saquery: Add SMInfoRecord support

2013-06-22 Thread Hal Rosenstock

This patch is the combination of 2 patches:
 infiniband_diags/src/saquery.c: Add SMInfoRecord support
 infiniband_diags/doc/rst/saquery.8.in.rst: Add support to the manual

Signed-off-by: Husam Kahalah hkaha...@asaltech.com
Signed-off-by: Hal Rosenstock h...@mellanox.com
---
This patch is based on Husam's previous patch for this.

diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
index 8d87096..0551917 100644
--- a/doc/rst/saquery.8.in.rst
+++ b/doc/rst/saquery.8.in.rst
@@ -156,6 +156,7 @@ Supported query names (and aliases):
 MFTRecord (MFTR) [[mlid]/[position]/[block]]
 GUIDInfoRecord (GIR) [[lid]/[block]]
 SwitchInfoRecord (SWIR) [lid]
+SMInfoRecord (SMIR) [lid]
 
 
 
diff --git a/src/saquery.c b/src/saquery.c
index 26b2a9d..8f59253 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -489,6 +489,30 @@ static void dump_service_record(void *data)
   cl_ntoh64(p_sr-service_data64[1]));
 }
 
+static void dump_sm_info_record(void *data)
+{
+   ib_sminfo_record_t *p_smr = data;
+   const ib_sm_info_t *const p_smi = p_smr-sm_info;
+   uint8_t priority, state;
+   priority = ib_sminfo_get_priority(p_smi);
+   state = ib_sminfo_get_state(p_smi);
+
+   printf(SMInfoRecord dump:\n
+  \t\tRID\n
+  \t\tLID...%u\n
+  \t\tSMInfo dump:\n
+  \t\tGUID..0x%016 PRIx64 \n
+  \t\tSM_Key0x%016 PRIx64 \n
+  \t\tActCount..%u\n
+  \t\tPriority..%u\n
+  \t\tSMState...%u\n,
+  cl_ntoh16(p_smr-lid),
+  cl_ntoh64(p_smr-sm_info.guid),
+  cl_ntoh64(p_smr-sm_info.sm_key),
+  cl_ntoh32(p_smr-sm_info.act_count),
+  priority, state);
+}
+
 static void dump_switch_info_record(void *data)
 {
ib_switch_info_record_t *p_sir = data;
@@ -1194,6 +1218,25 @@ static int query_service_records(const struct query_cmd 
*q, struct sa_handle * h
dump_service_record);
 }
 
+static int query_sm_info_records(const struct query_cmd *q,
+struct sa_handle * h, struct query_params *p,
+int argc, char *argv[])
+{
+   ib_sminfo_record_t smir;
+   ib_net64_t comp_mask = 0;
+   int lid = 0;
+
+   if (argc  0)
+   parse_lid_and_ports(h, argv[0], lid, NULL, NULL);
+
+   memset(smir, 0, sizeof(smir));
+   CHECK_AND_SET_VAL(lid, 16, 0, smir.lid, SMIR, LID);
+
+   return get_and_dump_any_records(h, IB_SA_ATTR_SMINFORECORD, 0,
+   comp_mask, smir, sizeof(smir),
+   dump_sm_info_record);
+}
+
 static int query_switchinfo_records(const struct query_cmd *q,
struct sa_handle * h, struct query_params *p,
int argc, char *argv[])
@@ -1406,6 +1449,8 @@ static const struct query_cmd query_cmds[] = {
 [[lid]/[block]], query_guidinfo_records},
{SwitchInfoRecord, SWIR, IB_SA_ATTR_SWITCHINFORECORD,
 [lid], query_switchinfo_records},
+   {SMInfoRecord, SMIR, IB_SA_ATTR_SMINFORECORD,
+[lid], query_sm_info_records},
{0}
 };
 
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] IB/qib: add optional numa affinity

2013-06-22 Thread Or Gerlitz
Mike Marciniszyn mike.marcinis...@intel.com wrote:

 From: Ramkrishna Vepa ramkrishna.v...@intel.com

 This patch adds context relative numa affinity conditioned on the
 module parameter numa_aware. The qib_ctxtdata has an additional
 node_id member and qib_create_ctxtdata() has an addition node_id parameter.

Could you elaborate why making numa awareness be conditioned on module
parameter?

Or.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Subject: [PATCH] infiniband-diags: saquery: Dump SwitchInfoRecord based on IsSetMulticastFDBTopSupported SA Capability

2013-06-22 Thread Ira Weiny

Only include MulticastFDBTop when SA
ClassPortInfo:CapabilityMask2.IsSetMulticastFDBTopSupported is set

In order to do this, SA CPI is queried prior to other queries and passed to all
dump functions via query_params when required.

Original patch supplied by Hal Rosenstock.

Signed-off-by: Hal Rosenstock h...@mellanox.com
Signed-off-by: Ira Weiny ira.we...@intel.com
---
 src/saquery.c |  206 
 1 files changed, 118 insertions(+), 88 deletions(-)

diff --git a/src/saquery.c b/src/saquery.c
index 26b2a9d..8c17dd4 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1,8 +1,8 @@
 /*
  * Copyright (c) 2006,2007 The Regents of the University of California.
  * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2002-2013 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2013 Intel Corporation. All rights reserved.
  * Copyright (c) 2009 HNR Consulting. All rights reserved.
  *
  * Produced at Lawrence Livermore National Laboratory.
@@ -65,6 +65,8 @@
  IB_PR_COMPMASK_SERVICEID_LSB)
 #endif
 
+#define UMAD_SA_CAP_MASK2_IS_MCAST_TOP_SUP (1  3)
+
 struct query_params {
uint64_t service_id;
ib_gid_t sgid, dgid, gid, mgid;
@@ -80,6 +82,7 @@ struct query_params {
uint8_t scope;
uint8_t join_state;
int proxy_join;
+   ib_class_port_info_t cpi;
 };
 
 struct query_cmd {
@@ -137,7 +140,7 @@ static void print_node_desc(ib_node_record_t * node_record)
}
 }
 
-static void dump_node_record(void *data)
+static void dump_node_record(void *data, struct query_params *p)
 {
ib_node_record_t *nr = data;
ib_node_info_t *ni = nr-node_info;
@@ -201,10 +204,10 @@ static void print_node_record(ib_node_record_t * 
node_record)
break;
}
 
-   dump_node_record(node_record);
+   dump_node_record(node_record, 0);
 }
 
-static void dump_path_record(void *data)
+static void dump_path_record(void *data, struct query_params *p)
 {
char gid_str[INET6_ADDRSTRLEN];
char gid_str2[INET6_ADDRSTRLEN];
@@ -238,11 +241,10 @@ static void dump_path_record(void *data)
   p_pr-resv2[3], p_pr-resv2[4], p_pr-resv2[5]);
 }
 
-static void dump_class_port_info(void *data)
+static void dump_class_port_info(ib_class_port_info_t *cpi)
 {
char gid_str[INET6_ADDRSTRLEN];
char gid_str2[INET6_ADDRSTRLEN];
-   ib_class_port_info_t *cpi = data;
 
printf(SA ClassPortInfo:\n
   \t\tBase version.%d\n
@@ -262,19 +264,19 @@ static void dump_class_port_info(void *data)
   \t\tTrap PKey0x%04X\n
   \t\tTrap HL/QP...0x%08X\n
   \t\tTrap QKey0x%08X\n,
-  cpi-base_ver, cpi-class_ver, cl_ntoh16(cpi-cap_mask),
+  cpi-base_ver, cpi-class_ver, ntohs(cpi-cap_mask),
   ib_class_cap_mask2(cpi), ib_class_resp_time_val(cpi),
   inet_ntop(AF_INET6, (cpi-redir_gid), gid_str, sizeof gid_str),
-  cl_ntoh32(cpi-redir_tc_sl_fl), cl_ntoh16(cpi-redir_lid),
-  cl_ntoh16(cpi-redir_pkey), cl_ntoh32(cpi-redir_qp),
-  cl_ntoh32(cpi-redir_qkey),
+  ntohl(cpi-redir_tc_sl_fl), ntohs(cpi-redir_lid),
+  ntohs(cpi-redir_pkey), ntohl(cpi-redir_qp),
+  ntohl(cpi-redir_qkey),
   inet_ntop(AF_INET6, (cpi-trap_gid), gid_str2, sizeof gid_str2),
-  cl_ntoh32(cpi-trap_tc_sl_fl), cl_ntoh16(cpi-trap_lid),
-  cl_ntoh16(cpi-trap_pkey), cl_ntoh32(cpi-trap_hop_qp),
-  cl_ntoh32(cpi-trap_qkey));
+  ntohl(cpi-trap_tc_sl_fl), ntohs(cpi-trap_lid),
+  ntohs(cpi-trap_pkey), ntohl(cpi-trap_hop_qp),
+  ntohl(cpi-trap_qkey));
 }
 
-static void dump_portinfo_record(void *data)
+static void dump_portinfo_record(void *data, struct query_params *p)
 {
ib_portinfo_record_t *p_pir = data;
const ib_port_info_t *const p_pi = p_pir-port_info;
@@ -290,7 +292,7 @@ static void dump_portinfo_record(void *data)
   cl_ntoh32(p_pi-capability_mask));
 }
 
-static void dump_one_portinfo_record(void *data)
+static void dump_one_portinfo_record(void *data, struct query_params *p)
 {
ib_portinfo_record_t *pir = data;
ib_port_info_t *pi = pir-port_info;
@@ -305,7 +307,7 @@ static void dump_one_portinfo_record(void *data)
dump_portinfo(pi, sizeof(*pi), 2);
 }
 
-static void dump_one_mcmember_record(void *data)
+static void dump_one_mcmember_record(void *data, struct query_params *p)
 {
char mgid[INET6_ADDRSTRLEN], gid[INET6_ADDRSTRLEN];
ib_member_rec_t *mr = data;
@@ -336,7 +338,7 @@ static void dump_one_mcmember_record(void *data)
   flow, hop, 

[PATCH] libibumad: add ClassPortInfo struct

2013-06-22 Thread Ira Weiny



Signed-off-by: Ira Weiny ira.we...@intel.com
---
 include/infiniband/umad_types.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/infiniband/umad_types.h b/include/infiniband/umad_types.h
index 32c747a..2d7c8cd 100644
--- a/include/infiniband/umad_types.h
+++ b/include/infiniband/umad_types.h
@@ -167,5 +167,38 @@ enum {
UMAD_OPENIB_OUI = 0x001405
 };
 
+enum {
+   UMAD_CLASS_RESP_TIME_MASK = 0x1F
+};
+struct umad_class_port_info {
+   uint8_t base_ver;
+   uint8_t class_ver;
+   be16_t  cap_mask;
+   be32_t  cap_mask2_resp_time;
+   uint8_t redir_gid[16]; /* network byte order */
+   be32_t  redir_tc_sl_fl;
+   be16_t  redir_lid;
+   be16_t  redir_pkey;
+   be32_t  redir_qp;
+   be32_t  redir_qkey;
+   uint8_t trap_gid[16]; /* network byte order */
+   be32_t  trap_tc_sl_fl;
+   be16_t  trap_lid;
+   be16_t  trap_pkey;
+   be32_t  trap_hop_qp;
+   be32_t  trap_qkey;
+};
+static inline uint32_t
+umad_class_cap_mask2(struct umad_class_port_info *cpi)
+{
+   return (ntohl(cpi-cap_mask2_resp_time)  5);
+}
+static inline uint8_t
+umad_class_resp_time(struct umad_class_port_info *cpi)
+{
+   return (uint8_t)(ntohl(cpi-cap_mask2_resp_time)
+ UMAD_CLASS_RESP_TIME_MASK);
+}
+
 END_C_DECLS
 #endif /* _UMAD_TYPES_H */
-- 
1.7.1

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


[PATCH] libibumad: add SA CAP MASK[2] definitions

2013-06-22 Thread Ira Weiny


Signed-off-by: Ira Weiny ira.we...@intel.com
---
 include/infiniband/umad_sa.h |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/include/infiniband/umad_sa.h b/include/infiniband/umad_sa.h
index eb7812d..a236806 100644
--- a/include/infiniband/umad_sa.h
+++ b/include/infiniband/umad_sa.h
@@ -102,6 +102,30 @@ enum {
UMAD_LEN_SA_DATA= 200
 };
 
+/* CM bits */
+enum {
+   UMAD_SA_CAP_MASK_IS_SUBNET_OPT_REC_SUP  = (1  8),
+   UMAD_SA_CAP_MASK_IS_UD_MCAST_SUP= (1  9),
+   UMAD_SA_CAP_MASK_IS_MULTIPATH_SUP   = (1  10),
+   UMAD_SA_CAP_MASK_IS_REINIT_SUP  = (1  11),
+   UMAD_SA_CAP_MASK_IS_GID_SCOPED_MULTIPATH_SUP= (1  12),
+   UMAD_SA_CAP_MASK_IS_PORTINFO_CAP_MASK_MATCH_SUP = (1  13),
+   UMAD_SA_CAP_MASK_IS_LINK_SPEED_WIDTH_PAIRS_REC_SUP  = (1  14),
+   UMAD_SA_CAP_MASK_IS_PA_SERVICES_SUP = (1  15)
+};
+/* CM2 bits */
+enum {
+   UMAD_SA_CAP_MASK2_IS_UNPATH_REPATH_SUP  = (1  0),
+   UMAD_SA_CAP_MASK2_IS_QOS_SUP= (1  1),
+   UMAD_SA_CAP_MASK2_IS_REV_PATH_PKEY_MEM_BIT_SUP  = (1  2),
+   UMAD_SA_CAP_MASK2_IS_MCAST_TOP_SUP  = (1  3),
+   UMAD_SA_CAP_MASK2_IS_HIERARCHY_INFO_SUP = (1  4),
+   UMAD_SA_CAP_MASK2_IS_ADDITIONAL_GUID_SUP= (1  5),
+   UMAD_SA_CAP_MASK2_IS_FULL_PORTINFO_REC_SUP  = (1  6),
+   UMAD_SA_CAP_MASK2_IS_EXT_SPEEDS_SUP = (1  7),
+   UMAD_SA_CAP_MASK2_IS_MCAST_SERVICE_REC_SUP  = (1  8)
+};
+
 /*
  *  sm_key is not aligned on an 8-byte boundary, so is defined as a byte array
  */
-- 
1.7.1

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


RE: [PATCH 1/2] ibnetdiscover: Add missing -f option to manpage

2013-06-22 Thread Weiny, Ira
 -Original Message-
 From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma-
 ow...@vger.kernel.org] On Behalf Of Albert Chu
 Sent: Thursday, June 13, 2013 2:27 PM
 To: linux-rdma@vger.kernel.org
 Subject: [PATCH 1/2] ibnetdiscover: Add missing -f option to manpage
 
 Signed-off-by: Albert L. Chu ch...@llnl.gov

Thanks applied,
Ira

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


RE: [PATCH 2/2] ibnetdiscover: Output vlcap in full output format

2013-06-22 Thread Weiny, Ira
 -Original Message-
 From: linux-rdma-ow...@vger.kernel.org [mailto:linux-rdma-
 Subject: [PATCH 2/2] ibnetdiscover: Output vlcap in full output format
 
 The additional vlcap information is useful when simulating a fabric in ibsim
 and fabric VL information is needed.
 
 Signed-off-by: Albert L. Chu ch...@llnl.gov
 ---

Thanks applied,
Ira
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] RDMA/ocrdma: fix error return code in ocrdma_set_create_qp_rq_cmd()

2013-06-22 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return -ENOMEM in the alloc dma coherent error
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c 
b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 71942af..672aba2 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1900,7 +1900,7 @@ static int ocrdma_set_create_qp_rq_cmd(struct 
ocrdma_create_qp_req *cmd,
 
qp-rq.va = dma_alloc_coherent(pdev-dev, len, pa, GFP_KERNEL);
if (!qp-rq.va)
-   return status;
+   return -ENOMEM;
memset(qp-rq.va, 0, len);
qp-rq.pa = pa;
qp-rq.len = len;

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