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 88273A0524 for ; Fri, 5 Feb 2021 12:30:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80D504067B; Fri, 5 Feb 2021 12:30:48 +0100 (CET) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id 4ED814067B for ; Fri, 5 Feb 2021 12:30:47 +0100 (CET) Received: by mail-wr1-f53.google.com with SMTP id v15so7313877wrx.4 for ; Fri, 05 Feb 2021 03:30:47 -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=T9MwbWk48cPfWWY6MUNg5uMhXFcE5CGjd6nSvqqvWvc=; b=R20S3aJ1lGeNmOK+luYT135IRmnNFWRnvSnfjP2u5XK78ZlPUKuO+qifUgDUIgZpuw v2zG0xOggSEl1b4NJmwOeDlmZu+gFtIru+S+oB98TrcqAkkeKasXykeVNjDdY1442+eE fykcT3uzJ6CJv5OInR2F+KAGVZNTyOK5Btx8pF1Be36cPutTJYQ5N02NH9sjRwQ7+RtA 8vWRvZu9Uhm6tOu3iV1GrxF7nHbmMCYhV/m2aAHlWzZQ0SwXZ2j/Ya0RHOS66ugBChNM ng40eGs1RR3DXOYLRPlvaQF4iuxGzN05PeEMPJ3Bwh6T3X4kGOxQ69RsTHa301CHB0eA bXoQ== 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=T9MwbWk48cPfWWY6MUNg5uMhXFcE5CGjd6nSvqqvWvc=; b=nzpohKa7yld6VS8Ge47YRPw2UVTcqaXbumsS7wbERXXp+WjTIHJGp/gxqj18dLD8Ja aSwBY2GUGDvsZ8p0ojG2u+7LtaNUmCphWj9k0wasTomBjfvFVy3AmSrHayoR0i5wPWyc jbPv4+1xudS3bLuchBCynXTqQFE389KeEWfbFgfAuN0WT+vKnbpCF0V+ZJ5GPuCvWYPw MO3BqQOF00JwC90copInDkGiXm5/CknuF7zb634cas5Ly6d4ueZRoVLqtD3d/QjGBPKY tEpoAlJaRgcqOeuhoscksI9BArThR6Um0osXj3JefhEzjg5074QMBREHjND25vicvE2R ifLg== X-Gm-Message-State: AOAM53319avvDCmYvtofWvktHcZFED3Axul+GYxBqWZUfQGArNT9jqYU WYTWw31PyIeV5yJxjf7EielkXMSA+72wWd9x X-Google-Smtp-Source: ABdhPJwW1m7yA12qdfZDY4Svd2+hi4jXFLoOsRixvlowg6/BgK8EUtGHV87tGh/J2bXIlzOn9MUQYw== X-Received: by 2002:a5d:5283:: with SMTP id c3mr4371227wrv.319.1612524647076; Fri, 05 Feb 2021 03:30:47 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id d23sm8617799wmd.11.2021.02.05.03.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:30:46 -0800 (PST) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Ajit Khaparde , dpdk stable Date: Fri, 5 Feb 2021 11:16:33 +0000 Message-Id: <20210205111920.1272063-107-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix error handling in device start' has been queued to stable release 20.11.1 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.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/07/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/800d74c40c6c86326342285848038453cf2ffc71 Thanks. Luca Boccassi --- >From 800d74c40c6c86326342285848038453cf2ffc71 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Thu, 24 Dec 2020 15:07:33 +0530 Subject: [PATCH] net/bnxt: fix error handling in device start [ upstream commit 9d276b439aafab582c5e07e82ded75570b4dc9b4 ] Call bnxt_dev_stop in error path of bnxt_dev_start_op() to keep it simple and consistent Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations") Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 145 ++++++++++++++++----------------- 1 file changed, 70 insertions(+), 75 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index ff34d54964..9a6eb19bf2 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1253,81 +1253,6 @@ static int bnxt_handle_if_change_status(struct bnxt *bp) return rc; } -static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) -{ - struct bnxt *bp = eth_dev->data->dev_private; - uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads; - int vlan_mask = 0; - int rc, retry_cnt = BNXT_IF_CHANGE_RETRY_COUNT; - - if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) { - PMD_DRV_LOG(ERR, "Queues are not configured yet!\n"); - return -EINVAL; - } - - if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) { - PMD_DRV_LOG(ERR, - "RxQ cnt %d > RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n", - bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS); - } - - do { - rc = bnxt_hwrm_if_change(bp, true); - if (rc == 0 || rc != -EAGAIN) - break; - - rte_delay_ms(BNXT_IF_CHANGE_RETRY_INTERVAL); - } while (retry_cnt--); - - if (rc) - return rc; - - if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) { - rc = bnxt_handle_if_change_status(bp); - if (rc) - return rc; - } - - bnxt_enable_int(bp); - - rc = bnxt_init_chip(bp); - if (rc) - goto error; - - eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev); - eth_dev->data->dev_started = 1; - - bnxt_link_update_op(eth_dev, 1); - - if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) - vlan_mask |= ETH_VLAN_FILTER_MASK; - if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) - vlan_mask |= ETH_VLAN_STRIP_MASK; - rc = bnxt_vlan_offload_set_op(eth_dev, vlan_mask); - if (rc) - goto error; - - /* Initialize bnxt ULP port details */ - rc = bnxt_ulp_port_init(bp); - if (rc) - goto error; - - eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev); - eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev); - - bnxt_schedule_fw_health_check(bp); - - return 0; - -error: - bnxt_shutdown_nic(bp); - bnxt_free_tx_mbufs(bp); - bnxt_free_rx_mbufs(bp); - bnxt_hwrm_if_change(bp, false); - eth_dev->data->dev_started = 0; - return rc; -} - static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; @@ -1434,6 +1359,76 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) return 0; } +static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev) +{ + struct bnxt *bp = eth_dev->data->dev_private; + uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads; + int vlan_mask = 0; + int rc, retry_cnt = BNXT_IF_CHANGE_RETRY_COUNT; + + if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) { + PMD_DRV_LOG(ERR, "Queues are not configured yet!\n"); + return -EINVAL; + } + + if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) + PMD_DRV_LOG(ERR, + "RxQ cnt %d > RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n", + bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS); + + do { + rc = bnxt_hwrm_if_change(bp, true); + if (rc == 0 || rc != -EAGAIN) + break; + + rte_delay_ms(BNXT_IF_CHANGE_RETRY_INTERVAL); + } while (retry_cnt--); + + if (rc) + return rc; + + if (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) { + rc = bnxt_handle_if_change_status(bp); + if (rc) + return rc; + } + + bnxt_enable_int(bp); + + rc = bnxt_init_chip(bp); + if (rc) + goto error; + + eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev); + eth_dev->data->dev_started = 1; + + bnxt_link_update_op(eth_dev, 1); + + if (rx_offloads & DEV_RX_OFFLOAD_VLAN_FILTER) + vlan_mask |= ETH_VLAN_FILTER_MASK; + if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) + vlan_mask |= ETH_VLAN_STRIP_MASK; + rc = bnxt_vlan_offload_set_op(eth_dev, vlan_mask); + if (rc) + goto error; + + /* Initialize bnxt ULP port details */ + rc = bnxt_ulp_port_init(bp); + if (rc) + goto error; + + eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev); + eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev); + + bnxt_schedule_fw_health_check(bp); + + return 0; + +error: + bnxt_dev_stop_op(eth_dev); + return rc; +} + static void bnxt_uninit_locks(struct bnxt *bp) { -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:34.035887431 +0000 +++ 0107-net-bnxt-fix-error-handling-in-device-start.patch 2021-02-05 11:18:28.966694159 +0000 @@ -1 +1 @@ -From 9d276b439aafab582c5e07e82ded75570b4dc9b4 Mon Sep 17 00:00:00 2001 +From 800d74c40c6c86326342285848038453cf2ffc71 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9d276b439aafab582c5e07e82ded75570b4dc9b4 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15,2 +16,2 @@ - drivers/net/bnxt/bnxt_ethdev.c | 144 ++++++++++++++++----------------- - 1 file changed, 70 insertions(+), 74 deletions(-) + drivers/net/bnxt/bnxt_ethdev.c | 145 ++++++++++++++++----------------- + 1 file changed, 70 insertions(+), 75 deletions(-) @@ -19 +20 @@ -index bd7bcbdfdf..b4a23366ee 100644 +index ff34d54964..9a6eb19bf2 100644 @@ -22 +23 @@ -@@ -1260,80 +1260,6 @@ static int bnxt_handle_if_change_status(struct bnxt *bp) +@@ -1253,81 +1253,6 @@ static int bnxt_handle_if_change_status(struct bnxt *bp) @@ -38 +39 @@ -- if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) +- if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) { @@ -40,2 +41,3 @@ -- "RxQ cnt %d > RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n", -- bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS); +- "RxQ cnt %d > RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n", +- bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS); +- } @@ -103 +105 @@ -@@ -1440,6 +1366,76 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) +@@ -1434,6 +1359,76 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)