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 95DCDA0527 for ; Mon, 9 Nov 2020 19:45:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 820D27CAE; Mon, 9 Nov 2020 19:45:31 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 3D0E872E9 for ; Mon, 9 Nov 2020 19:45:30 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id p1so9864605wrf.12 for ; Mon, 09 Nov 2020 10:45:30 -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=nAMIFEYDnJo1LRgoV6Bqv5DilK8lAAQAN40s0lS+Lk8=; b=N+eq/9n8JeH94mBZANjrmbRzRKsPVi+C8JjzgDkTYWktrCCbgUVCWCTtL0iNuOWG3n NmO0BEKzYYTbSSMmSrQ3MG9APy+FfId9OcSxOnyeTCCxsFR11JzvTJIlrD97Bgf46sjA qBCYjnlKWXOBupOg+QApcVwrVpUDwL42UxRLdnlDso3q4qecjDR3jdkadO8pdOoeug6C eSmkrfoOth6xxFLooNr2qX0eZoD2l2s6RlgtUC5/4buNVKtIRtlNoE9rspNMW2J4Pu1F jBNrVY22FlA6GgjdA0B0pnz2OGjjZUT+o6CmmmquHsy3CzgYGsFfea0tCImwQ36rLxDr Mzig== 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=nAMIFEYDnJo1LRgoV6Bqv5DilK8lAAQAN40s0lS+Lk8=; b=mcjPBHC4GG0XMnDtQEcVTb+en1bAQJEmXfYooy2FUjtJRiQwYS7/8fgSDZJfecR66O wWUQVsZ2AwHOmCqOCIr63r3S9Yyz9EOdlh8bd1qOWMrToQGPtvD+iQWBe1Kq23W1htt1 F9vuoI591opzGGoyBC0XNd7t+aOgnLHoOjhpkRECvJkpp8l2yf0ZZGzcjKcjUFzllBFG JHpnnIZk8OV3Nph1XdFN+Y25rp2SwI9BVYZ7vESCSlfZC9lIMHXAqS74V9N6LO1nAZrr GjSkivRJln/fgo1LSjUfok7hJQzIW6wm5d7eiH/W33T2BQpkTJ27dzZ1a8CyyD+1UWLM 3GJw== X-Gm-Message-State: AOAM530f/IwVkv+568XDfYlipXpvmwx+bjNfB13S5kK3cLCOM+6cOyYd wI1I2fw/LWiQCRK0Jz9OwAc= X-Google-Smtp-Source: ABdhPJzVLB+Vo5qgfc1qPQqclUdQlC9kl38p3pETrU+KFjcG6CbXD/3EB+Z6/YLdwh83ocXtcLJXsg== X-Received: by 2002:adf:8465:: with SMTP id 92mr18572991wrf.50.1604947528978; Mon, 09 Nov 2020 10:45:28 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id m22sm14911959wrb.97.2020.11.09.10.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:45:28 -0800 (PST) From: luca.boccassi@gmail.com To: Huisong Li Cc: Lijun Ou , dpdk stable Date: Mon, 9 Nov 2020 18:41:03 +0000 Message-Id: <20201109184111.3463090-75-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201109184111.3463090-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-207-luca.boccassi@gmail.com> <20201109184111.3463090-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix configurations of port-level scheduling rate' 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/11/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/3f359e8ca94f8a552a1d412b4d088ac14bd6fe66 Thanks. Luca Boccassi --- >From 3f359e8ca94f8a552a1d412b4d088ac14bd6fe66 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Mon, 2 Nov 2020 22:38:16 +0800 Subject: [PATCH] net/hns3: fix configurations of port-level scheduling rate [ upstream commit d55f3d9c1a463098142c89e4dcf4d2291833b1c0 ] Scheduling rate of port-level in hns3 PF driver configured to hardware is obtained from firmware, which determines the bandwidth capability of the port. The rate in firmware is generally configured with the maximum value for network engine supporting multiple rates, such as 10G and 25G. It may cause the following issues: 1) When a 10G optical module is used on the network engine, scheduling rate of this port will also be configured to hardware with 25G. However, the MAC rate of this port is 10G. In this case, it is unreasonable that the port scheduling rate is different from the MAC rate. 2) If default speed in firmware is not the maximum value, the 25G port may not reach the capability of the port. Therefore, we fix configurations of port-level scheduling rate according to updating of MAC link speed. Fixes: 59fad0f32135 ("net/hns3: support link update operation") Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_dcb.c | 2 +- drivers/net/hns3/hns3_dcb.h | 1 + drivers/net/hns3/hns3_ethdev.c | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c index 8688de2a73..f7d21ca756 100644 --- a/drivers/net/hns3/hns3_dcb.c +++ b/drivers/net/hns3/hns3_dcb.c @@ -337,7 +337,7 @@ hns3_dcb_get_shapping_para(uint8_t ir_b, uint8_t ir_u, uint8_t ir_s, return shapping_para; } -static int +int hns3_dcb_port_shaper_cfg(struct hns3_hw *hw) { struct hns3_port_shapping_cmd *shap_cfg_cmd; diff --git a/drivers/net/hns3/hns3_dcb.h b/drivers/net/hns3/hns3_dcb.h index 1d6fe5dfdf..fe67d3a466 100644 --- a/drivers/net/hns3/hns3_dcb.h +++ b/drivers/net/hns3/hns3_dcb.h @@ -174,5 +174,6 @@ void hns3_set_rss_size(struct hns3_hw *hw, uint16_t nb_rx_q); void hns3_tc_queue_mapping_cfg(struct hns3_hw *hw, uint16_t nb_queue); int hns3_dcb_cfg_update(struct hns3_adapter *hns); +int hns3_dcb_port_shaper_cfg(struct hns3_hw *hw); #endif /* _HNS3_DCB_H_ */ diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index af43a4473c..f2702e0c5e 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -4054,6 +4054,7 @@ static int hns3_cfg_mac_speed_dup(struct hns3_hw *hw, uint32_t speed, uint8_t duplex) { struct hns3_mac *mac = &hw->mac; + uint32_t cur_speed = mac->link_speed; int ret; duplex = hns3_check_speed_dup(duplex, speed); @@ -4065,6 +4066,13 @@ hns3_cfg_mac_speed_dup(struct hns3_hw *hw, uint32_t speed, uint8_t duplex) return ret; mac->link_speed = speed; + ret = hns3_dcb_port_shaper_cfg(hw); + if (ret) { + hns3_err(hw, "failed to configure port shaper, ret = %d.", ret); + mac->link_speed = cur_speed; + return ret; + } + mac->link_duplex = duplex; return 0; -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-09 18:40:13.957320580 +0000 +++ 0075-net-hns3-fix-configurations-of-port-level-scheduling.patch 2020-11-09 18:40:11.223312714 +0000 @@ -1 +1 @@ -From d55f3d9c1a463098142c89e4dcf4d2291833b1c0 Mon Sep 17 00:00:00 2001 +From 3f359e8ca94f8a552a1d412b4d088ac14bd6fe66 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d55f3d9c1a463098142c89e4dcf4d2291833b1c0 ] + @@ -24 +25,0 @@ -Cc: stable@dpdk.org @@ -35 +36 @@ -index 27ae01423b..ae8d8268d2 100644 +index 8688de2a73..f7d21ca756 100644 @@ -38 +39 @@ -@@ -336,7 +336,7 @@ hns3_dcb_get_shapping_para(uint8_t ir_b, uint8_t ir_u, uint8_t ir_s, +@@ -337,7 +337,7 @@ hns3_dcb_get_shapping_para(uint8_t ir_b, uint8_t ir_u, uint8_t ir_s, @@ -48 +49 @@ -index 39ff332675..7ab90933f3 100644 +index 1d6fe5dfdf..fe67d3a466 100644 @@ -51,2 +52,2 @@ -@@ -204,5 +204,6 @@ int hns3_queue_to_tc_mapping(struct hns3_hw *hw, uint16_t nb_rx_q, - uint16_t nb_tx_q); +@@ -174,5 +174,6 @@ void hns3_set_rss_size(struct hns3_hw *hw, uint16_t nb_rx_q); + void hns3_tc_queue_mapping_cfg(struct hns3_hw *hw, uint16_t nb_queue); @@ -59 +60 @@ -index 6b4be769bf..1e382f12a5 100644 +index af43a4473c..f2702e0c5e 100644 @@ -62 +63 @@ -@@ -4332,6 +4332,7 @@ static int +@@ -4054,6 +4054,7 @@ static int @@ -70 +71 @@ -@@ -4343,6 +4344,13 @@ hns3_cfg_mac_speed_dup(struct hns3_hw *hw, uint32_t speed, uint8_t duplex) +@@ -4065,6 +4066,13 @@ hns3_cfg_mac_speed_dup(struct hns3_hw *hw, uint32_t speed, uint8_t duplex)