Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fcoe: extend ethtool to FC port speed mapping

add support for 20 Gbit and 40 Gbit links

Signed-off-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Chris Leech and committed by
Christoph Hellwig
b8d23dc6 d247a70a

+33 -6
+33 -6
drivers/scsi/fcoe/fcoe_transport.c
··· 96 96 struct ethtool_cmd ecmd; 97 97 98 98 if (!__ethtool_get_settings(netdev, &ecmd)) { 99 - lport->link_supported_speeds &= 100 - ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); 99 + lport->link_supported_speeds &= ~(FC_PORTSPEED_1GBIT | 100 + FC_PORTSPEED_10GBIT | 101 + FC_PORTSPEED_20GBIT | 102 + FC_PORTSPEED_40GBIT); 103 + 101 104 if (ecmd.supported & (SUPPORTED_1000baseT_Half | 102 - SUPPORTED_1000baseT_Full)) 105 + SUPPORTED_1000baseT_Full | 106 + SUPPORTED_1000baseKX_Full)) 103 107 lport->link_supported_speeds |= FC_PORTSPEED_1GBIT; 104 - if (ecmd.supported & SUPPORTED_10000baseT_Full) 105 - lport->link_supported_speeds |= 106 - FC_PORTSPEED_10GBIT; 108 + 109 + if (ecmd.supported & (SUPPORTED_10000baseT_Full | 110 + SUPPORTED_10000baseKX4_Full | 111 + SUPPORTED_10000baseKR_Full | 112 + SUPPORTED_10000baseR_FEC)) 113 + lport->link_supported_speeds |= FC_PORTSPEED_10GBIT; 114 + 115 + if (ecmd.supported & (SUPPORTED_20000baseMLD2_Full | 116 + SUPPORTED_20000baseKR2_Full)) 117 + lport->link_supported_speeds |= FC_PORTSPEED_20GBIT; 118 + 119 + if (ecmd.supported & (SUPPORTED_40000baseKR4_Full | 120 + SUPPORTED_40000baseCR4_Full | 121 + SUPPORTED_40000baseSR4_Full | 122 + SUPPORTED_40000baseLR4_Full)) 123 + lport->link_supported_speeds |= FC_PORTSPEED_40GBIT; 124 + 107 125 switch (ethtool_cmd_speed(&ecmd)) { 108 126 case SPEED_1000: 109 127 lport->link_speed = FC_PORTSPEED_1GBIT; 110 128 break; 111 129 case SPEED_10000: 112 130 lport->link_speed = FC_PORTSPEED_10GBIT; 131 + break; 132 + case 20000: 133 + lport->link_speed = FC_PORTSPEED_20GBIT; 134 + break; 135 + case 40000: 136 + lport->link_speed = FC_PORTSPEED_40GBIT; 137 + break; 138 + default: 139 + lport->link_speed = FC_PORTSPEED_UNKNOWN; 113 140 break; 114 141 } 115 142 return 0;