From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0CC783772; Fri, 12 Apr 2019 03:48:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3C1jmtI004373; Thu, 11 Apr 2019 18:48:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=9eKvxRb4rZ9Kful/MLLlhi3F1gfty/7j7qIAz0Det0c=; b=Du1gP/g81qrrpRK9f6a1/Vz9TgsYcctNQ2NEgZip8o0EHKl18KSGaRiSLocOOSujHKxo YgU/H5muIqgbZf+6M3gR66j+N5+sriY1Dy755n3Qt/KTRpFJY47XGH4O5Ys9LXSWeIFm k7wSh3gm68HtmvU8iCrRM65rZ1gj12jBpLMbpQNMF806lv/i2knWjGsNnoPPjT43kYpl m04IcX73MAKasi1oPcrq8GQYPyL8RkpCjCzyrMrk1+a20DZlS8o5F4x7bNza/JfhtRXt tnJHyLCLsJAS9Nrp0aoQ8qphjsRVU/33fj2NjPn3Hk2qtlrNSHDkVvLfBYdDLQAYYqiZ mw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2rt7b8j6y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 Apr 2019 18:48:22 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 11 Apr 2019 18:48:22 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 11 Apr 2019 18:48:22 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 1E9F03F7041; Thu, 11 Apr 2019 18:48:22 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id x3C1mMBF023006; Thu, 11 Apr 2019 18:48:22 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: CC: Rasesh Mody , , , Date: Thu, 11 Apr 2019 18:47:42 -0700 Message-ID: <1555033662-22935-6-git-send-email-rmody@marvell.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1555033662-22935-1-git-send-email-rmody@marvell.com> References: <1555033662-22935-1-git-send-email-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-12_01:, , signatures=0 Subject: [dpdk-dev] [PATCH 6/6] net/bnx2x: fix optic module verification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Apr 2019 01:48:24 -0000 Enable the optic module vendor and part number verification from driver by setting appropriate flags. Link handling module in conjunction with FW performs optic module verification. Without this fix the SFP is powered down and the link doesn't come up, if module verification is enforced in nvram setting. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 21 +++++++++++++++++++++ drivers/net/bnx2x/bnx2x.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index f32db6d..3e705c7 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -8103,6 +8103,27 @@ static int bnx2x_get_shmem_info(struct bnx2x_softc *sc) ~ELINK_FEATURE_CONFIG_OVERRIDE_PREEMPHASIS_ENABLED; } + val = sc->devinfo.bc_ver >> 8; + if (val < BNX2X_BC_VER) { + /* for now only warn later we might need to enforce this */ + PMD_DRV_LOG(NOTICE, sc, "This driver needs bc_ver %X but found %X, please upgrade BC\n", + BNX2X_BC_VER, val); + } + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY : + 0; + + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY : 0; + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_AFEX_SUPPORTED) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_AFEX : 0; + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED : 0; + /* get the initial value of the link params */ sc->link_params.multi_phy_config = SHMEM_RD(sc, dev_info.port_hw_config[port].multi_phy_config); diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index bb80310..ef1688f 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -119,6 +119,8 @@ int bnx2x_ilog2(int x) #define ilog2(x) bnx2x_ilog2(x) #endif +#define BNX2X_BC_VER 0x040200 + #include "ecore_sp.h" struct bnx2x_device_type { -- 1.7.10.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B5A38A0096 for ; Fri, 12 Apr 2019 03:49:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B960A5942; Fri, 12 Apr 2019 03:48:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 0CC783772; Fri, 12 Apr 2019 03:48:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3C1jmtI004373; Thu, 11 Apr 2019 18:48:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=9eKvxRb4rZ9Kful/MLLlhi3F1gfty/7j7qIAz0Det0c=; b=Du1gP/g81qrrpRK9f6a1/Vz9TgsYcctNQ2NEgZip8o0EHKl18KSGaRiSLocOOSujHKxo YgU/H5muIqgbZf+6M3gR66j+N5+sriY1Dy755n3Qt/KTRpFJY47XGH4O5Ys9LXSWeIFm k7wSh3gm68HtmvU8iCrRM65rZ1gj12jBpLMbpQNMF806lv/i2knWjGsNnoPPjT43kYpl m04IcX73MAKasi1oPcrq8GQYPyL8RkpCjCzyrMrk1+a20DZlS8o5F4x7bNza/JfhtRXt tnJHyLCLsJAS9Nrp0aoQ8qphjsRVU/33fj2NjPn3Hk2qtlrNSHDkVvLfBYdDLQAYYqiZ mw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2rt7b8j6y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 Apr 2019 18:48:22 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 11 Apr 2019 18:48:22 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 11 Apr 2019 18:48:22 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 1E9F03F7041; Thu, 11 Apr 2019 18:48:22 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id x3C1mMBF023006; Thu, 11 Apr 2019 18:48:22 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: CC: Rasesh Mody , , , Date: Thu, 11 Apr 2019 18:47:42 -0700 Message-ID: <1555033662-22935-6-git-send-email-rmody@marvell.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1555033662-22935-1-git-send-email-rmody@marvell.com> References: <1555033662-22935-1-git-send-email-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-12_01:, , signatures=0 Subject: [dpdk-dev] [PATCH 6/6] net/bnx2x: fix optic module verification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190412014742.aiSLe3MHC7qcYYoAT4su2AuOz7oWj44as4Ew4ElG-i0@z> Enable the optic module vendor and part number verification from driver by setting appropriate flags. Link handling module in conjunction with FW performs optic module verification. Without this fix the SFP is powered down and the link doesn't come up, if module verification is enforced in nvram setting. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 21 +++++++++++++++++++++ drivers/net/bnx2x/bnx2x.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index f32db6d..3e705c7 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -8103,6 +8103,27 @@ static int bnx2x_get_shmem_info(struct bnx2x_softc *sc) ~ELINK_FEATURE_CONFIG_OVERRIDE_PREEMPHASIS_ENABLED; } + val = sc->devinfo.bc_ver >> 8; + if (val < BNX2X_BC_VER) { + /* for now only warn later we might need to enforce this */ + PMD_DRV_LOG(NOTICE, sc, "This driver needs bc_ver %X but found %X, please upgrade BC\n", + BNX2X_BC_VER, val); + } + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_OPT_MDL_VRFY : + 0; + + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_DUAL_PHY_OPT_MDL_VRFY : 0; + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_VRFY_AFEX_SUPPORTED) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_AFEX : 0; + sc->link_params.feature_config_flags |= + (val >= REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED) ? + ELINK_FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED : 0; + /* get the initial value of the link params */ sc->link_params.multi_phy_config = SHMEM_RD(sc, dev_info.port_hw_config[port].multi_phy_config); diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index bb80310..ef1688f 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -119,6 +119,8 @@ int bnx2x_ilog2(int x) #define ilog2(x) bnx2x_ilog2(x) #endif +#define BNX2X_BC_VER 0x040200 + #include "ecore_sp.h" struct bnx2x_device_type { -- 1.7.10.3