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 36ABAA051C for ; Tue, 11 Feb 2020 12:27:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E2352B9C; Tue, 11 Feb 2020 12:27:29 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 0CBC32B9C for ; Tue, 11 Feb 2020 12:27:28 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id a9so3064317wmj.3 for ; Tue, 11 Feb 2020 03:27:28 -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=/IC25V8K8piDv//PrKao/OI+UAQdHUH8lrGL9GxDT/w=; b=JTsh/9ODTDC7gIHS3Ud1hvPG0+ylJlhHxnRtIh73APYkBdK21W+/QVxxZTt+tp4g/E SvbCWIXasVdyx+4IYMs9bot0rNmdrHqRtfv16YqhI4VHAYYdPKMIUnVY3qW8Vmh3ktko 15ki1cJclGMgrDHBEX90L0dA8AdoC0+3ejrh4W+qR12iNKLSgqkaGaNfJxY56X753Vbz UrXwVkiI/DANCpva2ii5qh+uWnsrQUGXv9vsj5jTekJauB/nkWBG6yK/E2kVn8PQYbUQ wBtZ8FW06VOKki1HMttTB4whGfhuRwhVP0uglguj+Gr/NAJEjc+SyXbHmurmp6b8AMZX FWlw== 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=/IC25V8K8piDv//PrKao/OI+UAQdHUH8lrGL9GxDT/w=; b=pMWPE3E1BuKpnMtyApuYw+HtdTRZf5bXUv1tVqVOfg4LjT/p5vUGvWk2IuSStiXzZi is5STwuOWWDJGX+8l7toSTb7AnB724Pw21tsl84vDgcVAbrgImS9p1ESNinwOLOe9kGy vy8mh8WJrBgYGUNr1z4Dsu/jg0abRMJDDtIwIhOxX139YMclxU1fhSYcjBgnA1iJndov kKcPxJNdMFuFavAXc1qRLKV0zI7bxERJiHUuerF+pLkQKAgUTBvDnkPx82JpQoQYivci FwhOEuxsIGO58VPnmemK7DK+LiKQ9elCIhnuuAVZ9OnZYm0esayB3F6IYgZmjlCmx7GJ PgnA== X-Gm-Message-State: APjAAAWo3dcN2d1ezDxz1SpLuwvQ+c6P+QwRC80DZ4Gx/9lsol3QPA+5 ckiW4xJziz/bRhnyg9vulSvZ/GmOkgM= X-Google-Smtp-Source: APXvYqyAZzDeSi0nhY1JnC6a662ou+4Cdmn9pPbs9hi1oOYzQQwTUdkESRNbeSf4xnETYFbmUhADwA== X-Received: by 2002:a1c:5445:: with SMTP id p5mr5079345wmi.75.1581420446747; Tue, 11 Feb 2020 03:27:26 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x6sm5063803wrr.6.2020.02.11.03.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:27:26 -0800 (PST) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Ajit Khaparde , dpdk stable Date: Tue, 11 Feb 2020 11:19:59 +0000 Message-Id: <20200211112216.3929-53-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/bnxt: fix Tx queue profile selection' 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 46007e06afa0f6112fe7c64f95472b94e58ae1d3 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Fri, 20 Dec 2019 18:29:37 -0800 Subject: [PATCH] net/bnxt: fix Tx queue profile selection [ upstream commit 816eacad1116b06581df3ca6b269990d24f63dac ] In the case when CoS classification is disabled, driver was iterating looking for only lossy profiles as that is what is expected to be used for regular NIC operations. But in certain custom profiles, there were no lossy profiles configured, only lossless profiles instead. To handle such cases, it is better to fallback to using the first valid profile. Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue") Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 44 +++++++++++++++++++++++++++++------- drivers/net/bnxt/bnxt_hwrm.h | 3 +++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 6b8ebbe5b8..7628ae9402 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1216,6 +1216,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, return rc; } +static bool bnxt_find_lossy_profile(struct bnxt *bp) +{ + int i = 0; + + for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) { + if (bp->tx_cos_queue[i].profile == + HWRM_QUEUE_SERVICE_PROFILE_LOSSY) { + bp->tx_cosq_id[0] = bp->tx_cos_queue[i].id; + return true; + } + } + return false; +} + +static void bnxt_find_first_valid_profile(struct bnxt *bp) +{ + int i = 0; + + for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) { + if (bp->tx_cos_queue[i].profile != + HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN && + bp->tx_cos_queue[i].id != + HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN) { + bp->tx_cosq_id[0] = bp->tx_cos_queue[i].id; + break; + } + } +} + int bnxt_hwrm_queue_qportcfg(struct bnxt *bp) { int rc = 0; @@ -1275,14 +1304,13 @@ get_rx_info: bp->tx_cos_queue[i].id; } } else { - for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) { - if (bp->tx_cos_queue[i].profile == - HWRM_QUEUE_SERVICE_PROFILE_LOSSY) { - bp->tx_cosq_id[0] = - bp->tx_cos_queue[i].id; - break; - } - } + /* When CoS classification is disabled, for normal NIC + * operations, ideally we should look to use LOSSY. + * If not found, fallback to the first valid profile + */ + if (!bnxt_find_lossy_profile(bp)) + bnxt_find_first_valid_profile(bp); + } } diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index abe5de9db6..d8d1360f91 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -35,6 +35,9 @@ struct bnxt_cp_ring_info; #define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \ HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY +#define HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN \ + HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN + #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MINIMAL_STATIC \ HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MAXIMAL \ -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:40.921961807 +0000 +++ 0053-net-bnxt-fix-Tx-queue-profile-selection.patch 2020-02-11 11:17:38.424001795 +0000 @@ -1,8 +1,10 @@ -From 816eacad1116b06581df3ca6b269990d24f63dac Mon Sep 17 00:00:00 2001 +From 46007e06afa0f6112fe7c64f95472b94e58ae1d3 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Fri, 20 Dec 2019 18:29:37 -0800 Subject: [PATCH] net/bnxt: fix Tx queue profile selection +[ upstream commit 816eacad1116b06581df3ca6b269990d24f63dac ] + In the case when CoS classification is disabled, driver was iterating looking for only lossy profiles as that is what is expected to be used for regular NIC operations. But in certain custom profiles, there were @@ -11,7 +13,6 @@ profile. Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue") -Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde @@ -21,10 +22,10 @@ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index d0dcd561c1..bee4c154fd 100644 +index 6b8ebbe5b8..7628ae9402 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c -@@ -1210,6 +1210,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, +@@ -1216,6 +1216,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, return rc; } @@ -60,7 +61,7 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt *bp) { int rc = 0; -@@ -1269,14 +1298,13 @@ get_rx_info: +@@ -1275,14 +1304,13 @@ get_rx_info: bp->tx_cos_queue[i].id; } } else {