i40e: Display error message if module does not meet thermal requirements
authorFilip Sadowski <filip.sadowski@intel.com>
Tue, 29 Aug 2017 09:32:37 +0000 (05:32 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 6 Oct 2017 15:11:31 +0000 (08:11 -0700)
This patch causes error message to be displayed when NIC detects
insertion of module that does not meet thermal requirements.

Signed-off-by: Filip Sadowski <filip.sadowski@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.h
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h

index c78448daa7a17b4b65afd8f8a58e65d8bd1b5cf8..4dc6d43f88120778500888d08703f88a5a590ca1 100644 (file)
@@ -451,6 +451,7 @@ struct i40e_pf {
 #define I40E_FLAG_CLIENT_RESET                 BIT_ULL(54)
 #define I40E_FLAG_TEMP_LINK_POLLING            BIT_ULL(55)
 #define I40E_FLAG_CLIENT_L2_CHANGE             BIT_ULL(56)
+#define I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED   BIT_ULL(57)
 #define I40E_FLAG_LEGACY_RX                    BIT_ULL(58)
 #define I40E_FLAG_SOURCE_PRUNING_DISABLED      BIT_ULL(59)
 
index 50c5a4c630b814f43d017445d0d5fa94c2546c03..a8f65aed542179edbfd043b0a02ef6a87b62058b 100644 (file)
@@ -1772,6 +1772,7 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_SR                = 0x21,
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
        I40E_PHY_TYPE_MAX,
+       I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP   = 0xFD,
        I40E_PHY_TYPE_EMPTY                     = 0xFE,
        I40E_PHY_TYPE_DEFAULT                   = 0xFF,
 };
index 628101bb08d43e53fbc2be83734ecfdc348f81f9..3d6d6a2833276145e9e8aa9e587f5416f5d95096 100644 (file)
@@ -6558,12 +6558,26 @@ static void i40e_handle_link_event(struct i40e_pf *pf,
         */
        i40e_link_event(pf);
 
-       /* check for unqualified module, if link is down */
-       if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-           (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) &&
-           (!(status->link_info & I40E_AQ_LINK_UP)))
+       /* Check if module meets thermal requirements */
+       if (status->phy_type == I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP) {
                dev_err(&pf->pdev->dev,
-                       "The driver failed to link because an unqualified module was detected.\n");
+                       "Rx/Tx is disabled on this device because the module does not meet thermal requirements.\n");
+               dev_err(&pf->pdev->dev,
+                       "Refer to the Intel(R) Ethernet Adapters and Devices User Guide for a list of supported modules.\n");
+       } else {
+               /* check for unqualified module, if link is down, suppress
+                * the message if link was forced to be down.
+                */
+               if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+                   (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) &&
+                   (!(status->link_info & I40E_AQ_LINK_UP)) &&
+                   (!(pf->flags & I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED))) {
+                       dev_err(&pf->pdev->dev,
+                               "Rx/Tx is disabled on this device because an unsupported SFP module type was detected.\n");
+                       dev_err(&pf->pdev->dev,
+                               "Refer to the Intel(R) Ethernet Adapters and Devices User Guide for a list of supported modules.\n");
+               }
+       }
 }
 
 /**
index dc6fc8b1bc79815e63e403d204f6298c4bb4d170..60c892f559b91e1239606b07e415d3e14c6c7bf0 100644 (file)
@@ -1768,6 +1768,7 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_SR                = 0x21,
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
        I40E_PHY_TYPE_MAX,
+       I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP   = 0xFD,
        I40E_PHY_TYPE_EMPTY                     = 0xFE,
        I40E_PHY_TYPE_DEFAULT                   = 0xFF,
 };