Skip to content

Commit 18c012d

Browse files
bcreeley13Jeff Kirsher
authored andcommitted
iavf: Fix reporting 2.5 Gb and 5Gb speeds
Commit 4ae4916 ("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: 4ae4916 ("i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb speeds") Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Witold Fijalkowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 5071bda commit 18c012d

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ static int iavf_get_link_ksettings(struct net_device *netdev,
303303
case VIRTCHNL_LINK_SPEED_10GB:
304304
cmd->base.speed = SPEED_10000;
305305
break;
306+
case VIRTCHNL_LINK_SPEED_5GB:
307+
cmd->base.speed = SPEED_5000;
308+
break;
309+
case VIRTCHNL_LINK_SPEED_2_5GB:
310+
cmd->base.speed = SPEED_2500;
311+
break;
306312
case VIRTCHNL_LINK_SPEED_1GB:
307313
cmd->base.speed = SPEED_1000;
308314
break;

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,22 +2499,28 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,
24992499

25002500
switch (adapter->link_speed) {
25012501
case VIRTCHNL_LINK_SPEED_40GB:
2502-
speed = 40000;
2502+
speed = SPEED_40000;
25032503
break;
25042504
case VIRTCHNL_LINK_SPEED_25GB:
2505-
speed = 25000;
2505+
speed = SPEED_25000;
25062506
break;
25072507
case VIRTCHNL_LINK_SPEED_20GB:
2508-
speed = 20000;
2508+
speed = SPEED_20000;
25092509
break;
25102510
case VIRTCHNL_LINK_SPEED_10GB:
2511-
speed = 10000;
2511+
speed = SPEED_10000;
2512+
break;
2513+
case VIRTCHNL_LINK_SPEED_5GB:
2514+
speed = SPEED_5000;
2515+
break;
2516+
case VIRTCHNL_LINK_SPEED_2_5GB:
2517+
speed = SPEED_2500;
25122518
break;
25132519
case VIRTCHNL_LINK_SPEED_1GB:
2514-
speed = 1000;
2520+
speed = SPEED_1000;
25152521
break;
25162522
case VIRTCHNL_LINK_SPEED_100MB:
2517-
speed = 100;
2523+
speed = SPEED_100;
25182524
break;
25192525
default:
25202526
break;

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,12 @@ static void iavf_print_link_message(struct iavf_adapter *adapter)
933933
case VIRTCHNL_LINK_SPEED_10GB:
934934
link_speed_mbps = SPEED_10000;
935935
break;
936+
case VIRTCHNL_LINK_SPEED_5GB:
937+
link_speed_mbps = SPEED_5000;
938+
break;
939+
case VIRTCHNL_LINK_SPEED_2_5GB:
940+
link_speed_mbps = SPEED_2500;
941+
break;
936942
case VIRTCHNL_LINK_SPEED_1GB:
937943
link_speed_mbps = SPEED_1000;
938944
break;

0 commit comments

Comments
 (0)