diff options
author | Chris Leech <cleech@redhat.com> | 2014-09-25 14:55:42 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-09-30 03:28:36 -0400 |
commit | b8d23dc6133c495cf9161dfb36988bbbe163461d (patch) | |
tree | 39a6d8f0bc3905a61ee5c752a69886c3d642401c | |
parent | d247a70a4d67623eb738176ee703a7bb8b6c325c (diff) |
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>
-rw-r--r-- | drivers/scsi/fcoe/fcoe_transport.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index 74277c20f6a5..bdc89899561a 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c | |||
@@ -96,14 +96,32 @@ int fcoe_link_speed_update(struct fc_lport *lport) | |||
96 | struct ethtool_cmd ecmd; | 96 | struct ethtool_cmd ecmd; |
97 | 97 | ||
98 | if (!__ethtool_get_settings(netdev, &ecmd)) { | 98 | if (!__ethtool_get_settings(netdev, &ecmd)) { |
99 | lport->link_supported_speeds &= | 99 | lport->link_supported_speeds &= ~(FC_PORTSPEED_1GBIT | |
100 | ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); | 100 | FC_PORTSPEED_10GBIT | |
101 | FC_PORTSPEED_20GBIT | | ||
102 | FC_PORTSPEED_40GBIT); | ||
103 | |||
101 | if (ecmd.supported & (SUPPORTED_1000baseT_Half | | 104 | if (ecmd.supported & (SUPPORTED_1000baseT_Half | |
102 | SUPPORTED_1000baseT_Full)) | 105 | SUPPORTED_1000baseT_Full | |
106 | SUPPORTED_1000baseKX_Full)) | ||
103 | lport->link_supported_speeds |= FC_PORTSPEED_1GBIT; | 107 | lport->link_supported_speeds |= FC_PORTSPEED_1GBIT; |
104 | if (ecmd.supported & SUPPORTED_10000baseT_Full) | 108 | |
105 | lport->link_supported_speeds |= | 109 | if (ecmd.supported & (SUPPORTED_10000baseT_Full | |
106 | FC_PORTSPEED_10GBIT; | 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 | switch (ethtool_cmd_speed(&ecmd)) { | 125 | switch (ethtool_cmd_speed(&ecmd)) { |
108 | case SPEED_1000: | 126 | case SPEED_1000: |
109 | lport->link_speed = FC_PORTSPEED_1GBIT; | 127 | lport->link_speed = FC_PORTSPEED_1GBIT; |
@@ -111,6 +129,15 @@ int fcoe_link_speed_update(struct fc_lport *lport) | |||
111 | case SPEED_10000: | 129 | case SPEED_10000: |
112 | lport->link_speed = FC_PORTSPEED_10GBIT; | 130 | lport->link_speed = FC_PORTSPEED_10GBIT; |
113 | break; | 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; | ||
140 | break; | ||
114 | } | 141 | } |
115 | return 0; | 142 | return 0; |
116 | } | 143 | } |