Discussion:
[Ipmitool-devel] Can't Disable VLAN ID!!!
B***@DELL.com
2016-08-06 13:07:18 UTC
Permalink
Dear IPMI Experts,

Need your help in understanding what should be value of VLAN ID value during VLAN disable.

The spec doesn't clearly call out what should be value of VLAN ID when VLAN ID enable bit is zero.

As per spec...
data 1
[7:0] - Least significant 8-bits of the VLAN ID. 00h if VLAN ID not used.
data 2
[7] - VLAN ID enable.
0b = disabled, 1b = enabled. If enabled, the BMC will only accept packets for this
channel if they have 802.1q fields and their VLAN ID matches the VLAN ID value
given in this parameter.
[6:4] - reserved
[3:0] - most significant four bits of the VLAN ID


I'm trying to disable the vlan id using the command "ipmitool lan set 1 vlan id off"
I get the below error.
LAN Parameter Data does not match! Write may have failed.

When I checked in code ipmi_lanp.c the ipmitool is sending the vlan id as "0 0" which is NOT accepted by the BMC.

ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL)
{ data[0] = 0; data[1] = 0; }

But when I replace the VLAN ID value with 1-4094 along with VLAN ID enable bit = 0. I.e,

Data[0] = xxxx xxxx
Data[1] = 0xxx xxxx

Then VLAN ID got disable successfully.

So, my query is what is the expected value of the VLAN ID when VLAN ID enable bit is zero as per the spec? should be zero or 1 to 4094 range?

Regards
Balaji Singh
^..^
2016-08-06 18:14:41 UTC
Permalink
I’d imagine it varies by vender (both BMC & network gear), but wiki has a
good summation -

*VLAN identifier (VID): a 12-bit field specifying the VLAN to which the
frame belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All
other values may be used as VLAN identifiers, allowing up to 4,094 VLANs.
The reserved value 0x000 indicates that the frame does not carry a VLAN ID;
in this case, the 802.1Q tag specifies only a priority and is referred to
as a priority tag. On bridges, VID 0x001 (the default VLAN ID) is often
reserved for a management VLAN; this is vendor-specific. The VID value
0xFFF is reserved for implementation use; it must not be configured or
transmitted. 0xFFF can be used to indicate a wildcard match in management
operations or filtering database entries.*

Basically you should avoid 0,1, and 4095 unless you know your vendor/hw
supports it for a specific reason.


— d
Post by B***@DELL.com
Dear IPMI Experts,
Need your help in understanding what should be value of VLAN ID value during VLAN disable.
The spec doesn’t clearly call out what should be value of VLAN ID when
VLAN ID enable bit is zero.
As per spec

data 1
[7:0] - Least significant 8-bits of the VLAN ID. 00h if VLAN ID not used.
data 2
[7] - VLAN ID enable.
0b = disabled, 1b = enabled. If enabled, the BMC will only accept packets for this
channel if they have 802.1q fields and their VLAN ID matches the VLAN ID value
given in this parameter.
[6:4] - reserved
[3:0] - most significant four bits of the VLAN ID
I’m trying to disable the vlan id using the command “ipmitool lan set 1
vlan id off”
I get the below error.
LAN Parameter Data does not match! Write may have failed.
When I checked in code ipmi_lanp.c the ipmitool is sending the vlan id as
“0 0” which is NOT accepted by the BMC.
ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL)
{ data[0] = 0; data[1] = 0; }
But when I replace the VLAN ID value with 1-4094 along with VLAN ID enable bit = 0. I.e,
Data[0] = xxxx xxxx
Data[1] = 0xxx xxxx
Then VLAN ID got disable successfully.
So, my query is what is the expected value of the VLAN ID when VLAN ID
enable bit is zero as per the spec? should be zero or 1 to 4094 range?
Regards
Balaji Singh
------------------------------------------------------------
------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
B***@DELL.com
2016-08-07 04:04:03 UTC
Permalink
Hi,
Then is it a bug in ipmitool? That it sends 0x000 when VLAN ID is disabled. “ipmitool lan set 1 vlan id off”
As per the wiki the ipmitool supposed to send values from 0x001 to 0xFFE during VLAN ID disable.
Regards
Balaji Singh


From: ^..^ [mailto:***@gmail.com]
Sent: Saturday, August 6, 2016 11:45 PM
To: Singh, B B <***@DELL.com>
Cc: ipmitool-***@lists.sourceforge.net
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!

I’d imagine it varies by vender (both BMC & network gear), but wiki has a good summation -
VLAN identifier (VID): a 12-bit field specifying the VLAN to which the frame belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other values may be used as VLAN identifiers, allowing up to 4,094 VLANs. The reserved value 0x000 indicates that the frame does not carry a VLAN ID; in this case, the 802.1Q tag specifies only a priority and is referred to as a priority tag. On bridges, VID 0x001 (the default VLAN ID) is often reserved for a management VLAN; this is vendor-specific. The VID value 0xFFF is reserved for implementation use; it must not be configured or transmitted. 0xFFF can be used to indicate a wildcard match in management operations or filtering database entries.
Basically you should avoid 0,1, and 4095 unless you know your vendor/hw supports it for a specific reason.

— d

On Sat, Aug 6, 2016 at 6:07 AM, <***@dell.com<mailto:***@dell.com>> wrote:

Dear IPMI Experts,

Need your help in understanding what should be value of VLAN ID value during VLAN disable.

The spec doesn’t clearly call out what should be value of VLAN ID when VLAN ID enable bit is zero.

As per spec

data 1
[7:0] - Least significant 8-bits of the VLAN ID. 00h if VLAN ID not used.
data 2
[7] - VLAN ID enable.
0b = disabled, 1b = enabled. If enabled, the BMC will only accept packets for this
channel if they have 802.1q fields and their VLAN ID matches the VLAN ID value
given in this parameter.
[6:4] - reserved
[3:0] - most significant four bits of the VLAN ID


I’m trying to disable the vlan id using the command “ipmitool lan set 1 vlan id off”
I get the below error.
LAN Parameter Data does not match! Write may have failed.

When I checked in code ipmi_lanp.c the ipmitool is sending the vlan id as “0 0” which is NOT accepted by the BMC.

ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL)
{ data[0] = 0; data[1] = 0; }

But when I replace the VLAN ID value with 1-4094 along with VLAN ID enable bit = 0. I.e,

Data[0] = xxxx xxxx
Data[1] = 0xxx xxxx

Then VLAN ID got disable successfully.

So, my query is what is the expected value of the VLAN ID when VLAN ID enable bit is zero as per the spec? should be zero or 1 to 4094 range?

Regards
Balaji Singh


------------------------------------------------------------------------------

_______________________________________________
Ipmitool-devel mailing list
Ipmitool-***@lists.sourceforge.net<mailto:Ipmitool-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
Zdenek Styblik
2016-08-07 10:23:53 UTC
Permalink
Post by B***@DELL.com
Hi,
Then is it a bug in ipmitool? That it sends 0x000 when VLAN ID is disabled.
“ipmitool lan set 1 vlan id off”
As per the wiki the ipmitool supposed to send values from 0x001 to 0xFFE
during VLAN ID disable.
Hello Balaji,

it's disputable where the bug is. Me, personally, I would say bug is
in your BMC, because there is a little to no reason to send any VLAN
ID when VLAN ID Setting is being disabled. Is there any reason why
client should send any VLAN ID? If my understanding is correct, there
can be only one VLAN ID per channel and it can be either on and then
you need VLAN ID, or off and then VLAN ID doesn't matter.
You're correct, though, that IPMI specification doesn't explicitly say
this. On the other hand, it sort of makes sense.

Best regards,
Z.
Post by B***@DELL.com
Regards
Balaji Singh
Sent: Saturday, August 6, 2016 11:45 PM
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!
I’d imagine it varies by vender (both BMC & network gear), but wiki has a
good summation -
VLAN identifier (VID): a 12-bit field specifying the VLAN to which the frame
belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other
values may be used as VLAN identifiers, allowing up to 4,094 VLANs. The
reserved value 0x000 indicates that the frame does not carry a VLAN ID; in
this case, the 802.1Q tag specifies only a priority and is referred to as a
priority tag. On bridges, VID 0x001 (the default VLAN ID) is often reserved
for a management VLAN; this is vendor-specific. The VID value 0xFFF is
reserved for implementation use; it must not be configured or transmitted.
0xFFF can be used to indicate a wildcard match in management operations or
filtering database entries.
Basically you should avoid 0,1, and 4095 unless you know your vendor/hw
supports it for a specific reason.
— d
Dear IPMI Experts,
Need your help in understanding what should be value of VLAN ID value during VLAN disable.
The spec doesn’t clearly call out what should be value of VLAN ID when VLAN
ID enable bit is zero.
As per spec…
data 1
[7:0] - Least significant 8-bits of the VLAN ID. 00h if VLAN ID not used.
data 2
[7] - VLAN ID enable.
0b = disabled, 1b = enabled. If enabled, the BMC will only accept packets for this
channel if they have 802.1q fields and their VLAN ID matches the VLAN ID value
given in this parameter.
[6:4] - reserved
[3:0] - most significant four bits of the VLAN ID
I’m trying to disable the vlan id using the command “ipmitool lan set 1 vlan
id off”
I get the below error.
LAN Parameter Data does not match! Write may have failed.
When I checked in code ipmi_lanp.c the ipmitool is sending the vlan id as “0
0” which is NOT accepted by the BMC.
ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL)
{ data[0] = 0; data[1] = 0; }
But when I replace the VLAN ID value with 1-4094 along with VLAN ID enable bit = 0. I.e,
Data[0] = xxxx xxxx
Data[1] = 0xxx xxxx
Then VLAN ID got disable successfully.
So, my query is what is the expected value of the VLAN ID when VLAN ID
enable bit is zero as per the spec? should be zero or 1 to 4094 range?
Regards
Balaji Singh
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
------------------------------------------------------------------------------
B***@DELL.com
2016-08-08 05:52:19 UTC
Permalink
Post by Zdenek Styblik
Hello Balaji,
it's disputable where the bug is. Me, personally, I would say bug is in your BMC, because there is a little to no reason to send any VLAN ID when VLAN ID Setting is being disabled. Is there any reason why client should >send any VLAN ID? If my understanding is correct, there can be only one VLAN ID per channel and it can be either on and then you need VLAN ID, or off and then VLAN ID doesn't matter.
You're correct, though, that IPMI specification doesn't explicitly say this. On the other hand, it sort of makes sense.
Best regards,
Z.
Hi Zdenek,

Thanks for the quick reply.

Can you please confirm the expected behavior of the BMC.

1. BMC should accept "0x000" VLAN ID when VLAN ID enable bit is disabled (0)?

2. BMC should NOT accept "0x000" VLAN ID when VLAN ID enable bit is enabled(1)?

Regards
Balaji Singh


------------------------------------------------------------------------------
Albert Chu
2016-08-08 16:57:28 UTC
Permalink
As a fellow IPMI project maintainer, I would side with the opinion the
bug is on the BMC. The BMC should not care what the VLAN ID is when it
is being disabled, only when it's being enabled.

That said, it would perhaps be nice to get a workaround into ipmitool to
deal with this. Perhaps nothing more than a "--vlan-id" or something
like that option to allow the user to override the default.

Al
Post by Zdenek Styblik
Post by B***@DELL.com
Hi,
Then is it a bug in ipmitool? That it sends 0x000 when VLAN ID is disabled.
“ipmitool lan set 1 vlan id off”
As per the wiki the ipmitool supposed to send values from 0x001 to 0xFFE
during VLAN ID disable.
Hello Balaji,
it's disputable where the bug is. Me, personally, I would say bug is
in your BMC, because there is a little to no reason to send any VLAN
ID when VLAN ID Setting is being disabled. Is there any reason why
client should send any VLAN ID? If my understanding is correct, there
can be only one VLAN ID per channel and it can be either on and then
you need VLAN ID, or off and then VLAN ID doesn't matter.
You're correct, though, that IPMI specification doesn't explicitly say
this. On the other hand, it sort of makes sense.
Best regards,
Z.
Post by B***@DELL.com
Regards
Balaji Singh
Sent: Saturday, August 6, 2016 11:45 PM
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!
I’d imagine it varies by vender (both BMC & network gear), but wiki has a
good summation -
VLAN identifier (VID): a 12-bit field specifying the VLAN to which the frame
belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other
values may be used as VLAN identifiers, allowing up to 4,094 VLANs. The
reserved value 0x000 indicates that the frame does not carry a VLAN ID; in
this case, the 802.1Q tag specifies only a priority and is referred to as a
priority tag. On bridges, VID 0x001 (the default VLAN ID) is often reserved
for a management VLAN; this is vendor-specific. The VID value 0xFFF is
reserved for implementation use; it must not be configured or transmitted.
0xFFF can be used to indicate a wildcard match in management operations or
filtering database entries.
Basically you should avoid 0,1, and 4095 unless you know your vendor/hw
supports it for a specific reason.
— d
Dear IPMI Experts,
Need your help in understanding what should be value of VLAN ID value during
VLAN disable.
The spec doesn’t clearly call out what should be value of VLAN ID when VLAN
ID enable bit is zero.
As per spec…
data 1
[7:0] - Least significant 8-bits of the VLAN ID. 00h if VLAN ID not used.
data 2
[7] - VLAN ID enable.
0b = disabled, 1b = enabled. If enabled, the BMC will only accept packets for this
channel if they have 802.1q fields and their VLAN ID matches the VLAN ID value
given in this parameter.
[6:4] - reserved
[3:0] - most significant four bits of the VLAN ID
I’m trying to disable the vlan id using the command “ipmitool lan set 1 vlan
id off”
I get the below error.
LAN Parameter Data does not match! Write may have failed.
When I checked in code ipmi_lanp.c the ipmitool is sending the vlan id as “0
0” which is NOT accepted by the BMC.
ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
{
uint8_t data[2];
int rc;
if (string == NULL)
{ data[0] = 0; data[1] = 0; }
But when I replace the VLAN ID value with 1-4094 along with VLAN ID enable
bit = 0. I.e,
Data[0] = xxxx xxxx
Data[1] = 0xxx xxxx
Then VLAN ID got disable successfully.
So, my query is what is the expected value of the VLAN ID when VLAN ID
enable bit is zero as per the spec? should be zero or 1 to 4094 range?
Regards
Balaji Singh
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
--
Albert Chu
***@llnl.gov
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
B***@DELL.com
2016-08-16 09:15:56 UTC
Permalink
My apologies for the previous mail having tag "confidential". please neglect the tag.
Sent: Monday, August 8, 2016 10:27 PM
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!
As a fellow IPMI project maintainer, I would side with the opinion the bug is on the BMC. The BMC should not care what the VLAN ID is when it is being disabled, only when it's being enabled.
That said, it would perhaps be nice to get a workaround into ipmitool to deal with this. Perhaps nothing more than a "--vlan-id" or something like that option to allow the user to override the default.
Al
Hi Albert,
The issue of validating the VLAN ID during a disable command has been corrected in the BMC firmware, but there is another incongruency related to this defect that may cause headaches for ipmitool users.
set_lan_param_wait
if (memcmp(data, p->data, len) != 0) {
sleep(IPMI_LANP_TIMEOUT);
if (retry-- == 0) {
lprintf(LOG_WARNING, "LAN Parameter Data does not match! "
"Write may have failed.");
return -1;
}
continue;
}
Since we do send the VLAN ID in this return data, regardless of whether VLAN is disabled or not, this mismatch between requested and received parameters causes ipmitool to retry the command 10 times and >return an error.
In the interest of resolving this issue for all users of the tool, have made these below changes in ipmitool. Please review it & let me know the comments.
--- ipmi_lanp.c 2016-08-09 15:29:56.000000000 +0530
+++ ipmi_lanp_with_changes.c 2016-08-09 15:29:56.000000000 +0530
@@ -1319,10 +1319,20 @@
{
uint8_t data[2];
int rc;
+ struct lan_param * p; //handling for vlan disable, get the vlan id before sending
if (string == NULL) {
- data[0] = 0;
- data[1] = 0;
+ lprintf(LOG_NOTICE, "get vlan id .");
+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
+ if (p != NULL && p->data != NULL) {
+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
+ if (id < 1 || id > 4094) {
+ lprintf(LOG_NOTICE, "vlan id retrieved is not 1 and 4094.");
+ return -1;
+ }
+ data[0] = p->data[0];
+ data[1] = p->data[1];
+ }
}
else {
int id = 0;
Regards
Balaji Singh
------------------------------------------------------------------------------
B***@DELL.com
2016-08-16 09:11:47 UTC
Permalink
Dell - Internal Use - Confidential
Sent: Monday, August 8, 2016 10:27 PM
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!
As a fellow IPMI project maintainer, I would side with the opinion the bug is on the BMC. The BMC should not care what the VLAN ID is when it is being disabled, only when it's being enabled.
That said, it would perhaps be nice to get a workaround into ipmitool to deal with this. Perhaps nothing more than a "--vlan-id" or something like that option to allow the user to override the default.
Al
Hi Albert,

The issue of validating the VLAN ID during a disable command has been corrected in the BMC firmware, but there is another incongruency related to this defect that may cause headaches for ipmitool users.

Currently, when a LAN parameter set command is sent through ipmitool, the corresponding parameter data is requested and compared to the command to verify that the data was written correctly:


set_lan_param_wait



if (memcmp(data, p->data, len) != 0) {
sleep(IPMI_LANP_TIMEOUT);
if (retry-- == 0) {
lprintf(LOG_WARNING, "LAN Parameter Data does not match! "
"Write may have failed.");
return -1;
}
continue;
}


Since we do send the VLAN ID in this return data, regardless of whether VLAN is disabled or not, this mismatch between requested and received parameters causes ipmitool to retry the command 10 times and return an error.

In the interest of resolving this issue for all users of the tool, have made these below changes in ipmitool. Please review it & let me know the comments.

--- ipmi_lanp.c 2016-08-09 15:29:56.000000000 +0530
+++ ipmi_lanp_with_changes.c 2016-08-09 15:29:56.000000000 +0530
@@ -1319,10 +1319,20 @@
{
uint8_t data[2];
int rc;
+ struct lan_param * p; //handling for vlan disable, get the vlan id before sending

if (string == NULL) {
- data[0] = 0;
- data[1] = 0;
+ lprintf(LOG_NOTICE, "get vlan id .");
+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
+ if (p != NULL && p->data != NULL) {
+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
+ if (id < 1 || id > 4094) {
+ lprintf(LOG_NOTICE, "vlan id retrieved is not 1 and 4094.");
+ return -1;
+ }
+ data[0] = p->data[0];
+ data[1] = p->data[1];
+ }
}
else {
int id = 0;

Regards
Balaji Singh
------------------------------------------------------------------------------
Zdenek Styblik
2016-08-17 20:16:00 UTC
Permalink
Post by B***@DELL.com
Dell - Internal Use - Confidential
Sent: Monday, August 8, 2016 10:27 PM
Subject: Re: [Ipmitool-devel] Can't Disable VLAN ID!!!
As a fellow IPMI project maintainer, I would side with the opinion the bug is on the BMC. The BMC should not care what the VLAN ID is when it is being disabled, only when it's being enabled.
That said, it would perhaps be nice to get a workaround into ipmitool to deal with this. Perhaps nothing more than a "--vlan-id" or something like that option to allow the user to override the default.
Al
Hi Albert,
The issue of validating the VLAN ID during a disable command has been corrected in the BMC firmware, but there is another incongruency related to this defect that may cause headaches for ipmitool users.
set_lan_param_wait
if (memcmp(data, p->data, len) != 0) {
sleep(IPMI_LANP_TIMEOUT);
if (retry-- == 0) {
lprintf(LOG_WARNING, "LAN Parameter Data does not match! "
"Write may have failed.");
return -1;
}
continue;
}
Since we do send the VLAN ID in this return data, regardless of whether VLAN is disabled or not, this mismatch between requested and received parameters causes ipmitool to retry the command 10 times and return an error.
In the interest of resolving this issue for all users of the tool, have made these below changes in ipmitool. Please review it & let me know the comments.
--- ipmi_lanp.c 2016-08-09 15:29:56.000000000 +0530
+++ ipmi_lanp_with_changes.c 2016-08-09 15:29:56.000000000 +0530
@@ -1319,10 +1319,20 @@
{
uint8_t data[2];
int rc;
+ struct lan_param * p; //handling for vlan disable, get the vlan id before sending
if (string == NULL) {
- data[0] = 0;
- data[1] = 0;
+ lprintf(LOG_NOTICE, "get vlan id .");
+ p = get_lan_param(intf, chan, IPMI_LANP_VLAN_ID);
+ if (p != NULL && p->data != NULL) {
+ int id = ((p->data[1] & 0x0f) << 8) + p->data[0];
+ if (id < 1 || id > 4094) {
+ lprintf(LOG_NOTICE, "vlan id retrieved is not 1 and 4094.");
+ return -1;
+ }
+ data[0] = p->data[0];
+ data[1] = p->data[1];
+ }
}
else {
int id = 0;
Regards
Balaji Singh
Hello Balaji,

I'm glad to hear you've managed to BMC patched. As for the other
finding, please, open ticket at sf.net and attach the patch.

Thanks,
Z.

------------------------------------------------------------------------------
Continue reading on narkive:
Loading...