From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3508DA00C5; Tue, 4 Jan 2022 09:20:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A10D411DD; Tue, 4 Jan 2022 09:19:33 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 9651C410D5 for ; Tue, 4 Jan 2022 09:19:31 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id E7829C0000F2; Tue, 4 Jan 2022 00:19:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com E7829C0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1641284371; bh=GkBFWY9PPzkUL/iVlG4D+nZdTJtzQgbj8zDgh8iDGAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6WtoN7SnJnX6+C/VT0bL83eatsDUdNcM/e8rx/VS7EVf7s2khOpK6GUUyWieUlC3 necaT+KPVdRpGOxHCvOyGMuAfPSuXHUBCB9M0re9uIOB7N4AdU75miR1l1mLoiqGN/ Dov25LQOWfuAUTIN01PnkXjZQaVEtUOW/34uz68w= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 13/18] net/bnxt: fix handling of VF configuration changes Date: Tue, 4 Jan 2022 14:08:19 +0530 Message-Id: <20220104083824.23001-14-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com> References: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Kalesh AP When there is a change in the default VLAN of the VF, FW sends the VF_CFG_CHANGE async event to the driver. Upon receiving this async event, driver currently only queries the FW using HWRM_FUNC_QCFG. But this is not enough. Driver has to clean up the existing filter and recreate filters so the FW can apply the default VLAN to the filter. Fixes: 12213821a8a3 ("net/bnxt: register for more async events") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 3 +++ drivers/net/bnxt/bnxt_cpr.c | 25 ++++++++++++++++++++++++- drivers/net/bnxt/bnxt_ethdev.c | 5 +++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 64866de..9c0dbc6 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -1068,5 +1068,8 @@ int bnxt_flow_stats_cnt(struct bnxt *bp); uint32_t bnxt_get_speed_capabilities(struct bnxt *bp); int bnxt_flow_ops_get_op(struct rte_eth_dev *dev, const struct rte_flow_ops **ops); +int bnxt_dev_start_op(struct rte_eth_dev *eth_dev); +int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev); +void bnxt_handle_vf_cfg_change(void *arg); #endif diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 593eebf..9b9285b 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -107,6 +107,26 @@ static void bnxt_handle_event_error_report(struct bnxt *bp, } } +void bnxt_handle_vf_cfg_change(void *arg) +{ + struct bnxt *bp = arg; + struct rte_eth_dev *eth_dev = bp->eth_dev; + int rc; + + /* Free and recreate filters with default VLAN */ + if (eth_dev->data->dev_started) { + rc = bnxt_dev_stop_op(eth_dev); + if (rc != 0) { + PMD_DRV_LOG(ERR, "Failed to stop Port:%u\n", eth_dev->data->port_id); + return; + } + + rc = bnxt_dev_start_op(eth_dev); + if (rc != 0) + PMD_DRV_LOG(ERR, "Failed to start Port:%u\n", eth_dev->data->port_id); + } +} + /* * Async event handling */ @@ -138,8 +158,11 @@ void bnxt_handle_async_event(struct bnxt *bp, PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE: - PMD_DRV_LOG(INFO, "Async event: VF config changed\n"); + PMD_DRV_LOG(INFO, "Port %u: VF config change async event\n", port_id); + PMD_DRV_LOG(INFO, "event: data1 %#x data2 %#x\n", data1, data2); bnxt_hwrm_func_qcfg(bp, NULL); + if (BNXT_VF(bp)) + rte_eal_alarm_set(1, bnxt_handle_vf_cfg_change, (void *)bp); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED: PMD_DRV_LOG(INFO, "Port conn async event\n"); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index cf3bd77..999a9a5 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1530,7 +1530,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev) } /* Unload the driver, release resources */ -static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) +int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; @@ -1546,7 +1546,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) return bnxt_dev_stop(eth_dev); } -static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) +int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads; @@ -1678,6 +1678,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp); rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp); bnxt_cancel_fc_thread(bp); + rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp); if (eth_dev->data->dev_started) ret = bnxt_dev_stop(eth_dev); -- 2.10.1