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 17F9DA0C4C for ; Mon, 12 Jul 2021 15:08:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F4F64069D; Mon, 12 Jul 2021 15:08:45 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id BCD484069D for ; Mon, 12 Jul 2021 15:08:43 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id l6so3086423wmq.0 for ; Mon, 12 Jul 2021 06:08:43 -0700 (PDT) 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=7q1u0at+dpgfuC9uAtBOO/empfQM7ZugzqaG61WPXhA=; b=uhbCAaJRIM51fNbDCycwuOVSVq/9EKOhlLNK01MEJDw5EXoBvkcSxyPRJZGbWPejDl qOrz88ft7FgtIB+Oj1Z9PJJqT9IPCQ+4WBr9Ak9N6XEkT9W2oiLIZ7NzgF21xRYXDsQj Th5CBgneFOBuOHBWGZVfCV7MIMuNQSCA87qsAA3oSTRV+m2WyJ/kHdO+d8KePOgP2j5g 2sXfW4GhPUqqSUc+g30pdMsqyugSvUxpsSD2CLi4jJIghvSTqmz7oL6KsxeBfSaNzHWv N8mqDUo5yDVyTH+r/cxwOPko2wXoP3TdSxpSDveRP+X/cTiBEyZfX+NyMcQwsn2Zp4cs sSvQ== 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=7q1u0at+dpgfuC9uAtBOO/empfQM7ZugzqaG61WPXhA=; b=BOg+3kDA6WIk1qyagtEvSVFEAkAH5dImHKHIv1dmSCv6U9KRCqJZ04pfZJgigz95eA wEWqawB6LZlHYYrcYwui+Iz4J7F9trcN3xpneNFk2URkewgbhKq7Y+TG19fgOhh/zCFv 9xEqu4bW/Qalt2ScovY4qFlM/wyJoj5qIiTp4pHoiY1tmUFaEcGO4ibggyb2YgymwAly 2hPLVv1IUTwYKOJylenaVFLQMu9B/uT1K7M+dF6L8TtSeUNuuevJxPOOSUr51PUurlF+ Q68kDIsHEeat3vr5zdr0utmIJAyLYpP51W8oU3bogoQhQU2UtkZ0XxzQRlnPvBapcqTl Mdiw== X-Gm-Message-State: AOAM533ihJSkZhdOqoTGqgDXo1kCE7Y5WLGQrKmTdIFN13Ym4zWuN3vs vUsKqeYM2tOxNkyS4qPC09U= X-Google-Smtp-Source: ABdhPJze+9nH4GAkYv/see9pVVDidDlutIsIEYIiOyYCD8bt8D35jDXSrBnk0v+4s3uZB28bMYGvaw== X-Received: by 2002:a7b:ca50:: with SMTP id m16mr14365029wml.140.1626095323532; Mon, 12 Jul 2021 06:08:43 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id n13sm12442753wms.4.2021.07.12.06.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:08:36 -0700 (PDT) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , Venkat Duvvuru , dpdk stable Date: Mon, 12 Jul 2021 14:04:03 +0100 Message-Id: <20210712130551.2462159-8-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix error messages in VNIC prepare' has been queued to stable release 20.11.3 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. 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/78f6a49fd49c6aab2a575f77462c14db778dca1f Thanks. Luca Boccassi --- >From 78f6a49fd49c6aab2a575f77462c14db778dca1f Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Mon, 31 May 2021 12:56:36 +0530 Subject: [PATCH] net/bnxt: fix error messages in VNIC prepare [ upstream commit 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 ] The bnxt_vnic_prep() can fail due to multiple reasons. But when bnxt_vnic_prep() fails, PMD is not returning the actual error/string to the application. Fix it by moving the "rte_flow_error_set" to bnxt_vnic_prep() to set the actual error code. Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde Reviewed-by: Venkat Duvvuru --- drivers/net/bnxt/bnxt_flow.c | 66 ++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 11034b6719..1c46cdd1ab 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -919,32 +919,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, return l2_filter; } -static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic) +static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, + const struct rte_flow_action *act, + struct rte_flow_error *error) { struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; uint64_t rx_offloads = dev_conf->rxmode.offloads; int rc; if (bp->nr_vnics > bp->max_vnics - 1) - return -ENOMEM; + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ATTR_GROUP, + NULL, + "Group id is invalid"); rc = bnxt_vnic_grp_alloc(bp, vnic); if (rc) - goto ret; + return rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC group"); rc = bnxt_hwrm_vnic_alloc(bp, vnic); if (rc) { - PMD_DRV_LOG(ERR, "HWRM vnic alloc failure rc: %x\n", rc); + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC"); goto ret; } + bp->nr_vnics++; /* RSS context is required only when there is more than one RSS ring */ if (vnic->rx_queue_cnt > 1) { rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0 /* ctx_idx 0 */); if (rc) { - PMD_DRV_LOG(ERR, - "HWRM vnic ctx alloc failure: %x\n", rc); + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC context"); goto ret; } } else { @@ -957,10 +971,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic) vnic->vlan_strip = false; rc = bnxt_hwrm_vnic_cfg(bp, vnic); - if (rc) + if (rc) { + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to configure VNIC"); goto ret; + } - bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); + rc = bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); + if (rc) { + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to configure VNIC plcmode"); + goto ret; + } + + return 0; ret: return rc; @@ -1135,16 +1163,9 @@ start: PMD_DRV_LOG(DEBUG, "VNIC found\n"); - rc = bnxt_vnic_prep(bp, vnic); - if (rc) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "VNIC prep fail"); - rc = -rte_errno; + rc = bnxt_vnic_prep(bp, vnic, act, error); + if (rc) goto ret; - } PMD_DRV_LOG(DEBUG, "vnic[%d] = %p vnic->fw_grp_ids = %p\n", @@ -1355,16 +1376,9 @@ use_vnic: vnic->end_grp_id = rss->queue[rss->queue_num - 1]; vnic->func_default = 0; //This is not a default VNIC. - rc = bnxt_vnic_prep(bp, vnic); - if (rc) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "VNIC prep fail"); - rc = -rte_errno; + rc = bnxt_vnic_prep(bp, vnic, act, error); + if (rc) goto ret; - } PMD_DRV_LOG(DEBUG, "vnic[%d] = %p vnic->fw_grp_ids = %p\n", -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.304785697 +0100 +++ 0008-net-bnxt-fix-error-messages-in-VNIC-prepare.patch 2021-07-12 13:41:36.182116194 +0100 @@ -1 +1 @@ -From 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 Mon Sep 17 00:00:00 2001 +From 78f6a49fd49c6aab2a575f77462c14db778dca1f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 73fd24cd9a..66012b8057 100644 +index 11034b6719..1c46cdd1ab 100644 @@ -108 +109 @@ -@@ -1142,16 +1170,9 @@ start: +@@ -1135,16 +1163,9 @@ start: @@ -127 +128 @@ -@@ -1362,16 +1383,9 @@ skip_vnic_alloc: +@@ -1355,16 +1376,9 @@ use_vnic: