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 0B36BA0C47 for ; Tue, 10 Aug 2021 17:40:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 053AD4014F; Tue, 10 Aug 2021 17:40:39 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id 26293411C7 for ; Tue, 10 Aug 2021 17:40:37 +0200 (CEST) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 092013F107 for ; Tue, 10 Aug 2021 15:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610037; bh=WSoeiKKYB5F4isoLgwVbosDdBKQrcPrRoNIMwNd9+LA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lOdaS8U2f+HnONDcTdSwXRngat/2ugQOO/JFRDF6MmwNr+38iHtI67Qy0uxNDGBF3 oUIwtMLwUlzEYtISgJfrVgYDiucamqPjQOn7GNu21pSh81zFptBqZiZF99PoBbvSz9 8UyL+mz4ErYAUR1O34hvTs65BdIPci7mcNGogGPtMhwLCudpd1MIsm1y8y0mG9I7MS 0ywyHcn9DvlgtZ5+/Em8aBvqCrlCtOpgRfHlZHZQ2Nabe9mtSBu20C2ZBFlSwfWwGk 07bAwlzpHkkn4dfuE01FrOEGqUmIKKEMpELOm/o2AU58f4TRF0GL3TcokjXejijTBz qPJm07xHd5kNA== Received: by mail-ej1-f69.google.com with SMTP id e1-20020a170906c001b02905b53c2f6542so894744ejz.7 for ; Tue, 10 Aug 2021 08:40:37 -0700 (PDT) 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=WSoeiKKYB5F4isoLgwVbosDdBKQrcPrRoNIMwNd9+LA=; b=QQKnOI4pF6lKS7JPltJbiHULxWRolWCjRnAdTgytdYjA+u4UDsHmgMw7X1mDXmPLHd 3ab0zW3Dx5tlR7Qn5toJVIoWoIj0tddKOD6TxHhw5uQdkINWcdKLpOHn9S+uIrl72bCY vThaOrmud0+wW5/2VLKKHVRT93bqxH9oPvZ/QF9tqASbrZz6B65ofm/Dddv6f/cpLLvC QHaymueeD2IFqBYpmtodSvGg87orQ4z4SoRYTrIbK5hhyuRV7FEYrn0v1ktcQJw3wACW LPZxvc6xBB8OwjNs2J5NrmQdeuAuIdoW4XsmMX5rjAg++UfwsOm0ufEgO0fTlgrwCDPQ tQKg== X-Gm-Message-State: AOAM533mokTRq2uh19hLUr8/470oRCT4ZLHnP8wzgfpk122+VPvBUOGE xwpZNBsFNKfaK/3sHJwSX7L7cIpkb2EcIsIaRQav2QoG3NAZs/QJkbkxvKzIe2e3y0qVAl7YjEt lFA7V7ViZdvWycLz+hiSSbMoN X-Received: by 2002:a17:906:551:: with SMTP id k17mr11813702eja.391.1628610036421; Tue, 10 Aug 2021 08:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEfPgw2MVyADF6KuiOMT90UCSevtDMzJvUKHXVTk4Ut7/KoUc1aC6LUI6p/GNoTZeSaPWfFw== X-Received: by 2002:a17:906:551:: with SMTP id k17mr11813686eja.391.1628610036236; Tue, 10 Aug 2021 08:40:36 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id b25sm9837155edv.9.2021.08.10.08.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:40:35 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , Venkat Duvvuru , dpdk stable Date: Tue, 10 Aug 2021 17:38:43 +0200 Message-Id: <20210810154022.749358-3-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.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 19.11.10 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 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/12/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/3e3ef06de595856b72bd7cf9b958d52c20f112bf Thanks. Christian Ehrhardt --- >From 3e3ef06de595856b72bd7cf9b958d52c20f112bf 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 bcddda4518..41be6b5d81 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -916,32 +916,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 { @@ -954,10 +968,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; @@ -1129,16 +1157,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, 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", @@ -1348,16 +1369,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.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:13.215310562 +0200 +++ 0003-net-bnxt-fix-error-messages-in-VNIC-prepare.patch 2021-08-10 15:11:12.890637177 +0200 @@ -1 +1 @@ -From 52b0e588eb18f90bf2423e59cbb3ec58c490eb67 Mon Sep 17 00:00:00 2001 +From 3e3ef06de595856b72bd7cf9b958d52c20f112bf 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 bcddda4518..41be6b5d81 100644 @@ -28 +29 @@ -@@ -919,32 +919,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, +@@ -916,32 +916,46 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, @@ -81 +82 @@ -@@ -957,10 +971,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic) +@@ -954,10 +968,24 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic) @@ -108 +109 @@ -@@ -1142,16 +1170,9 @@ start: +@@ -1129,16 +1157,9 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev, @@ -127 +128 @@ -@@ -1362,16 +1383,9 @@ skip_vnic_alloc: +@@ -1348,16 +1369,9 @@ use_vnic: