Discussion:
[Ipmitool-devel] [PATCH v2] Add support for PICMG 3.1 R2.0 Link Types and Link Classes.
Dan Gora
2016-07-28 21:50:48 UTC
Permalink
Hi All,

Sorry, I munged that last patch.... Here is rev 2. This adds support
for decoding new Link class fields from PICMG 3.1 R2.0 in 'ipmitool -v
fru' output.

Here is some example output:
Link Grouping ID: 0x00
Link Type Extension: 0x03 - 1000Base-KX
Link Type: 0x02 - PICMG 3.1 Ethernet Fabric Interface
Base signaling Link Class
Link Designator:
Port Flag: 0x01
Interface: 0x01 - Fabric Interface
Channel Number: 0x02

Link Grouping ID: 0x00
Link Type Extension: 0x00 - 1000Base-BX
Link Type: 0x02 - PICMG 3.1 Ethernet Fabric Interface
Base signaling Link Class
Link Designator:
Port Flag: 0x01
Interface: 0x01 - Fabric Interface
Channel Number: 0x01

Link Grouping ID: 0x00
Link Type Extension: 0x00 - 1000Base-BX
Link Type: 0x02 - PICMG 3.1 Ethernet Fabric Interface
Base signaling Link Class
Link Designator:
Port Flag: 0x01
Interface: 0x01 - Fabric Interface
Channel Number: 0x02

Link Grouping ID: 0x00
Link Type Extension: 0x01 - 40GBase-KR4
Link Type: 0x32 - PICMG 3.1 Ethernet Fabric Interface
10.3125Gbd signaling Link Class
Link Designator:
Port Flag: 0x0f
Interface: 0x01 - Fabric Interface
Channel Number: 0x01

Link Grouping ID: 0x00
Link Type Extension: 0x01 - 40GBase-KR4
Link Type: 0x32 - PICMG 3.1 Ethernet Fabric Interface
10.3125Gbd signaling Link Class
Link Designator:
Port Flag: 0x0f
Interface: 0x01 - Fabric Interface
Channel Number: 0x02

Link Grouping ID: 0x00
Link Type Extension: 0x00 - 10GBase-KR
Link Type: 0x32 - PICMG 3.1 Ethernet Fabric Interface
10.3125Gbd signaling Link Class
Link Designator:
Port Flag: 0x01
Interface: 0x01 - Fabric Interface
Channel Number: 0x01

Link Grouping ID: 0x00
Link Type Extension: 0x00 - 10GBase-KR
Link Type: 0x32 - PICMG 3.1 Ethernet Fabric Interface
10.3125Gbd signaling Link Class
Link Designator:
Port Flag: 0x01
Interface: 0x01 - Fabric Interface
Channel Number: 0x02

These patches are on top of the latest git commit a3bec1d3658c

Please have a look and let me know if there are any questions or problems.

thanks
dan


======================

PICMG 3.1 R2.0 introduces new a new Link Class field in the FRU
Link Descriptors which is the upper 4 bits of the Link Type field.
This new Link Class field specifies SERDES lanes with 10.3125Gbd
signalling rate.

It also introduces the new Base-KX and Base-KX4 types which are the
new IEEE replacements for the PICMG 3.0 Base-BX and Base-BX4 types.

This patch decodes these new types and fields and will print out
proper descriptions for each one based on PICMG 3.1 R2.0

diff --git a/include/ipmitool/ipmi_fru.h b/include/ipmitool/ipmi_fru.h
index b371f44..65696ba 100644
--- a/include/ipmitool/ipmi_fru.h
+++ b/include/ipmitool/ipmi_fru.h
@@ -297,22 +297,24 @@ struct fru_picmgext_link_desc {
unsigned int desig_channel:6;
unsigned int desig_if:2;
unsigned int desig_port:4;
-#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
+#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
-#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
-#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
+#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int ext:4;
unsigned int grouping:8;
#else
unsigned int grouping:8;
unsigned int ext:4;
-#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
+#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02
#define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03
-#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
-#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04
+#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05
+#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32
unsigned int type:8;
unsigned int desig_port:4;
unsigned int desig_if:2;
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index e5396d8..110c5d8 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -2297,68 +2297,91 @@ static void ipmi_fru_picmg_ext_print(uint8_t *
fru_data, int off, int length)
printf("ShMC
Cross-connect (two-pair)\n");
break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
break;
}
} else if (d->type ==
FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET) {
switch (d->ext)
{
case 0:
- printf("Fixed
1000Base-BX\n");
+ printf("1000Base-BX\n");
break;
case 1:
- printf("Fixed
10GBASE-BX4 [XAUI]\n");
+
printf("10GBase-BX4 [XAUI]\n");
break;
case 2:
printf("FC-PI\n");
break;
+ case 3:
+ printf("1000Base-KX\n");
+ break;
+ case 4:
+ printf("10GBase-KX4\n");
+ break;
+ default:
+ printf("Unknown\n");
+ break;
+ }
+ } else if (d->type ==
FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD) {
+ switch (d->ext)
+ {
+ case 0:
+ printf("10GBase-KR\n");
+ break;
+ case 1:
+ printf("40GBase-KR4\n");
+ break;
default:
- printf("Unknwon\n");
+ printf("Unknown\n");
break;
}
} else if (d->type ==
FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type ==
FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else if (d->type ==
FRU_PICMGEXT_LINK_TYPE_PCIE) {
- printf("Unknwon\n");
+ printf("Unknown\n");
} else {
- printf("Unknwon\n");
+ printf("Unknown\n");
}

printf(" Link Type: 0x%02x - ",
d->type);
- if (d->type == 0 || d->type == 0xff) {
- printf("Reserved\n");
- }
- else if (d->type >= 0x06 && d->type <= 0xef) {
- printf("Reserved\n");
- }
- else if (d->type >= 0xf0 && d->type <= 0xfe) {
- printf("OEM GUID Definition\n");
- }
- else {
- switch (d->type)
- {
- case
FRU_PICMGEXT_LINK_TYPE_BASE:
- printf("PICMG
3.0 Base Interface 10/100/1000\n");
- break;
- case
FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET:
- printf("PICMG
3.1 Ethernet Fabric Interface\n");
- break;
- case
FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND:
- printf("PICMG
3.2 Infiniband Fabric Interface\n");
- break;
- case
FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR:
- printf("PICMG
3.3 Star Fabric Interface\n");
- break;
- case
FRU_PICMGEXT_LINK_TYPE_PCIE:
- printf("PICMG
3.4 PCI Express Fabric Interface\n");
- break;
- default:
+ switch (d->type) {
+ case FRU_PICMGEXT_LINK_TYPE_BASE:
+ printf("PICMG 3.0 Base
Interface 10/100/1000\n");
+ break;
+ case
FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET:
+ printf("PICMG 3.1
Ethernet Fabric Interface\n");
+ printf("
Base signaling Link Class\n");
+ break;
+ case
FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND:
+ printf("PICMG 3.2
Infiniband Fabric Interface\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR:
+ printf("PICMG 3.3 Star
Fabric Interface\n");
+ break;
+ case FRU_PICMGEXT_LINK_TYPE_PCIE:
+ printf("PICMG 3.4 PCI
Express Fabric Interface\n");
+ break;
+ case
FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD:
+ printf("PICMG 3.1
Ethernet Fabric Interface\n");
+ printf("
10.3125Gbd signaling Link Class\n");
+ break;
+ default:
+ if (d->type == 0 ||
d->type == 0xff) {
+ printf("Reserved\n");
+ }
+ else if (d->type >=
0x06 && d->type <= 0xef) {
+ printf("Reserved\n");
+ }
+ else if (d->type >=
0xf0 && d->type <= 0xfe) {
+ printf("OEM
GUID Definition\n");
+ }
+ else {
printf("Invalid\n");
- break;
- }
+ }
+ break;
}
printf(" Link Designator: \n");

Loading...