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 F28F6A0032 for ; Fri, 18 Feb 2022 13:41:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED79640141; Fri, 18 Feb 2022 13:41:15 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 3531040141 for ; Fri, 18 Feb 2022 13:41:14 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id c192so5157473wma.4 for ; Fri, 18 Feb 2022 04:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TTz0Q47mMuG+9zkCSgrSaYdp4AVK7CiqJD1pdokCr+w=; b=UsIXwWGiybYKQDxThQ/xJAwQiQAskuqieX0IH5Jbgrow+ProMzixfgSkaFQpby7tPC 2HxMfFVShfaTwyGFAKganwGjqcRCgWMG6N8z39BJ3NfJ4RPa++dB3C6VLDB0lex85h1b FA1ypQ8aPlsfBFu0y8JAd2V4b2tQUBMs8Pcwe/s3P4NwOE9m/1X5u6ozAlm81LuWl3p2 bglMbfHE1OtwTRd8iJ0YQ8CEHcE0cVt4xFjLTZhUpz2yx3hTdd7QeUPD2c3iAd8QCAdi D3i8YG57fSMiw6ISnXM/+B5cajDwzqwauL0SDCTU1hPWHb9vFS2Gz9yLJBkQ4r6PgJ0H Vu1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TTz0Q47mMuG+9zkCSgrSaYdp4AVK7CiqJD1pdokCr+w=; b=dOyO3+g8Yb2OKuDVDUHecmwJUP00zrVsDO6lQejKSocyPDKhhBmErczYqslCiPepDm qLuUcqeTZLkU2HKFBMdj3fqTBwXhkA6gC+9w1A760ou2jS7b43dwcnLBsHgXOMUTMy0Q Iso2zaZGn9TfNPkzlaRJpjrBhO+BHKw+nEKGqCMNsfv9kCvjBlywj5DfC1D18IR/BCvd dZCB6hB42GgI86uRaeCGe1Dho+eSdDHweATnoCxHrPNoY0EYhdf7V5vvfEej6gwMvevq SsaJLR03/4qrgT8IUB0VuCTjUOiHhNdhRMBzgCWGLobdf1OOa576oDCv5xNIYOy+0ofY cSXw== X-Gm-Message-State: AOAM530rBLnTDwvhCnSbu5jp+9a2yOjRuRpBOIvqq66B9u6kSc56FC2C xL11izekriBqrhADrZ+TDizIbVK8yuc5auoO X-Google-Smtp-Source: ABdhPJy5GVwpNkgQamWz97P+0TqmhpSxpJ2xoZhQHz8kcXoPKIbLoObPt++oESjVmygEaG90Pfdz9g== X-Received: by 2002:a05:600c:4f93:b0:37b:c4c1:e806 with SMTP id n19-20020a05600c4f9300b0037bc4c1e806mr7326440wmq.104.1645188073911; Fri, 18 Feb 2022 04:41:13 -0800 (PST) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id s2sm1187808wmc.45.2022.02.18.04.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:41:13 -0800 (PST) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Ajit Khaparde , Somnath Kotur , dpdk stable Subject: patch 'net/bnxt: fix handling of VF configuration change' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:00 +0000 Message-Id: <20220218123931.1749595-31-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/766d7701ba0b7e9fc7722d6e8172b91cb83c09d1 Thanks. Luca Boccassi --- >From 766d7701ba0b7e9fc7722d6e8172b91cb83c09d1 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Tue, 4 Jan 2022 14:08:19 +0530 Subject: [PATCH] net/bnxt: fix handling of VF configuration change [ upstream commit 6c63f3495e3563869461ec523d13cbb7fcf67d82 ] 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") 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 | 22 ++++++++++++++++++++++ drivers/net/bnxt/bnxt_ethdev.c | 13 +++++++------ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 5f5bad0f1b..51044d6241 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -1026,6 +1026,9 @@ void bnxt_flow_cnt_alarm_cb(void *arg); int bnxt_flow_stats_req(struct bnxt *bp); int bnxt_flow_stats_cnt(struct bnxt *bp); uint32_t bnxt_get_speed_capabilities(struct bnxt *bp); +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); int bnxt_filter_ctrl_op(struct rte_eth_dev *dev, diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 7bfda01b2c..50c18ee6fc 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -91,6 +91,26 @@ bnxt_process_default_vnic_change(struct bnxt *bp, bnxt_rep_dev_start_op(eth_dev); } +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 */ @@ -118,6 +138,8 @@ void bnxt_handle_async_event(struct bnxt *bp, case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE: PMD_DRV_LOG(INFO, "Async event: VF config changed\n"); 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 cc9cf6c0ea..5fd159e2db 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, return rc; /* MAC Specifics */ - dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); + dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); dev_info->max_hash_mac_addrs = 0; /* PF/VF specifics */ @@ -1432,7 +1432,7 @@ static int bnxt_ptp_start(struct bnxt *bp) } /* 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; struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); @@ -1504,7 +1504,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) return 0; } -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; @@ -1626,6 +1626,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_op(eth_dev); @@ -4781,12 +4782,12 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp) static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; - size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); + size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); int rc = 0; - if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR) + if (bp->max_l2_ctx > ETH_NUM_RECEIVE_MAC_ADDR) PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n", - bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); + bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl", RTE_ETHER_ADDR_LEN * max_mac_addr, -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:39.332922015 +0000 +++ 0031-net-bnxt-fix-handling-of-VF-configuration-change.patch 2022-02-18 12:37:37.610790133 +0000 @@ -1 +1 @@ -From 6c63f3495e3563869461ec523d13cbb7fcf67d82 Mon Sep 17 00:00:00 2001 +From 766d7701ba0b7e9fc7722d6e8172b91cb83c09d1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6c63f3495e3563869461ec523d13cbb7fcf67d82 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -22,3 +23,3 @@ - drivers/net/bnxt/bnxt_cpr.c | 25 ++++++++++++++++++++++++- - drivers/net/bnxt/bnxt_ethdev.c | 5 +++-- - 3 files changed, 30 insertions(+), 3 deletions(-) + drivers/net/bnxt/bnxt_cpr.c | 22 ++++++++++++++++++++++ + drivers/net/bnxt/bnxt_ethdev.c | 13 +++++++------ + 3 files changed, 32 insertions(+), 6 deletions(-) @@ -27 +28 @@ -index 64866de319..9c0dbc6af4 100644 +index 5f5bad0f1b..51044d6241 100644 @@ -30 +31,3 @@ -@@ -1068,5 +1068,8 @@ int bnxt_flow_stats_cnt(struct bnxt *bp); +@@ -1026,6 +1026,9 @@ void bnxt_flow_cnt_alarm_cb(void *arg); + int bnxt_flow_stats_req(struct bnxt *bp); + int bnxt_flow_stats_cnt(struct bnxt *bp); @@ -32,2 +34,0 @@ - int bnxt_flow_ops_get_op(struct rte_eth_dev *dev, - const struct rte_flow_ops **ops); @@ -38 +39,2 @@ - #endif + int + bnxt_filter_ctrl_op(struct rte_eth_dev *dev, @@ -40 +42 @@ -index 593eebfb9a..9b9285b799 100644 +index 7bfda01b2c..50c18ee6fc 100644 @@ -43,2 +45,2 @@ -@@ -107,6 +107,26 @@ static void bnxt_handle_event_error_report(struct bnxt *bp, - } +@@ -91,6 +91,26 @@ bnxt_process_default_vnic_change(struct bnxt *bp, + bnxt_rep_dev_start_op(eth_dev); @@ -70,3 +72 @@ -@@ -138,8 +158,11 @@ void bnxt_handle_async_event(struct bnxt *bp, - PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); - break; +@@ -118,6 +138,8 @@ void bnxt_handle_async_event(struct bnxt *bp, @@ -74,3 +74 @@ -- 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); + PMD_DRV_LOG(INFO, "Async event: VF config changed\n"); @@ -84 +82 @@ -index cf3bd77035..999a9a5103 100644 +index cc9cf6c0ea..5fd159e2db 100644 @@ -87 +85,10 @@ -@@ -1530,7 +1530,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev) +@@ -964,7 +964,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev, + return rc; + + /* MAC Specifics */ +- dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); ++ dev_info->max_mac_addrs = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); + dev_info->max_hash_mac_addrs = 0; + + /* PF/VF specifics */ +@@ -1432,7 +1432,7 @@ static int bnxt_ptp_start(struct bnxt *bp) @@ -95,3 +102,3 @@ - -@@ -1546,7 +1546,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) - return bnxt_dev_stop(eth_dev); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); +@@ -1504,7 +1504,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) + return 0; @@ -105 +112 @@ -@@ -1678,6 +1678,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) +@@ -1626,6 +1626,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) @@ -112 +119,17 @@ - ret = bnxt_dev_stop(eth_dev); + ret = bnxt_dev_stop_op(eth_dev); +@@ -4781,12 +4782,12 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp) + static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev) + { + struct bnxt *bp = eth_dev->data->dev_private; +- size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); ++ size_t max_mac_addr = RTE_MIN(bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); + int rc = 0; + +- if (bp->max_l2_ctx > RTE_ETH_NUM_RECEIVE_MAC_ADDR) ++ if (bp->max_l2_ctx > ETH_NUM_RECEIVE_MAC_ADDR) + PMD_DRV_LOG(INFO, "Max number of MAC addrs supported is %d, but will be limited to %d\n", +- bp->max_l2_ctx, RTE_ETH_NUM_RECEIVE_MAC_ADDR); ++ bp->max_l2_ctx, ETH_NUM_RECEIVE_MAC_ADDR); + + eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl", + RTE_ETHER_ADDR_LEN * max_mac_addr,