On 12:54 Wed 29 Feb     , Mike Heinz wrote:
> I've recently seen two different users on different fabrics make the same
> mistake: They made a syntax error in their opensm.conf file and then couldn't
> figure out why their changes didn't take effect.
> 
> Looking at the code that parses the opensm.conf file, it appears to treat any
> line it cannot parse as a comment and silently passes over it.
> 
> This patch modifies the parse logic as follows:
> 
> 1. Truncate the line at the first '#' character.
> 2. If the result is blank, skip to the next line.
> 3. If the first token in the line can be matched against a known token,
>    process it as usual.
> 4. If the token cannot be matched against a known token, log an error message.
> 
> The result is that if, for example, the user typed "force_link_speed=5" the
> system log will read:
> 
> Feb 24 14:57:09 ifs001 OpenSM[17517]: OpenSM 3.3.13
> Feb 24 14:57:09 ifs001 OpenSM[17517]: Entering DISCOVERING state
> Feb 24 14:57:09 ifs001 OpenSM[17517]: Unrecognized token: "force_link_speed=5"
> Feb 24 14:57:09 ifs001 opensm[17517]: Entering MASTER state
> Feb 24 14:57:09 ifs001 opensm[17517]: SUBNET UP
> .
> .
> .
> 
> In addition, error messages will also be reported to the command line and
> the opensm logfile. For example:
> 
> [root@ifs001]# opensm
> -------------------------------------------------
> OpenSM 3.3.13
>  Reading Cached Option File: /etc/opensm/opensm.conf
> Unrecognized token: "1`243561"
> Command Line Arguments:
>  Log File: /var/log/opensm.log
> -------------------------------------------------
> OpenSM 3.3.13
> 
> Entering DISCOVERING state
> 
> Using default GUID 0x117500007918d2
> Unrecognized token: "1`243561"
> Entering MASTER state
> 
> SUBNET UP
> .
> .
> .
> 
> Signed-off-by: Michael Heinz <michael.he...@qlogic.com>
> ---

Applied. Thanks.
--
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

Reply via email to