From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 92AE7326C for ; Tue, 20 Nov 2018 20:15:56 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1704369BC; Tue, 20 Nov 2018 19:15:55 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE70C60141; Tue, 20 Nov 2018 19:15:54 +0000 (UTC) From: Kevin Traynor To: Rasesh Mody Cc: dpdk stable Date: Tue, 20 Nov 2018 19:12:43 +0000 Message-Id: <20181120191252.30277-53-ktraynor@redhat.com> In-Reply-To: <20181120191252.30277-1-ktraynor@redhat.com> References: <20181120191252.30277-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Nov 2018 19:15:56 +0000 (UTC) Subject: [dpdk-stable] patch 'net/qede/base: fix logic for sfp get/set' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:15:57 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/23/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 123956f54fcf9fd43abb2e16f92cfdc4e55abf10 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Sat, 8 Sep 2018 13:30:56 -0700 Subject: [PATCH] net/qede/base: fix logic for sfp get/set [ upstream commit 6d1be6d6f8de09ce473fd7c2daa1768125bba647 ] Fix logic for sfp get rx_los, tx_fault, tx_disable, and sfp set tx_disable. Fixes: bdc40630a8eb ("net/qede/base: add APIs for xcvr") Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_mcp.c | 37 ++++++++++++++++----------- drivers/net/qede/base/ecore_mcp_api.h | 2 ++ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 49963c691..fdcf6fbbe 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2202,6 +2202,8 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, - u32 *p_tranceiver_type) + u32 *p_transceiver_state, + u32 *p_transceiver_type) { + u32 transceiver_info; enum _ecore_status_t rc = ECORE_SUCCESS; @@ -2214,12 +2216,21 @@ enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn, return ECORE_BUSY; } - if (!p_ptt) { - *p_tranceiver_type = ETH_TRANSCEIVER_TYPE_NONE; - rc = ECORE_INVAL; + + *p_transceiver_type = ETH_TRANSCEIVER_TYPE_NONE; + *p_transceiver_state = ETH_TRANSCEIVER_STATE_UPDATING; + + transceiver_info = ecore_rd(p_hwfn, p_ptt, + p_hwfn->mcp_info->port_addr + + offsetof(struct public_port, + transceiver_data)); + + *p_transceiver_state = GET_MFW_FIELD(transceiver_info, + ETH_TRANSCEIVER_STATE); + + if (*p_transceiver_state == ETH_TRANSCEIVER_STATE_PRESENT) { + *p_transceiver_type = GET_MFW_FIELD(transceiver_info, + ETH_TRANSCEIVER_TYPE); } else { - *p_tranceiver_type = ecore_rd(p_hwfn, p_ptt, - p_hwfn->mcp_info->port_addr + - offsetof(struct public_port, - transceiver_data)); + *p_transceiver_type = ETH_TRANSCEIVER_TYPE_UNKNOWN; } @@ -2241,13 +2252,9 @@ enum _ecore_status_t ecore_mcp_trans_speed_mask(struct ecore_hwfn *p_hwfn, u32 *p_speed_mask) { - u32 transceiver_data, transceiver_type, transceiver_state; + u32 transceiver_type, transceiver_state; - ecore_mcp_get_transceiver_data(p_hwfn, p_ptt, &transceiver_data); + ecore_mcp_get_transceiver_data(p_hwfn, p_ptt, &transceiver_state, + &transceiver_type); - transceiver_state = GET_MFW_FIELD(transceiver_data, - ETH_TRANSCEIVER_STATE); - - transceiver_type = GET_MFW_FIELD(transceiver_data, - ETH_TRANSCEIVER_TYPE); if (is_transceiver_ready(transceiver_state, transceiver_type) == 0) diff --git a/drivers/net/qede/base/ecore_mcp_api.h b/drivers/net/qede/base/ecore_mcp_api.h index 8f4efd15f..e8b788146 100644 --- a/drivers/net/qede/base/ecore_mcp_api.h +++ b/drivers/net/qede/base/ecore_mcp_api.h @@ -602,4 +602,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, * @param p_dev - ecore dev pointer * @param p_ptt + * @param p_transceiver_state - transceiver state. * @param p_transceiver_type - media type value * @@ -610,4 +611,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, + u32 *p_transceiver_state, u32 *p_tranceiver_type); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-20 17:53:08.725272421 +0000 +++ 0053-net-qede-base-fix-logic-for-sfp-get-set.patch 2018-11-20 17:53:07.000000000 +0000 @@ -1,12 +1,13 @@ -From 6d1be6d6f8de09ce473fd7c2daa1768125bba647 Mon Sep 17 00:00:00 2001 +From 123956f54fcf9fd43abb2e16f92cfdc4e55abf10 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Sat, 8 Sep 2018 13:30:56 -0700 Subject: [PATCH] net/qede/base: fix logic for sfp get/set +[ upstream commit 6d1be6d6f8de09ce473fd7c2daa1768125bba647 ] + Fix logic for sfp get rx_los, tx_fault, tx_disable, and sfp set tx_disable. Fixes: bdc40630a8eb ("net/qede/base: add APIs for xcvr") -Cc: stable@dpdk.org Signed-off-by: Rasesh Mody --- @@ -15,7 +16,7 @@ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c -index 1b6eb9430..ea71d07d0 100644 +index 49963c691..fdcf6fbbe 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -2202,6 +2202,8 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, @@ -75,16 +76,16 @@ if (is_transceiver_ready(transceiver_state, transceiver_type) == 0) diff --git a/drivers/net/qede/base/ecore_mcp_api.h b/drivers/net/qede/base/ecore_mcp_api.h -index 0103293ed..4098bae3e 100644 +index 8f4efd15f..e8b788146 100644 --- a/drivers/net/qede/base/ecore_mcp_api.h +++ b/drivers/net/qede/base/ecore_mcp_api.h -@@ -608,4 +608,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, +@@ -602,4 +602,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, * @param p_dev - ecore dev pointer * @param p_ptt + * @param p_transceiver_state - transceiver state. * @param p_transceiver_type - media type value * -@@ -616,4 +617,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, +@@ -610,4 +611,5 @@ enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn, enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, + u32 *p_transceiver_state,