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 1A516A051C for ; Tue, 11 Feb 2020 12:28:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 125C41BF87; Tue, 11 Feb 2020 12:28:35 +0100 (CET) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 60DA81BF87 for ; Tue, 11 Feb 2020 12:28:34 +0100 (CET) Received: by mail-wm1-f65.google.com with SMTP id p9so3038511wmc.2 for ; Tue, 11 Feb 2020 03:28:34 -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=Dv+EMpKfSQquXkRfq7CaH8eN2Hvp7e10pOQ4rUBA1yw=; b=EDmp9MxYfolRKn4NHgib1qJbSW2wT8tCsC2RDTfzNS2yPzQGY3t4M4FdCaRQx8epe9 bsjaY6BfbsXudYLIp0E+Caed3S0oZqI60OPDSVoofjPU+O4V0PrDQf4Fqw69sDtaVQMZ YIdDlX7MeOhFpcpS0+U1CmIOuDrhLDUG87Bru9df7vP0YeVS2s8pPqoA+6XuqGMSYcK2 NjMRcDQejoorEv2ucJL6abGzQH0bL62CAf6p40HzSjuBC/z7o6oFjXYaW6dBoPQqu+jn WVYhPZiZnhV1CBcBVmwcvZqY9sG/AenLMuq+isUmNxlSEgopryIgu7i2gSsbGLfusCBq wvgg== 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=Dv+EMpKfSQquXkRfq7CaH8eN2Hvp7e10pOQ4rUBA1yw=; b=NQ5zmeA2pPY/MWY/H4lmEQDs9GJ9SW2L7VAAfeJtqzzXAW6gVtW4dMTm1MPGfsKt1+ K2VzZ55fyRX3oP/BMaT2qCvu37kMqqnEhH8dxuXuievLHda3SVFGR0yVBISPDI6/7eYI XBlLdUEC353/79PuIYdQi+Bi3azZhS5J23j06Rx/PV0XRrIuHvTq6Am8/iTMzDH2jl1G 3Vg7QdQX1foIXQ3LbHe4Y/2NDDXJnaWCR7OTxGUcJDGq6NUZeqwG0XKt0sI+gm1k1qDX CHFSb7Uar9f2oxws4V3euxXpurnC4Zsvp0k8h3CT382TVOLve7y4U49m5tq8h08z3gfW X7oA== X-Gm-Message-State: APjAAAVGGvcxq4ZicXZLDlJxlgy3DnibJmSpycpyVptJjBjJek2D79ot AhvDyaBnGNEsyuB6D82hhEWTgM26FwU= X-Google-Smtp-Source: APXvYqwvBUGxcUNzgoOIivLddWQ/rP8G0Vd7qVIetqWFJXqLDchUD3ebcqa00bCiiZqXSSgjLGQ1kw== X-Received: by 2002:a1c:4d18:: with SMTP id o24mr5061185wmh.35.1581420514095; Tue, 11 Feb 2020 03:28:34 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b67sm3446449wmc.38.2020.02.11.03.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:28:33 -0800 (PST) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Chengwen Feng , dpdk stable Date: Tue, 11 Feb 2020 11:20:24 +0000 Message-Id: <20200211112216.3929-78-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix Rx queue search with broadcast packet' has been queued to stable release 19.11.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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.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 02/13/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. Thanks. Luca Boccassi --- >From ad6ed6fc9132dbae9dae6ed1ce8ed8b744e1e281 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 9 Jan 2020 11:15:54 +0800 Subject: [PATCH] net/hns3: fix Rx queue search with broadcast packet [ upstream commit a45fd0aa0ea1aaefcff21482940d7fbab01f135a ] Currently, there is a certain probability of a type of RAS errors when receiving broadcast packets. This type of RAS errors are parsed as rx_q_search_miss error by hns3 PF PMD driver, the related log as below: 0000:bd:00.0 hns3_find_highest_level(): PPP_MFP_ABNORMAL_INT_ST2 rx_q_search_miss found [error status=0x20000000] When receiving broadcast packet, network engine select which functions need to accept it according to the function's promisc_bcast_en bit configuration. And then search TQP_MAP configuration to select which hardware queues the packet should enter, if can't find the target hardware queue, network engine will trigger rx_q_search_miss RAS error. The root cause as below: 1. VF's promisc_bcast_en bit configuration is not cleared by FLR reset, and the configuration has been set in the previous application. 2. There is one bug in setting TQP_MAP configuration in the initialization of PF device: when tqp is allocated to VF, it is still marked as PF. This issue will affect the correctness of the TQP_MAP configuration. This patch fixes it with the following modification. 1. Clear all VFs promisc_bcast_en bit in the initialization of PF device. 2. Fix the issue to ensure the correct TQP_MAP configuration. Fixes: d51867db65c1 ("net/hns3: add initialization") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_ethdev.c | 32 +++++++++++++++++++++++++++++++- drivers/net/hns3/hns3_ethdev.h | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 72315718a8..a85196cfb9 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2358,6 +2358,7 @@ hns3_query_pf_resource(struct hns3_hw *hw) hw->total_tqps_num = rte_le_to_cpu_16(req->tqp_num); pf->pkt_buf_size = rte_le_to_cpu_16(req->buf_size) << HNS3_BUF_UNIT_S; hw->tqps_num = RTE_MIN(hw->total_tqps_num, HNS3_MAX_TQP_NUM_PER_FUNC); + pf->func_num = rte_le_to_cpu_16(req->pf_own_fun_number); if (req->tx_buf_size) pf->tx_buf_size = @@ -2634,6 +2635,7 @@ hns3_map_tqp(struct hns3_hw *hw) uint16_t tqps_num = hw->total_tqps_num; uint16_t func_id; uint16_t tqp_id; + bool is_pf; int num; int ret; int i; @@ -2645,10 +2647,11 @@ hns3_map_tqp(struct hns3_hw *hw) tqp_id = 0; num = DIV_ROUND_UP(hw->total_tqps_num, HNS3_MAX_TQP_NUM_PER_FUNC); for (func_id = 0; func_id < num; func_id++) { + is_pf = func_id == 0 ? true : false; for (i = 0; i < HNS3_MAX_TQP_NUM_PER_FUNC && tqp_id < tqps_num; i++) { ret = hns3_map_tqps_to_func(hw, func_id, tqp_id++, i, - true); + is_pf); if (ret) return ret; } @@ -3549,6 +3552,26 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc) return 0; } +static int +hns3_clear_all_vfs_promisc_mode(struct hns3_hw *hw) +{ + struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); + struct hns3_pf *pf = &hns->pf; + struct hns3_promisc_param param; + uint16_t func_id; + int ret; + + /* func_id 0 is denoted PF, the VFs start from 1 */ + for (func_id = 1; func_id < pf->func_num; func_id++) { + hns3_promisc_param_init(¶m, false, false, false, func_id); + ret = hns3_cmd_set_promisc_mode(hw, ¶m); + if (ret) + return ret; + } + + return 0; +} + static int hns3_dev_promiscuous_enable(struct rte_eth_dev *dev) { @@ -3834,6 +3857,13 @@ hns3_init_hardware(struct hns3_adapter *hns) goto err_mac_init; } + ret = hns3_clear_all_vfs_promisc_mode(hw); + if (ret) { + PMD_INIT_LOG(ERR, "Failed to clear all vfs promisc mode: %d", + ret); + goto err_mac_init; + } + ret = hns3_init_vlan_config(hns); if (ret) { PMD_INIT_LOG(ERR, "Failed to init vlan: %d", ret); diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index e9a3fe4107..975680ea21 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -453,6 +453,7 @@ struct hns3_mp_param { struct hns3_pf { struct hns3_adapter *adapter; bool is_main_pf; + uint16_t func_num; /* num functions of this pf, include pf and vfs */ uint32_t pkt_buf_size; /* Total pf buf size for tx/rx */ uint32_t tx_buf_size; /* Tx buffer size for each TC */ -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:41.687302439 +0000 +++ 0078-net-hns3-fix-Rx-queue-search-with-broadcast-packet.patch 2020-02-11 11:17:38.508003367 +0000 @@ -1,8 +1,10 @@ -From a45fd0aa0ea1aaefcff21482940d7fbab01f135a Mon Sep 17 00:00:00 2001 +From ad6ed6fc9132dbae9dae6ed1ce8ed8b744e1e281 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 9 Jan 2020 11:15:54 +0800 Subject: [PATCH] net/hns3: fix Rx queue search with broadcast packet +[ upstream commit a45fd0aa0ea1aaefcff21482940d7fbab01f135a ] + Currently, there is a certain probability of a type of RAS errors when receiving broadcast packets. This type of RAS errors are parsed as rx_q_search_miss error by hns3 PF PMD driver, the related log as below: @@ -29,7 +31,6 @@ 2. Fix the issue to ensure the correct TQP_MAP configuration. Fixes: d51867db65c1 ("net/hns3: add initialization") -Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) @@ -39,10 +40,10 @@ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c -index 800fa47cc4..ca87180007 100644 +index 72315718a8..a85196cfb9 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c -@@ -2408,6 +2408,7 @@ hns3_query_pf_resource(struct hns3_hw *hw) +@@ -2358,6 +2358,7 @@ hns3_query_pf_resource(struct hns3_hw *hw) hw->total_tqps_num = rte_le_to_cpu_16(req->tqp_num); pf->pkt_buf_size = rte_le_to_cpu_16(req->buf_size) << HNS3_BUF_UNIT_S; hw->tqps_num = RTE_MIN(hw->total_tqps_num, HNS3_MAX_TQP_NUM_PER_FUNC); @@ -50,7 +51,7 @@ if (req->tx_buf_size) pf->tx_buf_size = -@@ -2684,6 +2685,7 @@ hns3_map_tqp(struct hns3_hw *hw) +@@ -2634,6 +2635,7 @@ hns3_map_tqp(struct hns3_hw *hw) uint16_t tqps_num = hw->total_tqps_num; uint16_t func_id; uint16_t tqp_id; @@ -58,7 +59,7 @@ int num; int ret; int i; -@@ -2695,10 +2697,11 @@ hns3_map_tqp(struct hns3_hw *hw) +@@ -2645,10 +2647,11 @@ hns3_map_tqp(struct hns3_hw *hw) tqp_id = 0; num = DIV_ROUND_UP(hw->total_tqps_num, HNS3_MAX_TQP_NUM_PER_FUNC); for (func_id = 0; func_id < num; func_id++) { @@ -71,7 +72,7 @@ if (ret) return ret; } -@@ -3599,6 +3602,26 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc) +@@ -3549,6 +3552,26 @@ hns3_set_promisc_mode(struct hns3_hw *hw, bool en_uc_pmc, bool en_mc_pmc) return 0; } @@ -98,7 +99,7 @@ static int hns3_dev_promiscuous_enable(struct rte_eth_dev *dev) { -@@ -3886,6 +3909,13 @@ hns3_init_hardware(struct hns3_adapter *hns) +@@ -3834,6 +3857,13 @@ hns3_init_hardware(struct hns3_adapter *hns) goto err_mac_init; } @@ -113,10 +114,10 @@ if (ret) { PMD_INIT_LOG(ERR, "Failed to init vlan: %d", ret); diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h -index 2aa4c3cd76..d4a03065f8 100644 +index e9a3fe4107..975680ea21 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h -@@ -464,6 +464,7 @@ struct hns3_mp_param { +@@ -453,6 +453,7 @@ struct hns3_mp_param { struct hns3_pf { struct hns3_adapter *adapter; bool is_main_pf;