From owner-svn-src-all@freebsd.org Tue Dec 5 18:42:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 289F4E743AF; Tue, 5 Dec 2017 18:42:09 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 001D668269; Tue, 5 Dec 2017 18:42:08 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB5Ig8AX048187; Tue, 5 Dec 2017 18:42:08 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB5Ig7CX048185; Tue, 5 Dec 2017 18:42:07 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201712051842.vB5Ig7CX048185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 5 Dec 2017 18:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326571 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 326571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 18:42:09 -0000 Author: erj Date: Tue Dec 5 18:42:07 2017 New Revision: 326571 URL: https://svnweb.freebsd.org/changeset/base/326571 Log: ifconfig(8): Display extended compliance code string for SFP transceivers - Updates tables in affected files with new entries from newer spec revisions of SFF-8472, SFF-8024, and SFF-8636 - Change ifconfig to read and display the extended compliance code for SFP media if the extended compliance code is not 0. This was being displayed for QSFP transceivers only, but SFP28 media uses this to report 25G capability. Reviewed by: melifaro, sbruno Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D13286 Modified: head/sbin/ifconfig/sfp.c head/sys/net/sff8472.h Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Tue Dec 5 18:26:34 2017 (r326570) +++ head/sbin/ifconfig/sfp.c Tue Dec 5 18:42:07 2017 (r326571) @@ -69,7 +69,7 @@ struct _nv { const char *find_value(struct _nv *x, int value); const char *find_zero_bit(struct _nv *x, int value, int sz); -/* SFF-8472 Rev. 11.4 table 3.4: Connector values */ +/* SFF-8024 Rev. 4.1 Table 4-3: Connector Types */ static struct _nv conn[] = { { 0x00, "Unknown" }, { 0x01, "SC" }, @@ -87,7 +87,8 @@ static struct _nv conn[] = { { 0x20, "HSSDC II" }, { 0x21, "Copper pigtail" }, { 0x22, "RJ45" }, - { 0x23, "No separate connector" }, /* SFF-8436 */ + { 0x23, "No separable connector" }, + { 0x24, "MXC 2x16" }, { 0, NULL } }; @@ -183,10 +184,17 @@ static struct _nv eth_1040g[] = { }; #define SFF_8636_EXT_COMPLIANCE 0x80 -/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */ +/* SFF-8024 Rev. 4.2 table 4-4: Extended Specification Compliance */ static struct _nv eth_extended_comp[] = { { 0xFF, "Reserved" }, - { 0x1A, "2 lambda DWDM 100G" }, + { 0x21, "100G PAM4 BiDi" }, + { 0x20, "100G SWDM4" }, + { 0x1F, "40G SWDM4" }, + { 0x1E, "2.5GBASE-T" }, + { 0x1D, "5GBASE-T" }, + { 0x1C, "10GBASE-T Short Reach" }, + { 0x1B, "100G 1550nm WDM" }, + { 0x1A, "100GE-DWDM2" }, { 0x19, "100G ACC or 25GAUI C2M ACC" }, { 0x18, "100G AOC or 25GAUI C2M AOC" }, { 0x17, "100G CLR4" }, @@ -198,23 +206,24 @@ static struct _nv eth_extended_comp[] = { { 0x11, "4 x 10GBASE-SR" }, { 0x10, "40GBASE-ER4" }, { 0x0F, "Reserved" }, + { 0x0E, "Reserved" }, { 0x0D, "25GBASE-CR CA-N" }, { 0x0C, "25GBASE-CR CA-S" }, { 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" }, { 0x0A, "Reserved" }, - { 0x09, "100G CWDM4 MSA without FEC" }, - { 0x08, "100G ACC (Active Copper Cable)" }, + { 0x09, "Obsolete" }, + { 0x08, "100G ACC (Active Copper Cable) or 25GAUI C2M ACC" }, { 0x07, "100G PSM4 Parallel SMF" }, - { 0x06, "100G CWDM4 MSA with FEC" }, + { 0x06, "100G CWDM4" }, { 0x05, "100GBASE-SR10" }, - { 0x04, "100GBASE-ER4" }, - { 0x03, "100GBASE-LR4" }, - { 0x02, "100GBASE-SR4" }, - { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" }, + { 0x04, "100GBASE-ER4 or 25GBASE-ER" }, + { 0x03, "100GBASE-LR4 or 25GBASE-LR" }, + { 0x02, "100GBASE-SR4 or 25GBASE-SR" }, + { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M AOC" }, { 0x00, "Unspecified" } }; -/* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */ +/* SFF-8636 Rev. 2.9 table 6.3: Revision compliance */ static struct _nv rev_compl[] = { { 0x1, "SFF-8436 rev <=4.8" }, { 0x2, "SFF-8436 rev <=4.8" }, @@ -222,7 +231,8 @@ static struct _nv rev_compl[] = { { 0x4, "SFF-8636 rev <=1.4" }, { 0x5, "SFF-8636 rev <=1.5" }, { 0x6, "SFF-8636 rev <=2.0" }, - { 0x7, "SFF-8636 rev <=2.5" }, + { 0x7, "SFF-8636 rev <=2.7" }, + { 0x8, "SFF-8636 rev >=2.8" }, { 0x0, "Unspecified" } }; @@ -378,17 +388,20 @@ get_sfp_transceiver_class(struct i2c_info *ii, char *b const char *tech_class; uint8_t code; - unsigned char qbuf[8]; - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, (uint8_t *)qbuf); - - /* Check 10G Ethernet/IB first */ - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code); - tech_class = find_zero_bit(eth_10g, code, 1); - if (tech_class == NULL) { - /* No match. Try Ethernet 1G */ - read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3, - 1, (caddr_t)&code); - tech_class = find_zero_bit(eth_compat, code, 1); + /* Use extended compliance code if it's valid */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &code); + if (code != 0) + tech_class = find_value(eth_extended_comp, code); + else { + /* Next, check 10G Ethernet/IB CCs */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code); + tech_class = find_zero_bit(eth_10g, code, 1); + if (tech_class == NULL) { + /* No match. Try Ethernet 1G */ + read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3, + 1, (caddr_t)&code); + tech_class = find_zero_bit(eth_compat, code, 1); + } } if (tech_class == NULL) Modified: head/sys/net/sff8472.h ============================================================================== --- head/sys/net/sff8472.h Tue Dec 5 18:26:34 2017 (r326570) +++ head/sys/net/sff8472.h Tue Dec 5 18:42:07 2017 (r326571) @@ -379,7 +379,7 @@ enum { /* * Table 3.2 Identifier values. - * Identifier constants has taken from SFF-8024 rev 2.9 table 4.1 + * Identifier constants has taken from SFF-8024 rev 4.2 table 4.1 * (as referenced by table 3.2 footer) * */ enum { @@ -400,13 +400,15 @@ enum { SFF_8024_ID_CXP = 0xE, /* CXP */ SFF_8024_ID_HD4X = 0xF, /* Shielded Mini Multilane HD 4X */ SFF_8024_ID_HD8X = 0x10, /* Shielded Mini Multilane HD 8X */ - SFF_8024_ID_QSFP28 = 0x11, /* QSFP28 */ + SFF_8024_ID_QSFP28 = 0x11, /* QSFP28 or later */ SFF_8024_ID_CXP2 = 0x12, /* CXP2 (aka CXP28) */ SFF_8024_ID_CDFP = 0x13, /* CDFP (Style 1/Style 2) */ SFF_8024_ID_SMM4 = 0x14, /* Shielded Mini Multilate HD 4X Fanout */ SFF_8024_ID_SMM8 = 0x15, /* Shielded Mini Multilate HD 8X Fanout */ SFF_8024_ID_CDFP3 = 0x16, /* CDFP (Style3) */ - SFF_8024_ID_LAST = SFF_8024_ID_CDFP3 + SFF_8024_ID_MICROQSFP = 0x17, /* microQSFP */ + SFF_8024_ID_QSFP_DD = 0x18, /* QSFP-DD 8X Pluggable Transceiver */ + SFF_8024_ID_LAST = SFF_8024_ID_QSFP_DD }; static const char *sff_8024_id[SFF_8024_ID_LAST + 1] = {"Unknown", @@ -431,7 +433,9 @@ static const char *sff_8024_id[SFF_8024_ID_LAST + 1] = "CDFP", "SMM4", "SMM8", - "CDFP3"}; + "CDFP3", + "microQSFP", + "QSFP-DD"}; /* Keep compatibility with old definitions */ #define SFF_8472_ID_UNKNOWN SFF_8024_ID_UNKNOWN