[PATCH] libibumad: Increase the limit of UMAD_MAX_DEVICES

2010-08-10 Thread Arputham Benjamin
ibstat command doesn't show all HCAs when the number of HCAs in one system
exceeds 20. We need to change this limit. Increase it to 32 to be consistent
with the define "IB_UVERBS_MAX_DEVICES = 32"

Signed-off-by: Arputham Benjamin 
---
diff -rup a/libibumad-1.3.5/include/infiniband/umad.h 
b/libibumad-1.3.5/include/infiniband/umad.h
--- a/libibumad-1.3.5/include/infiniband/umad.h 2010-08-10 14:45:01.611516578 
-0700
+++ b/libibumad-1.3.5/include/infiniband/umad.h 2010-08-10 14:45:45.427516376 
-0700
@@ -44,7 +44,7 @@
 #endif /* __cplusplus */
 
 BEGIN_C_DECLS
-#define UMAD_MAX_DEVICES 20
+#define UMAD_MAX_DEVICES 32
 #define UMAD_ANY_PORT  0
 typedef struct ib_mad_addr {
uint32_t qpn;
--
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] opensm: Add a name to IB subnet and include it in syslog messages

2010-02-08 Thread Arputham Benjamin
Hi Sasha,

I have incorporated your feedback and sent you the modified patch with a new
subject line "[PATCH V2] opensm: Add option to specify prefix to syslog 
messages"

Regards,
Benjamin

Sasha Khapyorsky wrote:
> Hi Benjamin,
> 
> On 14:16 Thu 21 Jan , Arputham Benjamin wrote:
>> Added a text based name to an IB subnet to help user in identifying
>> an IB subnet or understanding its function in a multi-fabric IB cluster.
>> For example, in a dual-fabric (or dual-rail) IB cluster, one subnet
>> could be named "mpi" and the other subnet could be named "storage".
>>
>> Summary of changes:
>>  o Added the option 'subnet_name' to OpenSM command line and config file.
>>  o Enhanced OpenSM logging facility to include the subnet name in
>>syslog messages.
> 
> Looking at the usage below I can see that his is done as adding "free
> text" prefix to syslog prints. This is fine and seems could be useful
> for any purpose (not only different subnets) when syslog message mark
> is desired.
> 
> Assuming so, wouldn't it be better to change "subnet_name" to something
> more generic, let say "log_prefix"?
> 
>> Signed-off-by: Arputham Benjamin 
>> ---
>> diff -rup a/include/opensm/osm_log.h b/include/opensm/osm_log.h
>> --- a/include/opensm/osm_log.h   2010-01-18 21:32:12.195328129 -0800
>> +++ b/include/opensm/osm_log.h   2010-01-18 21:34:46.573932164 -0800
>> @@ -120,6 +120,7 @@ typedef struct osm_log {
>>  boolean_t accum_log_file;
>>  boolean_t daemon;
>>  char *log_file_name;
>> +char *subnet_name;
>>  } osm_log_t;
>>  /*/
>>  
>> diff -rup a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
>> --- a/include/opensm/osm_subnet.h2010-01-18 21:32:12.195328129 -0800
>> +++ b/include/opensm/osm_subnet.h2010-01-18 21:34:55.782087826 -0800
>> @@ -224,6 +224,7 @@ typedef struct osm_subn_opt {
>>  char *event_plugin_name;
>>  char *node_name_map_name;
>>  char *prefix_routes_file;
>> +char *subnet_name;
>>  boolean_t consolidate_ipv6_snm_req;
>>  struct osm_subn_opt *file_opts; /* used for update */
>>  uint8_t lash_start_vl;  /* starting vl to use in lash */
>> diff -rup a/man/opensm.8.in b/man/opensm.8.in
>> --- a/man/opensm.8.in2010-01-19 11:29:03.954832199 -0800
>> +++ b/man/opensm.8.in2010-01-21 10:56:58.901836423 -0800
>> @@ -49,6 +49,7 @@ opensm \- InfiniBand subnet manager and 
>>  [\-\-perfmgr_sweep_time_s ]
>>  [\-\-prefix_routes_file ]
>>  [\-\-consolidate_ipv6_snm_req]
>> +[\-\-subnet_name ]
>>  [\-v(erbose)] [\-V] [\-D ] [\-d(ebug) ]
>>  [\-h(elp)] [\-?]
>>  
>> @@ -345,6 +346,9 @@ effect if --enable-perfmgr was specified
>>  Use shared MLID for IPv6 Solicited Node Multicast groups per MGID scope
>>  and P_Key.
>>  .TP
>> +\fB\-\-subnet_name\fR 
>> +This option specifies the text based name of the subnet.
>> +.TP
>>  \fB\-v\fR, \fB\-\-verbose\fR
>>  This option increases the log verbosity level.
>>  The -v option may be specified multiple times
>> diff -rup a/opensm/main.c b/opensm/main.c
>> --- a/opensm/main.c  2010-01-18 21:31:43.318842260 -0800
>> +++ b/opensm/main.c  2010-01-19 11:51:45.566967909 -0800
>> @@ -324,6 +324,8 @@ static void show_usage(void)
>>  printf("--consolidate_ipv6_snm_req\n"
>> "  Use shared MLID for IPv6 Solicited Node Multicast 
>> groups\n"
>> "  per MGID scope and P_Key.\n\n");
>> +printf("--subnet_name \n"
>> +   "  Text based name of the IB subnet.\n\n");
>>  printf("--verbose, -v\n"
>> "  This option increases the log verbosity level.\n"
>> "  The -v option may be specified multiple times\n"
>> @@ -607,6 +609,7 @@ int main(int argc, char *argv[])
>>  {"lash_start_vl", 1, NULL, 6},
>>  {"sm_sl", 1, NULL, 7},
>>  {"retries", 1, NULL, 8},
>> +{"subnet_name", 1, NULL, 9},
>>  {NULL, 0, NULL, 0}  /* Required at the end of the array */
>>  };
>>  
>> @@ -985,6 +988,11 @@ int main(int argc, char *argv[])
>>  printf(" Transaction retries = %u\n",
>> opt.transaction_retries);
>>  break;
>> +case 9:
>> +

[PATCH V2] opensm: Add option to specify prefix to syslog messages

2010-02-08 Thread Arputham Benjamin
Added the option 'log_prefix' that allows users to specify a prefix to
syslog messages from OpenSM.
For example, in a dual-fabric (or dual-rail) IB cluster, the prefix for
the first fabric could be "mpi" and the other fabric could be "storage".
This helps users to identify the subnet in the syslog messages when
two or more instances of OpenSM run in a single node to manage multiple
fabrics.

Summary of changes:
 o Added the option 'log_prefix' to OpenSM command line and config file.
 o Enhanced OpenSM logging facility to include the specified prefix in
   syslog messages.

Signed-off-by: Arputham Benjamin 
---
diff -rup a/include/opensm/osm_log.h b/include/opensm/osm_log.h
--- a/include/opensm/osm_log.h  2010-01-18 21:32:12.195328129 -0800
+++ b/include/opensm/osm_log.h  2010-01-28 07:21:39.617882774 -0800
@@ -120,6 +120,7 @@ typedef struct osm_log {
boolean_t accum_log_file;
boolean_t daemon;
char *log_file_name;
+   char *log_prefix;
 } osm_log_t;
 /*/
 
diff -rup a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
--- a/include/opensm/osm_subnet.h   2010-01-18 21:32:12.195328129 -0800
+++ b/include/opensm/osm_subnet.h   2010-01-28 07:21:53.702143886 -0800
@@ -224,6 +224,7 @@ typedef struct osm_subn_opt {
char *event_plugin_name;
char *node_name_map_name;
char *prefix_routes_file;
+   char *log_prefix;
boolean_t consolidate_ipv6_snm_req;
struct osm_subn_opt *file_opts; /* used for update */
uint8_t lash_start_vl;  /* starting vl to use in lash */
diff -rup a/man/opensm.8.in b/man/opensm.8.in
--- a/man/opensm.8.in   2010-01-19 11:29:03.954832199 -0800
+++ b/man/opensm.8.in   2010-02-08 16:06:52.816907526 -0800
@@ -49,6 +49,7 @@ opensm \- InfiniBand subnet manager and 
 [\-\-perfmgr_sweep_time_s ]
 [\-\-prefix_routes_file ]
 [\-\-consolidate_ipv6_snm_req]
+[\-\-log_prefix ]
 [\-v(erbose)] [\-V] [\-D ] [\-d(ebug) ]
 [\-h(elp)] [\-?]
 
@@ -345,6 +346,13 @@ effect if --enable-perfmgr was specified
 Use shared MLID for IPv6 Solicited Node Multicast groups per MGID scope
 and P_Key.
 .TP
+\fB\-\-log_prefix\fR 
+This option specifies the prefix to the syslog messages from OpenSM.
+A suitable prefix can be used to identify the IB subnet in syslog messages
+when two or more instances of OpenSM run in a single node to manage multiple
+fabrics. For example, in a dual-fabric (or dual-rail) IB cluster, the prefix
+for the first fabric could be "mpi" and the other fabric could be "storage".
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 This option increases the log verbosity level.
 The -v option may be specified multiple times
diff -rup a/opensm/main.c b/opensm/main.c
--- a/opensm/main.c 2010-01-18 21:31:43.318842260 -0800
+++ b/opensm/main.c 2010-02-05 19:23:01.736046042 -0800
@@ -324,6 +324,8 @@ static void show_usage(void)
printf("--consolidate_ipv6_snm_req\n"
   "  Use shared MLID for IPv6 Solicited Node Multicast 
groups\n"
   "  per MGID scope and P_Key.\n\n");
+   printf("--log_prefix \n"
+  "  Prefix to syslog messages from OpenSM.\n\n");
printf("--verbose, -v\n"
   "  This option increases the log verbosity level.\n"
   "  The -v option may be specified multiple times\n"
@@ -607,6 +609,7 @@ int main(int argc, char *argv[])
{"lash_start_vl", 1, NULL, 6},
{"sm_sl", 1, NULL, 7},
{"retries", 1, NULL, 8},
+   {"log_prefix", 1, NULL, 9},
{NULL, 0, NULL, 0}  /* Required at the end of the array */
};
 
@@ -985,6 +988,11 @@ int main(int argc, char *argv[])
printf(" Transaction retries = %u\n",
   opt.transaction_retries);
break;
+   case 9:
+   SET_STR_OPT(opt.log_prefix, optarg);
+   printf("Log prefix = %s\n",
+  opt.log_prefix);
+   break;
case 'h':
case '?':
case ':':
diff -rup a/opensm/osm_log.c b/opensm/osm_log.c
--- a/opensm/osm_log.c  2010-01-18 21:31:43.318842260 -0800
+++ b/opensm/osm_log.c  2010-02-08 19:31:22.249010867 -0800
@@ -123,7 +123,13 @@ void osm_log(IN osm_log_t * p_log, IN os
return;
 
va_start(args, p_str);
-   vsprintf(buffer, p_str, args);
+   if (p_log->log_prefix == NULL) {
+   vsprintf(buffer, p_str, args);
+   }
+   else {
+   int n = snprintf(buffer, sizeof(buffer), "%s: ", 
p_log->log_prefix);
+   vsprintf(buffer + n, p_str, args)

[PATCH] opensm: Add a name to IB subnet and include it in syslog messages

2010-01-21 Thread Arputham Benjamin
Added a text based name to an IB subnet to help user in identifying
an IB subnet or understanding its function in a multi-fabric IB cluster.
For example, in a dual-fabric (or dual-rail) IB cluster, one subnet
could be named "mpi" and the other subnet could be named "storage".

Summary of changes:
 o Added the option 'subnet_name' to OpenSM command line and config file.
 o Enhanced OpenSM logging facility to include the subnet name in
   syslog messages.

Signed-off-by: Arputham Benjamin 
---
diff -rup a/include/opensm/osm_log.h b/include/opensm/osm_log.h
--- a/include/opensm/osm_log.h  2010-01-18 21:32:12.195328129 -0800
+++ b/include/opensm/osm_log.h  2010-01-18 21:34:46.573932164 -0800
@@ -120,6 +120,7 @@ typedef struct osm_log {
boolean_t accum_log_file;
boolean_t daemon;
char *log_file_name;
+   char *subnet_name;
 } osm_log_t;
 /*/
 
diff -rup a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
--- a/include/opensm/osm_subnet.h   2010-01-18 21:32:12.195328129 -0800
+++ b/include/opensm/osm_subnet.h   2010-01-18 21:34:55.782087826 -0800
@@ -224,6 +224,7 @@ typedef struct osm_subn_opt {
char *event_plugin_name;
char *node_name_map_name;
char *prefix_routes_file;
+   char *subnet_name;
boolean_t consolidate_ipv6_snm_req;
struct osm_subn_opt *file_opts; /* used for update */
uint8_t lash_start_vl;  /* starting vl to use in lash */
diff -rup a/man/opensm.8.in b/man/opensm.8.in
--- a/man/opensm.8.in   2010-01-19 11:29:03.954832199 -0800
+++ b/man/opensm.8.in   2010-01-21 10:56:58.901836423 -0800
@@ -49,6 +49,7 @@ opensm \- InfiniBand subnet manager and 
 [\-\-perfmgr_sweep_time_s ]
 [\-\-prefix_routes_file ]
 [\-\-consolidate_ipv6_snm_req]
+[\-\-subnet_name ]
 [\-v(erbose)] [\-V] [\-D ] [\-d(ebug) ]
 [\-h(elp)] [\-?]
 
@@ -345,6 +346,9 @@ effect if --enable-perfmgr was specified
 Use shared MLID for IPv6 Solicited Node Multicast groups per MGID scope
 and P_Key.
 .TP
+\fB\-\-subnet_name\fR 
+This option specifies the text based name of the subnet.
+.TP
 \fB\-v\fR, \fB\-\-verbose\fR
 This option increases the log verbosity level.
 The -v option may be specified multiple times
diff -rup a/opensm/main.c b/opensm/main.c
--- a/opensm/main.c 2010-01-18 21:31:43.318842260 -0800
+++ b/opensm/main.c 2010-01-19 11:51:45.566967909 -0800
@@ -324,6 +324,8 @@ static void show_usage(void)
printf("--consolidate_ipv6_snm_req\n"
   "  Use shared MLID for IPv6 Solicited Node Multicast 
groups\n"
   "  per MGID scope and P_Key.\n\n");
+   printf("--subnet_name \n"
+  "  Text based name of the IB subnet.\n\n");
printf("--verbose, -v\n"
   "  This option increases the log verbosity level.\n"
   "  The -v option may be specified multiple times\n"
@@ -607,6 +609,7 @@ int main(int argc, char *argv[])
{"lash_start_vl", 1, NULL, 6},
{"sm_sl", 1, NULL, 7},
{"retries", 1, NULL, 8},
+   {"subnet_name", 1, NULL, 9},
{NULL, 0, NULL, 0}  /* Required at the end of the array */
};
 
@@ -985,6 +988,11 @@ int main(int argc, char *argv[])
printf(" Transaction retries = %u\n",
   opt.transaction_retries);
break;
+   case 9:
+   SET_STR_OPT(opt.subnet_name, optarg);
+   printf("IB subnet name = %s\n",
+  opt.subnet_name);
+   break;
case 'h':
case '?':
case ':':
diff -rup a/opensm/osm_log.c b/opensm/osm_log.c
--- a/opensm/osm_log.c  2010-01-18 21:31:43.318842260 -0800
+++ b/opensm/osm_log.c  2010-01-18 21:33:47.808939648 -0800
@@ -107,6 +107,7 @@ void osm_log(IN osm_log_t * p_log, IN os
char buffer[LOG_ENTRY_SIZE_MAX];
va_list args;
int ret;
+   uint8_t ind = 0;
 #ifdef __WIN__
SYSTEMTIME st;
uint32_t pid = GetCurrentThreadId();
@@ -123,7 +124,14 @@ void osm_log(IN osm_log_t * p_log, IN os
return;
 
va_start(args, p_str);
-   vsprintf(buffer, p_str, args);
+   if(p_log->subnet_name) {
+   snprintf(buffer, LOG_ENTRY_SIZE_MAX, "%s: ", 
p_log->subnet_name);
+   ind = strlen(buffer);
+   vsprintf(&buffer[ind], p_str, args);
+   }
+   else {
+   vsprintf(buffer, p_str, args);
+   }
va_end(args);
 
/* this is a call to the syslog */
diff -rup a/opensm/osm_opensm.c b/opensm/osm_opensm.c
--- a/opensm/osm_opensm.c   2010-01-18 21:31:43.

Re: Proposal to add a name to an IB subnet

2009-12-21 Thread Arputham Benjamin
Hal Rosenstock wrote:
> On Wed, Dec 2, 2009 at 6:59 PM, Arputham Benjamin  wrote:
>> Hi,
>>
>> I suggest we add a text based name to an IB subnet, perhaps to
>> help user in identifying an IB subnet or understanding its function
>> in a multi-fabric IB cluster. For example, in a dual-fabric
>> (or dual-rail) IB cluster, one subnet could be named "mpi" and the
>> other subnet could be named "storage".
>>
>> In the current implementation of OpenSM, syslog messages are prefixed
>> with the process ID. When multiple instances of OpenSM run on a single node
>> to support dual-fabric IB, process ID doesn't help the admin to quickly
>> identify a specific IB subnet (i.e., it needs a translation)
>>
>> subnet_prefix (64-bit number) can be used as a prefix to syslog messages
>> but a user configurable text based name is better.
>>
>> We could add an option '-n | --ib_subnet_name' to OpenSM command line
>> to input the IB subnet name and modify the osm_log() function for syslog
>> messages (message type: OSM_LOG_SYS) to prefix its messages with the
>> subnet name.
> 
> Support for this could/should be added in the options file as well.
> 
> -- Hal

Sure. We can add the variable name/value "ib_subnet_name" to options file as 
well.

Regards,
Benjamin

> 
>> Also, we could limit this name prefix changes to syslog messages only for 
>> now.
>> (i.e., leave the opensm log as it is because the current implementation
>> allows the user to specify the file name for the opensm log)
>>
>> Any comments?
--
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


Proposal to add a name to an IB subnet

2009-12-02 Thread Arputham Benjamin
Hi,

I suggest we add a text based name to an IB subnet, perhaps to
help user in identifying an IB subnet or understanding its function
in a multi-fabric IB cluster. For example, in a dual-fabric
(or dual-rail) IB cluster, one subnet could be named "mpi" and the
other subnet could be named "storage".

In the current implementation of OpenSM, syslog messages are prefixed
with the process ID. When multiple instances of OpenSM run on a single node
to support dual-fabric IB, process ID doesn't help the admin to quickly 
identify a specific IB subnet (i.e., it needs a translation)

subnet_prefix (64-bit number) can be used as a prefix to syslog messages
but a user configurable text based name is better.

We could add an option '-n | --ib_subnet_name' to OpenSM command line
to input the IB subnet name and modify the osm_log() function for syslog
messages (message type: OSM_LOG_SYS) to prefix its messages with the
subnet name. 

Also, we could limit this name prefix changes to syslog messages only for now.
(i.e., leave the opensm log as it is because the current implementation
allows the user to specify the file name for the opensm log)

Any comments?

Regards,
Benjamin
--
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