From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasesh Mody Subject: [PATCH 49/53] net/qede/base: retain dcbx config till actually applied Date: Mon, 18 Sep 2017 18:51:39 -0700 Message-ID: <1505785903-1741-20-git-send-email-rasesh.mody@cavium.com> References: <1505785903-1741-1-git-send-email-rasesh.mody@cavium.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Rasesh Mody , Dept-EngDPDKDev@cavium.com To: dev@dpdk.org, ferruh.yigit@intel.com Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id EE2BB1B1A6 for ; Tue, 19 Sep 2017 03:52:14 +0200 (CEST) In-Reply-To: <1505785903-1741-1-git-send-email-rasesh.mody@cavium.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Retain user dcbx configurations till the config is applied to the adapter i.e. till the negotiation completes. If base driver receives a config update before negotiation completes, then base driver merges the new config with the cached config and sends it to management FW. Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_dcbx.c | 11 +++-------- drivers/net/qede/base/ecore_mcp.c | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c index 54c61bf..c6274bd 100644 --- a/drivers/net/qede/base/ecore_dcbx.c +++ b/drivers/net/qede/base/ecore_dcbx.c @@ -1220,15 +1220,10 @@ enum _ecore_status_t ecore_dcbx_config_params(struct ecore_hwfn *p_hwfn, u32 resp = 0, param = 0; enum _ecore_status_t rc = ECORE_SUCCESS; - if (!hw_commit) { - OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set, params, - sizeof(p_hwfn->p_dcbx_info->set)); + OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set, params, + sizeof(p_hwfn->p_dcbx_info->set)); + if (!hw_commit) return ECORE_SUCCESS; - } - - /* clear set-parmas cache */ - OSAL_MEMSET(&p_hwfn->p_dcbx_info->set, 0, - sizeof(struct ecore_dcbx_set)); OSAL_MEMSET(&local_admin, 0, sizeof(local_admin)); ecore_dcbx_set_local_params(p_hwfn, &local_admin, params); diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index 8a8670d..06e426a 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -1984,6 +1984,9 @@ enum _ecore_status_t ecore_mcp_handle_events(struct ecore_hwfn *p_hwfn, case MFW_DRV_MSG_DCBX_OPERATIONAL_MIB_UPDATED: ecore_dcbx_mib_update_event(p_hwfn, p_ptt, ECORE_DCBX_OPERATIONAL_MIB); + /* clear the user-config cache */ + OSAL_MEMSET(&p_hwfn->p_dcbx_info->set, 0, + sizeof(struct ecore_dcbx_set)); break; case MFW_DRV_MSG_OEM_CFG_UPDATE: ecore_mcp_handle_ufp_event(p_hwfn, p_ptt); -- 1.7.10.3