Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 2021 20:50:42 GMT
From:      Eric Joyner <erj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6f6013102be0 - stable/13 - ixl(4): Fix reporting of unqualified transceivers
Message-ID:  <202109202050.18KKogVo057433@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by erj:

URL: https://cgit.FreeBSD.org/src/commit/?id=6f6013102be03f914bd2471236ff098c961c9717

commit 6f6013102be03f914bd2471236ff098c961c9717
Author:     Krzysztof Galazka <krzysztof.galazka@intel.com>
AuthorDate: 2021-08-20 21:12:28 +0000
Commit:     Eric Joyner <erj@FreeBSD.org>
CommitDate: 2021-09-20 20:42:55 +0000

    ixl(4): Fix reporting of unqualified transceivers
    
    When link_active_on_if_down flag is disabled and link is brought down
    with ifconfig, FW reports a false positive link event about an
    unqualified transceiver. The condition used in the driver to filter out
    those false positive events was incorrect and caused that unqualified
    module event to also not be reported when the event was valid.
    
    Change the condition to rely on IFF_UP flag instead of
    link_active_on_if_down and bump driver version to 2.3.1-k.
    
    Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
    Signed-off-by: Eric Joyner <erj@FreeBSD.org>
    
    Reviewed by:    stallamr@netapp.com, erj@
    Tested by:      gowtham.kumar.ks@intel.com
    Sponsored by:   Intel Corporation
    Differential Revision:  https://reviews.freebsd.org/D30733
    
    (cherry picked from commit c4622b01d2f12b889b57ff7d0b03a38dfcb00fd8)
---
 sys/dev/ixl/if_ixl.c       |  2 +-
 sys/dev/ixl/ixl_pf_iflib.c | 21 ++++++++++++---------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c
index 3b49da5d76b9..f620771e93b1 100644
--- a/sys/dev/ixl/if_ixl.c
+++ b/sys/dev/ixl/if_ixl.c
@@ -49,7 +49,7 @@
  *********************************************************************/
 #define IXL_DRIVER_VERSION_MAJOR	2
 #define IXL_DRIVER_VERSION_MINOR	3
-#define IXL_DRIVER_VERSION_BUILD	0
+#define IXL_DRIVER_VERSION_BUILD	1
 
 #define IXL_DRIVER_VERSION_STRING			\
     __XSTRING(IXL_DRIVER_VERSION_MAJOR) "."		\
diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c
index 68a174889c41..6ea20389c547 100644
--- a/sys/dev/ixl/ixl_pf_iflib.c
+++ b/sys/dev/ixl/ixl_pf_iflib.c
@@ -403,20 +403,23 @@ ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e)
 {
 	struct i40e_hw *hw = &pf->hw;
 	device_t dev = iflib_get_dev(pf->vsi.ctx);
-	struct i40e_aqc_get_link_status *status =
-	    (struct i40e_aqc_get_link_status *)&e->desc.params.raw;
-
-	/* Request link status from adapter */
+	struct i40e_link_status *link_info = &hw->phy.link_info;
+
+	/* Driver needs to re-enable delivering of link status events
+	 * by FW after each event reception. Call i40e_get_link_status
+	 * to do that. To not lose information about link state changes,
+	 * which happened between receiving an event and the call,
+	 * do not rely on status from event but use most recent
+	 * status information retrieved by the call. */
 	hw->phy.get_link_info = TRUE;
 	i40e_get_link_status(hw, &pf->link_up);
 
 	/* Print out message if an unqualified module is found */
-	if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	if ((link_info->link_info & I40E_AQ_MEDIA_AVAILABLE) &&
 	    (pf->advertised_speed) &&
-	    (atomic_load_32(&pf->state) &
-	     IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0 &&
-	    (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) &&
-	    (!(status->link_info & I40E_AQ_LINK_UP)))
+	    (if_getflags(pf->vsi.ifp) & IFF_UP) &&
+	    (!(link_info->an_info & I40E_AQ_QUALIFIED_MODULE)) &&
+	    (!(link_info->link_info & I40E_AQ_LINK_UP)))
 		device_printf(dev, "Link failed because "
 		    "an unqualified module was detected!\n");
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109202050.18KKogVo057433>