i40e: fix 'Unknown bps' in dmesg for 2.5Gb/5Gb speeds
authorAleksandr Loktionov <aleksandr.loktionov@intel.com>
Tue, 28 May 2019 17:59:15 +0000 (10:59 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 26 Jun 2019 16:18:54 +0000 (09:18 -0700)
This patch fixes 'NIC Link is Up, Unknown bps' message in dmesg
for 2.5Gb/5Gb speeds. This problem is fixed by adding constants
for VIRTCHNL_LINK_SPEED_2_5GB and VIRTCHNL_LINK_SPEED_5GB cases
in the i40e_virtchnl_link_speed() function.

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_prototype.h
include/linux/avf/virtchnl.h

index 882627073dcea8ab12a66c4b5f4bd391b125900a..eac88bcc6c0653f2d26cc3e7ab4ef16a684da451 100644 (file)
@@ -350,6 +350,10 @@ i40e_virtchnl_link_speed(enum i40e_aq_link_speed link_speed)
                return VIRTCHNL_LINK_SPEED_100MB;
        case I40E_LINK_SPEED_1GB:
                return VIRTCHNL_LINK_SPEED_1GB;
+       case I40E_LINK_SPEED_2_5GB:
+               return VIRTCHNL_LINK_SPEED_2_5GB;
+       case I40E_LINK_SPEED_5GB:
+               return VIRTCHNL_LINK_SPEED_5GB;
        case I40E_LINK_SPEED_10GB:
                return VIRTCHNL_LINK_SPEED_10GB;
        case I40E_LINK_SPEED_40GB:
index 191621ff7594f50dc82c21f6c15b291b79409ad1..ca956b672ac0f75958c9649293e0d870014acc0e 100644 (file)
@@ -61,12 +61,14 @@ enum virtchnl_status_code {
 #define VIRTCHNL_ERR_PARAM VIRTCHNL_STATUS_ERR_PARAM
 #define VIRTCHNL_STATUS_NOT_SUPPORTED VIRTCHNL_STATUS_ERR_NOT_SUPPORTED
 
+#define VIRTCHNL_LINK_SPEED_2_5GB_SHIFT                0x0
 #define VIRTCHNL_LINK_SPEED_100MB_SHIFT                0x1
 #define VIRTCHNL_LINK_SPEED_1000MB_SHIFT       0x2
 #define VIRTCHNL_LINK_SPEED_10GB_SHIFT         0x3
 #define VIRTCHNL_LINK_SPEED_40GB_SHIFT         0x4
 #define VIRTCHNL_LINK_SPEED_20GB_SHIFT         0x5
 #define VIRTCHNL_LINK_SPEED_25GB_SHIFT         0x6
+#define VIRTCHNL_LINK_SPEED_5GB_SHIFT          0x7
 
 enum virtchnl_link_speed {
        VIRTCHNL_LINK_SPEED_UNKNOWN     = 0,
@@ -76,6 +78,8 @@ enum virtchnl_link_speed {
        VIRTCHNL_LINK_SPEED_40GB        = BIT(VIRTCHNL_LINK_SPEED_40GB_SHIFT),
        VIRTCHNL_LINK_SPEED_20GB        = BIT(VIRTCHNL_LINK_SPEED_20GB_SHIFT),
        VIRTCHNL_LINK_SPEED_25GB        = BIT(VIRTCHNL_LINK_SPEED_25GB_SHIFT),
+       VIRTCHNL_LINK_SPEED_2_5GB       = BIT(VIRTCHNL_LINK_SPEED_2_5GB_SHIFT),
+       VIRTCHNL_LINK_SPEED_5GB         = BIT(VIRTCHNL_LINK_SPEED_5GB_SHIFT),
 };
 
 /* for hsplit_0 field of Rx HMC context */