Commit 18c012d9 authored by Brett Creeley's avatar Brett Creeley Committed by Jeff Kirsher

iavf: Fix reporting 2.5 Gb and 5Gb speeds

Commit 4ae4916b ("i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb
speeds") added the ability for the PF to report 2.5 and 5Gb speeds,
however, the iavf driver does not recognize those speeds as the values were
not added there. Add the proper enums and values so that iavf can properly
deal with those speeds.

Fixes: 4ae4916b ("i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb speeds")
Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
Signed-off-by: default avatarWitold Fijalkowski <witoldx.fijalkowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 5071bda2
...@@ -303,6 +303,12 @@ static int iavf_get_link_ksettings(struct net_device *netdev, ...@@ -303,6 +303,12 @@ static int iavf_get_link_ksettings(struct net_device *netdev,
case VIRTCHNL_LINK_SPEED_10GB: case VIRTCHNL_LINK_SPEED_10GB:
cmd->base.speed = SPEED_10000; cmd->base.speed = SPEED_10000;
break; break;
case VIRTCHNL_LINK_SPEED_5GB:
cmd->base.speed = SPEED_5000;
break;
case VIRTCHNL_LINK_SPEED_2_5GB:
cmd->base.speed = SPEED_2500;
break;
case VIRTCHNL_LINK_SPEED_1GB: case VIRTCHNL_LINK_SPEED_1GB:
cmd->base.speed = SPEED_1000; cmd->base.speed = SPEED_1000;
break; break;
......
...@@ -2499,22 +2499,28 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter, ...@@ -2499,22 +2499,28 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,
switch (adapter->link_speed) { switch (adapter->link_speed) {
case VIRTCHNL_LINK_SPEED_40GB: case VIRTCHNL_LINK_SPEED_40GB:
speed = 40000; speed = SPEED_40000;
break; break;
case VIRTCHNL_LINK_SPEED_25GB: case VIRTCHNL_LINK_SPEED_25GB:
speed = 25000; speed = SPEED_25000;
break; break;
case VIRTCHNL_LINK_SPEED_20GB: case VIRTCHNL_LINK_SPEED_20GB:
speed = 20000; speed = SPEED_20000;
break; break;
case VIRTCHNL_LINK_SPEED_10GB: case VIRTCHNL_LINK_SPEED_10GB:
speed = 10000; speed = SPEED_10000;
break;
case VIRTCHNL_LINK_SPEED_5GB:
speed = SPEED_5000;
break;
case VIRTCHNL_LINK_SPEED_2_5GB:
speed = SPEED_2500;
break; break;
case VIRTCHNL_LINK_SPEED_1GB: case VIRTCHNL_LINK_SPEED_1GB:
speed = 1000; speed = SPEED_1000;
break; break;
case VIRTCHNL_LINK_SPEED_100MB: case VIRTCHNL_LINK_SPEED_100MB:
speed = 100; speed = SPEED_100;
break; break;
default: default:
break; break;
......
...@@ -933,6 +933,12 @@ static void iavf_print_link_message(struct iavf_adapter *adapter) ...@@ -933,6 +933,12 @@ static void iavf_print_link_message(struct iavf_adapter *adapter)
case VIRTCHNL_LINK_SPEED_10GB: case VIRTCHNL_LINK_SPEED_10GB:
link_speed_mbps = SPEED_10000; link_speed_mbps = SPEED_10000;
break; break;
case VIRTCHNL_LINK_SPEED_5GB:
link_speed_mbps = SPEED_5000;
break;
case VIRTCHNL_LINK_SPEED_2_5GB:
link_speed_mbps = SPEED_2500;
break;
case VIRTCHNL_LINK_SPEED_1GB: case VIRTCHNL_LINK_SPEED_1GB:
link_speed_mbps = SPEED_1000; link_speed_mbps = SPEED_1000;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment