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 01C54A04F3 for ; Thu, 19 Dec 2019 15:37:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7A691BF93; Thu, 19 Dec 2019 15:37:27 +0100 (CET) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by dpdk.org (Postfix) with ESMTP id A0D4F1BF93 for ; Thu, 19 Dec 2019 15:37:26 +0100 (CET) Received: by mail-wr1-f45.google.com with SMTP id y11so6214460wrt.6 for ; Thu, 19 Dec 2019 06:37:26 -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=gRFGKKqXv1OgJBR0RkNfzsTfju/uI+7kUIisYNqkSRs=; b=WyXXTNk3q6S8MDl1UkaiDaTYU1VtdAcM8/lXlu+Ou5lZ6LFTkz5Xvnau4csiDXxc4m Et538gX1Pbv+DVlYosp/uuegKFbmgdA/vtBY7/C/PdPyCMA6bd/5AUCdeTNVayTHReKJ zjXlv375NfWnBo009Rjt77Q0a4J7Tpgz7tuzh8yFrwGWrn8LiKP4FLGAf8gXDu55stE1 aZ18AZ7w83CCF7Wj4cWdvLHuSO/2Vvjiyaxwk72GpVQUleuFUGHKUHF3+fQYuX41mVl7 tVN8JwMXnkXOlZ+VQ87GYG2ZqPWyNHui0gC7EY0kCJ8ilZcjnq8WkSp81LGsImNIzzp2 vx2A== 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=gRFGKKqXv1OgJBR0RkNfzsTfju/uI+7kUIisYNqkSRs=; b=GUs2zSg11ILRIQ6vQvqhFKJTCwH0+WybiKr3PyzEOpvmNbcByuqLJW39sM0Cn7/5tg ntzm1+E17amJm+YUNinfGySGmHT2fdCwt4xw9o6uSOsE+a8NJqcENPbFX6MzHNlDULNj ibV8orOWJNagHjCvggcHlLOeUAvBqF29g0FVgYeGWN6BvInRgzoqBgbhd6/0Ih3eXHK3 sE4dSlb6YudOKjYdKlKi5eCkQzhE+5GEKsVPJIeKpTNbv77xiHetGmrqLF6g3pW7rZcV AhVFbGhFmdWrU8Lu/as3pL4HQeBmHVzjM0lNsRzHDD9lEWteAvsm39s99i+Bw5xSFvbQ TWCg== X-Gm-Message-State: APjAAAX6CIn8Oa2L5qK8v6elfKtWZATnoh6iL0L+ZCTeFapgF4L4/geU S0BSLk2Gd19N+kpXenvIRM0= X-Google-Smtp-Source: APXvYqzhUtiOQFuLJ9ObTEvI8XY1hom/sRAStsPmp+BNkJzDa+LvhpyUZZjLpsdZ11VrfG8OZZJurQ== X-Received: by 2002:a5d:6ac2:: with SMTP id u2mr10079867wrw.233.1576766246202; Thu, 19 Dec 2019 06:37:26 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l2sm6199560wmi.5.2019.12.19.06.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:37:25 -0800 (PST) From: luca.boccassi@gmail.com To: Ajit Khaparde Cc: Santoshkumar Karanappa Rastapur , Lance Richardson , dpdk stable Date: Thu, 19 Dec 2019 14:33:29 +0000 Message-Id: <20191219143447.21506-62-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: get default HWRM command timeout from FW' has been queued to LTS release 17.11.10 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 LTS release 17.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 12/21/19. 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 8d3c93905d3c22dc3346c05fb1178bf6899dbd4a Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Wed, 9 Oct 2019 18:41:47 -0700 Subject: [PATCH] net/bnxt: get default HWRM command timeout from FW [ upstream commit 458f0360e8dc72ccc6f98ca724ab3d55325ad493 ] The HWRM command timeout is set to a very high value. VER_GET command response returns the default request timeout value. Use this value for waiting for HWRM commands to complete. Poll for the valid bit every 1us instead of 600us. Fixes: cbcd375d37d2 ("net/bnxt: fix HWRM macros and locking") Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Ajit Khaparde Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt.h | 5 +++++ drivers/net/bnxt/bnxt_hwrm.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 3bc2b93796..1fae24b801 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -246,6 +246,11 @@ struct bnxt { uint16_t max_req_len; uint16_t max_resp_len; + /* default command timeout value of 50ms */ +#define HWRM_CMD_TIMEOUT 50000 + /* default HWRM request timeout value */ + uint32_t hwrm_cmd_timeout; + struct bnxt_link_info link_info; struct bnxt_cos_queue_info cos_queue[BNXT_COS_QUEUE_COUNT]; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 7d824aeb45..a8d7c487f9 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -53,8 +53,6 @@ #include -#define HWRM_CMD_TIMEOUT 10000 - struct bnxt_plcmodes_cfg { uint32_t flags; uint16_t jumbo_thresh; @@ -613,6 +611,13 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) fw_version |= resp->hwrm_intf_min << 8; fw_version |= resp->hwrm_intf_upd; + /* def_req_timeout value is in milliseconds */ + bp->hwrm_cmd_timeout = rte_le_to_cpu_16(resp->def_req_timeout); + /* convert timeout to usec */ + bp->hwrm_cmd_timeout *= 1000; + if (!bp->hwrm_cmd_timeout) + bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT; + if (resp->hwrm_intf_maj != HWRM_VERSION_MAJOR) { RTE_LOG(ERR, PMD, "Unsupported firmware API version\n"); rc = -EINVAL; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:28.786163518 +0000 +++ 0062-net-bnxt-get-default-HWRM-command-timeout-from-FW.patch 2019-12-19 14:32:26.133298381 +0000 @@ -1,31 +1,32 @@ -From 458f0360e8dc72ccc6f98ca724ab3d55325ad493 Mon Sep 17 00:00:00 2001 +From 8d3c93905d3c22dc3346c05fb1178bf6899dbd4a Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Wed, 9 Oct 2019 18:41:47 -0700 Subject: [PATCH] net/bnxt: get default HWRM command timeout from FW +[ upstream commit 458f0360e8dc72ccc6f98ca724ab3d55325ad493 ] + The HWRM command timeout is set to a very high value. VER_GET command response returns the default request timeout value. Use this value for waiting for HWRM commands to complete. Poll for the valid bit every 1us instead of 600us. Fixes: cbcd375d37d2 ("net/bnxt: fix HWRM macros and locking") -Cc: stable@dpdk.org Signed-off-by: Santoshkumar Karanappa Rastapur Signed-off-by: Ajit Khaparde Reviewed-by: Lance Richardson --- - drivers/net/bnxt/bnxt.h | 5 +++++ - drivers/net/bnxt/bnxt_hwrm.c | 13 +++++++++---- - 2 files changed, 14 insertions(+), 4 deletions(-) + drivers/net/bnxt/bnxt.h | 5 +++++ + drivers/net/bnxt/bnxt_hwrm.c | 9 +++++++-- + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h -index ad0b18dddd..5020cd3415 100644 +index 3bc2b93796..1fae24b801 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h -@@ -525,6 +525,11 @@ struct bnxt { +@@ -246,6 +246,11 @@ struct bnxt { + uint16_t max_req_len; uint16_t max_resp_len; - uint16_t hwrm_max_ext_req_len; + /* default command timeout value of 50ms */ +#define HWRM_CMD_TIMEOUT 50000 @@ -33,36 +34,24 @@ + uint32_t hwrm_cmd_timeout; + struct bnxt_link_info link_info; - struct bnxt_cos_queue_info rx_cos_queue[BNXT_COS_QUEUE_COUNT]; - struct bnxt_cos_queue_info tx_cos_queue[BNXT_COS_QUEUE_COUNT]; + struct bnxt_cos_queue_info cos_queue[BNXT_COS_QUEUE_COUNT]; + diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c -index a40197e929..5e3117fee9 100644 +index 7d824aeb45..a8d7c487f9 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c -@@ -25,8 +25,6 @@ +@@ -53,8 +53,6 @@ #include --#define HWRM_CMD_TIMEOUT 6000000 --#define HWRM_SHORT_CMD_TIMEOUT 50000 - #define HWRM_SPEC_CODE_1_8_3 0x10803 - #define HWRM_VERSION_1_9_1 0x10901 - #define HWRM_VERSION_1_9_2 0x10903 -@@ -105,9 +103,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, - - /* For VER_GET command, set timeout as 50ms */ - if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET) -- timeout = HWRM_SHORT_CMD_TIMEOUT; -- else - timeout = HWRM_CMD_TIMEOUT; -+ else -+ timeout = bp->hwrm_cmd_timeout; - - if (bp->flags & BNXT_FLAG_SHORT_CMD || - msg_len > bp->max_req_len) { -@@ -969,6 +967,13 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) - fw_version |= resp->hwrm_intf_upd_8b; - bp->hwrm_spec_code = fw_version; +-#define HWRM_CMD_TIMEOUT 10000 +- + struct bnxt_plcmodes_cfg { + uint32_t flags; + uint16_t jumbo_thresh; +@@ -613,6 +611,13 @@ int bnxt_hwrm_ver_get(struct bnxt *bp) + fw_version |= resp->hwrm_intf_min << 8; + fw_version |= resp->hwrm_intf_upd; + /* def_req_timeout value is in milliseconds */ + bp->hwrm_cmd_timeout = rte_le_to_cpu_16(resp->def_req_timeout); @@ -71,8 +60,8 @@ + if (!bp->hwrm_cmd_timeout) + bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT; + - if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) { - PMD_DRV_LOG(ERR, "Unsupported firmware API version\n"); + if (resp->hwrm_intf_maj != HWRM_VERSION_MAJOR) { + RTE_LOG(ERR, PMD, "Unsupported firmware API version\n"); rc = -EINVAL; -- 2.20.1