Hi,

Currently in ipmitool 1.8.11 the timeout/retry for LAN/LANplus is not
configurable (even though the interface has function to configure the
required values) .  By default its hardcoded to following values

in src/plugins/lan/lan.c
#define IPMI_LAN_TIMEOUT    2
#define IPMI_LAN_RETRY      4

in src/plugins/lanplus/lanplus.h
#define IPMI_LAN_TIMEOUT    1
#define IPMI_LAN_RETRY      4

In case we need to change the retry number or increase the timeout
currently its not possible. Therefore a patch file is added which will
allow user to set the required timeout/retry for the LAN/LANplus. Please
note, this patch file is diff'd with the file present in CVS version ie
rev 1.27.


diff -Naurp ipmitool/lib/ipmi_main.c_rev1.27 ipmitool/lib/ipmi_main.c


--- ipmitool/lib/ipmi_main.c_rev1.27    2011-10-10 18:00:10.000000000
+0530
+++ ipmitool/lib/ipmi_main.c    2011-10-10 20:13:16.000000000 +0530
@@ -74,7 +74,7 @@
 #endif

 #ifdef ENABLE_ALL_OPTIONS
-# define OPTION_STRING
"I:hVvcgsEKYao:H:d:P:f:U:p:C:L:A:t:T:m:z:S:l:b:B:e:k:y:O:"
+# define OPTION_STRING
"I:hVvcgsEKYao:H:d:P:f:U:p:C:L:A:t:T:m:z:S:l:b:B:e:k:y:O:R:N:"
 #else
 # define OPTION_STRING "I:hVvcH:f:U:p:d:S:"
 #endif
@@ -250,6 +250,8 @@ ipmi_option_usage(const char * progname,
    lprintf(LOG_NOTICE, "       -l lun         Set destination lun for
raw commands");
    lprintf(LOG_NOTICE, "       -o oemtype     Setup for OEM (use 'list'
to see available OEM types)");
    lprintf(LOG_NOTICE, "       -O seloem      Use file for OEM SEL
event descriptions");
+   lprintf(LOG_NOTICE, "       -N seconds     Specify timeout for lan
[default=2] / lanplus [default=1] interface");
+   lprintf(LOG_NOTICE, "       -R retry       Set the number of retries
for lan/lanplus interface [default=4]");
 #endif
    lprintf(LOG_NOTICE, "");

@@ -366,6 +368,8 @@ ipmi_main(int argc, char ** argv,
    uint8_t my_long_packet_size=0;
    uint8_t my_long_packet_set=0;
    uint8_t lookupbit = 0x10;   /* use name-only lookup by default */
+    uint8_t retry = 0;
+    uint8_t timeout = 0;
    int authtype = -1;
    char * tmp = NULL;
    char * hostname = NULL;
@@ -630,6 +634,13 @@ ipmi_main(int argc, char ** argv,
        case 'z':
            my_long_packet_size = (uint8_t)strtol(optarg, NULL, 0);
            break;
+        /* Retry and Timeout */
+       case 'R':
+           retry = (uint8_t)strtol(optarg, NULL, 0);
+           break;
+        case 'N':
+            timeout = (uint8_t)strtol(optarg, NULL, 0);
+            break;
 #endif
        default:
            ipmi_option_usage(progname, cmdlist, intflist);
@@ -717,6 +728,11 @@ ipmi_main(int argc, char ** argv,
    else
        ipmi_intf_session_set_privlvl(ipmi_main_intf,
              IPMI_SESSION_PRIV_ADMIN); /* default */
+   /* Adding retry and timeout for interface that support it */
+    if (retry > 0)
+        ipmi_intf_session_set_retry(ipmi_main_intf, (uint8_t)retry);
+    if (timeout > 0)
+        ipmi_intf_session_set_timeout(ipmi_main_intf,
(uint8_t)timeout);

    ipmi_intf_session_set_lookupbit(ipmi_main_intf, lookupbit);
    ipmi_intf_session_set_sol_escape_char(ipmi_main_intf,
sol_escape_char);

Attachment: ipmi_main.diff
Description: ipmi_main.diff

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to