From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A616A0527 for ; Wed, 25 Nov 2020 10:03:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6BE0AC96A; Wed, 25 Nov 2020 10:03:26 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by dpdk.org (Postfix) with ESMTP id 6F3A3C95E for ; Wed, 25 Nov 2020 10:03:24 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id u12so1117450wrt.0 for ; Wed, 25 Nov 2020 01:03:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=upZEGQ2aG9BexFP6BGQjF4XHvKy9p5YqbCF37MZVTzk=; b=nKbrwXDNn8bp901LneWRhOsCWhnVFbjmOa24SJpYOnOFolqGfcW5tH+/Bd1XjnzN1J bmEsjE4zo8DaQroEDUAmZlb52DeNuS7ntgiJ5jnMz/zFpRNtWVLwsLN6IhombZcVAIF6 IcYWQ449IMKJ3tGD9na01bmqpCsRXaQ2dxI3lKQs2lmxnKVzDSynhYAP1851AxyqLs8n PekPVCXn0crB4VMYbLyCDdMROFtTJkBA+9sSass9kkKNkebPbv0QDGf0cFLnuEwGuOO2 SsB69zGOwQGazt8RHESTTFVubbQaYmouwEjfnzs2VRCFMi+P8Ds3/3Wg89vhIkVbmWp0 qpBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=upZEGQ2aG9BexFP6BGQjF4XHvKy9p5YqbCF37MZVTzk=; b=WhrlftmOuQTKQrcdSm2OfZephb8oefbh+NJ8yNBNVrnPRjQP1U+mEYuoHO540Ylwum Er/qgGwPs0iDc5Iy92Gfdr/9Qu8sqRRCaMXP+b8rrY0yxyH2AbDEvpNBCghATMeq9+5o MlKL+GoldVf1C5K7/Ew9QBvtHq5LiO8KTrOdm0yVK1K4h//tI3bUcCPveADoYwb4zUA/ 2V1gpDQR27FcaYbiw4XpnhtMds/rW7ANMW8t32iBplS8u6HWfdZTPR4pPI/VAT2qWgL9 yTJpJ0MjtjZuoZ8MbqieCQNCS72WcTd9JoW41HkfU0E5Tkot7LGzcv8sz+j9iDost4wM b5JA== X-Gm-Message-State: AOAM531V/9jlbwVbyS2PltD3OgkZ4Pi2U4b2J3lBJb7DVTOcy9loclAu BFa/NZem7kgV2mWZmcxtSqY= X-Google-Smtp-Source: ABdhPJyivnLQZVcpYo2rWrwi2B8Y2h38yl981DqQ4w+v7FyG9gYdNf9zhdgQGKKDryTtlx8DKL+YgA== X-Received: by 2002:a5d:690c:: with SMTP id t12mr2828537wru.405.1606295003215; Wed, 25 Nov 2020 01:03:23 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 36sm3491604wrf.94.2020.11.25.01.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 01:03:22 -0800 (PST) From: luca.boccassi@gmail.com To: Huisong Li Cc: Lijun Ou , dpdk stable Date: Wed, 25 Nov 2020 09:02:51 +0000 Message-Id: <20201125090258.21457-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201125090258.21457-1-luca.boccassi@gmail.com> References: <20201117111416.1961049-42-luca.boccassi@gmail.com> <20201125090258.21457-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix crash with multi-TC' has been queued to stable release 19.11.6 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 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/26/20. 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/aac4e6358e85bc07029b236d419a9258e358e103 Thanks. Luca Boccassi --- >From aac4e6358e85bc07029b236d419a9258e358e103 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 20 Nov 2020 19:27:33 +0800 Subject: [PATCH] net/hns3: fix crash with multi-TC [ upstream commit 1c359bae182fc64b30fda3777a6c8f8cad7823ab ] The HW and SW DCB configurations need to be updated only after the DCB configuration information changed. But the change of tx/rx queue number is ignored. If user decreases the number of tx queue after configuring multi-TC, the queue mapping information in hns3_tc_queue_info can not be updated. And then accessing the released queue resource in "hns3_init_tx_ring_tc" will trigger a segment fault. Fixes: 62e3ccc2b94c ("net/hns3: support flow control") Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_dcb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c index f7d21ca756..62d8930c15 100644 --- a/drivers/net/hns3/hns3_dcb.c +++ b/drivers/net/hns3/hns3_dcb.c @@ -1258,6 +1258,8 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) { struct rte_eth_dcb_rx_conf *dcb_rx_conf; struct hns3_hw *hw = &hns->hw; + uint16_t nb_rx_q = hw->data->nb_rx_queues; + uint16_t nb_tx_q = hw->data->nb_tx_queues; uint8_t max_tc = 0; uint8_t pfc_en; int i; @@ -1283,6 +1285,10 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) pfc_en = RTE_LEN2MASK((uint8_t)dcb_rx_conf->nb_tcs, uint8_t); if (hw->dcb_info.pfc_en != pfc_en) *changed = true; + + /* tx/rx queue number is reconfigured. */ + if (nb_rx_q != hw->used_rx_queues || nb_tx_q != hw->used_tx_queues) + *changed = true; } static void -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-24 16:50:36.949566441 +0000 +++ 0009-net-hns3-fix-crash-with-multi-TC.patch 2020-11-24 16:50:36.565496231 +0000 @@ -1 +1 @@ -From 1c359bae182fc64b30fda3777a6c8f8cad7823ab Mon Sep 17 00:00:00 2001 +From aac4e6358e85bc07029b236d419a9258e358e103 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1c359bae182fc64b30fda3777a6c8f8cad7823ab ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index ab02c87628..fb501795f0 100644 +index f7d21ca756..62d8930c15 100644 @@ -27 +28 @@ -@@ -1351,6 +1351,8 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) +@@ -1258,6 +1258,8 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) @@ -36 +37 @@ -@@ -1376,6 +1378,10 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) +@@ -1283,6 +1285,10 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed) @@ -46 +47 @@ - static int + static void