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 0E65EA0553 for ; Mon, 17 Feb 2020 18:46:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07D9E1DAB6; Mon, 17 Feb 2020 18:46:22 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by dpdk.org (Postfix) with ESMTP id 190681DAB9 for ; Mon, 17 Feb 2020 18:46:21 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id r11so20744806wrq.10 for ; Mon, 17 Feb 2020 09:46:21 -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=ribN0desS3r40ctiXxTftuIYj5ZMkpwwF31kWjohmiQ=; b=R5gcyykcx2rLtQdHDTZCjGsfXyh54tvRQTRC0M2DsoDckQq1gyimympbh2R0FXuEgD Z8R9Q5zTU6SFwqLPLs5c4MK49/LsShukWsSFhLO6LCTi3RkGsBp8NI8iBl4d+XKAPfJT 0daUaM8DTZph2is0ItUsX86193zlixn6lE8CpNsLevjnEGvzqs0d8hb47XaOEopwhuEl WjqDggpPbdMGetewMRiwxCR3dbZmMvkYi3NW5iS8/+2dWF13OiPX2VCZ98bGyvAf460V N3gGyqlfU4C25DVyjYd0kLDLS3jBTztidDRsqUPkRxvI++5kiWug4iRBwxZx47cCaxpv +ocQ== 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=ribN0desS3r40ctiXxTftuIYj5ZMkpwwF31kWjohmiQ=; b=SM3D7pKBUib+Zmg+/9/YRsDNCA484iqzSHz/J0NS42NcDaMtH5+yyYzoczO6AHk/d0 rLmtBQcfHrPEgY90cEdPcLUDAeLBIxWERBRXiUjZYQ6iZ1bfTR+AWHlf2JiObcbDX76q MeYnOdXXwCOXa3ft00I/RSFNGvpRdH9asLHXN9Ye96RSUXHP3TI11YPMVM0P97198gCw gH/cxuQKacHxyBVTcPyiq5hZN2jriOFBOSDpzsNNnNkPRhtU7+RPG8GPhIznzjhcHrMI zQOwpsUkVmsJv0KqX52rzWWB6LhYrJ6C9pa0DOFdy6tMGxflFuhwWWX5Z/2Sesjm8Dmx Dltw== X-Gm-Message-State: APjAAAXiFs4ryNZO7EBwZqELIvwLOQCrzUsfDVBETaG2vnWhUzARsoNC HGDdp0PDvOZYBNU+SENSg5c= X-Google-Smtp-Source: APXvYqzx+eZBlfCtPyevxdMzWihq22yPJmHKzAr3C6azK50aZXb0igpzQk1lu7s257BVhIDEzx89Ow== X-Received: by 2002:adf:f3d1:: with SMTP id g17mr22357619wrp.378.1581961580819; Mon, 17 Feb 2020 09:46:20 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id g7sm2090445wrq.21.2020.02.17.09.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:20 -0800 (PST) From: luca.boccassi@gmail.com To: Rahul Gupta Cc: Kalesh AP , Somnath Kotur , Ajit Khaparde , dpdk stable Date: Mon, 17 Feb 2020 17:45:11 +0000 Message-Id: <20200217174546.25334-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix default timeout for getting FW version' 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/19/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 b4dd49534f61dfe9610e61a626c2422d4ae22144 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Thu, 6 Feb 2020 22:03:09 +0530 Subject: [PATCH] net/bnxt: fix default timeout for getting FW version [ upstream commit 975ff25e7c2d8dfba2c947b5dc23a3bebf51b2d6 ] Initially when driver is loading, there is no HWRM timeout configured by FW, the VER_GET command needs use default timeout as 500ms and while recovering from fatal/non-fatal FW error, it should use timeout as 50ms. Fixes: 458f0360e8dc ("net/bnxt: get default HWRM command timeout from FW") Signed-off-by: Rahul Gupta Reviewed-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 6 ++++-- drivers/net/bnxt/bnxt_ethdev.c | 4 ++-- drivers/net/bnxt/bnxt_hwrm.c | 11 ++++------- drivers/net/bnxt/bnxt_hwrm.h | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 9fba7c022f..6422753a81 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -600,8 +600,10 @@ struct bnxt { uint16_t max_resp_len; uint16_t hwrm_max_ext_req_len; - /* default command timeout value of 50ms */ -#define HWRM_CMD_TIMEOUT 50000 + /* default command timeout value of 500ms */ +#define DFLT_HWRM_CMD_TIMEOUT 500000 + /* short command timeout value of 50ms */ +#define SHORT_HWRM_CMD_TIMEOUT 50000 /* default HWRM request timeout value */ uint32_t hwrm_cmd_timeout; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 778bdf9367..f123c823e3 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3832,7 +3832,7 @@ static void bnxt_dev_recover(void *arg) bp->flags &= ~BNXT_FLAG_FATAL_ERROR; do { - rc = bnxt_hwrm_ver_get(bp); + rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT); if (rc == 0) break; rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL); @@ -4511,7 +4511,7 @@ static int bnxt_init_fw(struct bnxt *bp) bp->fw_cap = 0; - rc = bnxt_hwrm_ver_get(bp); + rc = bnxt_hwrm_ver_get(bp, DFLT_HWRM_CMD_TIMEOUT); if (rc) return rc; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 3f603393b5..ad9ca7c6f1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -100,11 +100,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, if (bp->flags & BNXT_FLAG_FATAL_ERROR) return 0; - /* For VER_GET command, set timeout as 50ms */ - if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET) - timeout = HWRM_CMD_TIMEOUT; - else - timeout = bp->hwrm_cmd_timeout; + timeout = bp->hwrm_cmd_timeout; if (bp->flags & BNXT_FLAG_SHORT_CMD || msg_len > bp->max_req_len) { @@ -948,7 +944,7 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) return rc; } -int bnxt_hwrm_ver_get(struct bnxt *bp) +int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout) { int rc = 0; struct hwrm_ver_get_input req = {.req_type = 0 }; @@ -959,6 +955,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) uint32_t dev_caps_cfg; bp->max_req_len = HWRM_MAX_REQ_LEN; + bp->hwrm_cmd_timeout = timeout; HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB); req.hwrm_intf_maj = HWRM_VERSION_MAJOR; @@ -993,7 +990,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) /* convert timeout to usec */ bp->hwrm_cmd_timeout *= 1000; if (!bp->hwrm_cmd_timeout) - bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT; + bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT; if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) { PMD_DRV_LOG(ERR, "Unsupported firmware API version\n"); diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index d8d1360f91..2753720aef 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -120,7 +120,7 @@ int bnxt_hwrm_stat_ctx_free(struct bnxt *bp, int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx, struct rte_eth_stats *stats, uint8_t rx); -int bnxt_hwrm_ver_get(struct bnxt *bp); +int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout); int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic); int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:15.852852104 +0000 +++ 0019-net-bnxt-fix-default-timeout-for-getting-FW-version.patch 2020-02-17 17:00:15.303950399 +0000 @@ -1,15 +1,16 @@ -From 975ff25e7c2d8dfba2c947b5dc23a3bebf51b2d6 Mon Sep 17 00:00:00 2001 +From b4dd49534f61dfe9610e61a626c2422d4ae22144 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Thu, 6 Feb 2020 22:03:09 +0530 Subject: [PATCH] net/bnxt: fix default timeout for getting FW version +[ upstream commit 975ff25e7c2d8dfba2c947b5dc23a3bebf51b2d6 ] + Initially when driver is loading, there is no HWRM timeout configured by FW, the VER_GET command needs use default timeout as 500ms and while recovering from fatal/non-fatal FW error, it should use timeout as 50ms. Fixes: 458f0360e8dc ("net/bnxt: get default HWRM command timeout from FW") -Cc: stable@dpdk.org Signed-off-by: Rahul Gupta Reviewed-by: Kalesh AP @@ -23,10 +24,10 @@ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h -index 68786a89bf..e8a30fa310 100644 +index 9fba7c022f..6422753a81 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h -@@ -606,8 +606,10 @@ struct bnxt { +@@ -600,8 +600,10 @@ struct bnxt { uint16_t max_resp_len; uint16_t hwrm_max_ext_req_len; @@ -40,10 +41,10 @@ uint32_t hwrm_cmd_timeout; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c -index 537820960e..7147cc8fe2 100644 +index 778bdf9367..f123c823e3 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c -@@ -3998,7 +3998,7 @@ static void bnxt_dev_recover(void *arg) +@@ -3832,7 +3832,7 @@ static void bnxt_dev_recover(void *arg) bp->flags &= ~BNXT_FLAG_FATAL_ERROR; do { @@ -52,7 +53,7 @@ if (rc == 0) break; rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL); -@@ -4688,7 +4688,7 @@ static int bnxt_init_fw(struct bnxt *bp) +@@ -4511,7 +4511,7 @@ static int bnxt_init_fw(struct bnxt *bp) bp->fw_cap = 0; @@ -62,7 +63,7 @@ return rc; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index f325aff828..96b34317b2 100644 +index 3f603393b5..ad9ca7c6f1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -100,11 +100,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, @@ -78,7 +79,7 @@ if (bp->flags & BNXT_FLAG_SHORT_CMD || msg_len > bp->max_req_len) { -@@ -949,7 +945,7 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) +@@ -948,7 +944,7 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp) return rc; } @@ -87,7 +88,7 @@ { int rc = 0; struct hwrm_ver_get_input req = {.req_type = 0 }; -@@ -960,6 +956,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) +@@ -959,6 +955,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) uint32_t dev_caps_cfg; bp->max_req_len = HWRM_MAX_REQ_LEN; @@ -95,7 +96,7 @@ HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB); req.hwrm_intf_maj = HWRM_VERSION_MAJOR; -@@ -994,7 +991,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) +@@ -993,7 +990,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) /* convert timeout to usec */ bp->hwrm_cmd_timeout *= 1000; if (!bp->hwrm_cmd_timeout)