Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:08:48 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:09:53 +0100
commite9201f07dd7b9afc6565463163a333fe5470442f (patch)
treeac1c11b94522861f4b19674bafec215df060e336
parentc6b03f38c3e81428b24a51b9d2fd8278c7c5b182 (diff)
qed: Optimize execution time for nvm attributes configuration
(jsc#SLE-8401).
-rw-r--r--patches.suse/qed-Optimize-execution-time-for-nvm-attributes-confi.patch85
-rw-r--r--series.conf1
2 files changed, 86 insertions, 0 deletions
diff --git a/patches.suse/qed-Optimize-execution-time-for-nvm-attributes-confi.patch b/patches.suse/qed-Optimize-execution-time-for-nvm-attributes-confi.patch
new file mode 100644
index 0000000000..3eef7a9330
--- /dev/null
+++ b/patches.suse/qed-Optimize-execution-time-for-nvm-attributes-confi.patch
@@ -0,0 +1,85 @@
+From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
+Date: Wed, 30 Oct 2019 01:39:58 -0700
+Subject: qed: Optimize execution time for nvm attributes configuration.
+Patch-mainline: v5.4-rc6
+Git-commit: c63b0968946b2d72178a92793bcc9439e19b385f
+References: jsc#SLE-8401
+
+Current implementation for nvm_attr configuration instructs the management
+FW to load/unload the nvm-cfg image for each user-provided attribute in
+the input file. This consumes lot of cycles even for few tens of
+attributes.
+This patch updates the implementation to perform load/commit of the config
+for every 50 attributes. After loading the nvm-image, MFW expects that
+config should be committed in a predefined timer value (5 sec), hence it's
+not possible to write large number of attributes in a single load/commit
+window. Hence performing the commits in chunks.
+
+Fixes: 0dabbe1bb3a4 ("qed: Add driver API for flashing the config attributes.")
+Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
+Signed-off-by: Ariel Elior <aelior@marvell.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/net/ethernet/qlogic/qed/qed_main.c | 27 +++++++++++++++++++++------
+ 1 file changed, 21 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
++++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
+@@ -67,10 +67,9 @@
+ #define QED_ROCE_QPS (8192)
+ #define QED_ROCE_DPIS (8)
+ #define QED_RDMA_SRQS QED_ROCE_QPS
+-#define QED_NVM_CFG_SET_FLAGS 0xE
+-#define QED_NVM_CFG_SET_PF_FLAGS 0x1E
+ #define QED_NVM_CFG_GET_FLAGS 0xA
+ #define QED_NVM_CFG_GET_PF_FLAGS 0x1A
++#define QED_NVM_CFG_MAX_ATTRS 50
+
+ static char version[] =
+ "QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n";
+@@ -2255,6 +2254,7 @@ static int qed_nvm_flash_cfg_write(struc
+ {
+ struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
+ u8 entity_id, len, buf[32];
++ bool need_nvm_init = true;
+ struct qed_ptt *ptt;
+ u16 cfg_id, count;
+ int rc = 0, i;
+@@ -2271,8 +2271,10 @@ static int qed_nvm_flash_cfg_write(struc
+
+ DP_VERBOSE(cdev, NETIF_MSG_DRV,
+ "Read config ids: num_attrs = %0d\n", count);
+- /* NVM CFG ID attributes */
+- for (i = 0; i < count; i++) {
++ /* NVM CFG ID attributes. Start loop index from 1 to avoid additional
++ * arithmetic operations in the implementation.
++ */
++ for (i = 1; i <= count; i++) {
+ cfg_id = *((u16 *)*data);
+ *data += 2;
+ entity_id = **data;
+@@ -2282,8 +2284,21 @@ static int qed_nvm_flash_cfg_write(struc
+ memcpy(buf, *data, len);
+ *data += len;
+
+- flags = entity_id ? QED_NVM_CFG_SET_PF_FLAGS :
+- QED_NVM_CFG_SET_FLAGS;
++ flags = 0;
++ if (need_nvm_init) {
++ flags |= QED_NVM_CFG_OPTION_INIT;
++ need_nvm_init = false;
++ }
++
++ /* Commit to flash and free the resources */
++ if (!(i % QED_NVM_CFG_MAX_ATTRS) || i == count) {
++ flags |= QED_NVM_CFG_OPTION_COMMIT |
++ QED_NVM_CFG_OPTION_FREE;
++ need_nvm_init = true;
++ }
++
++ if (entity_id)
++ flags |= QED_NVM_CFG_OPTION_ENTITY_SEL;
+
+ DP_VERBOSE(cdev, NETIF_MSG_DRV,
+ "cfg_id = %d entity = %d len = %d\n", cfg_id,
diff --git a/series.conf b/series.conf
index cc42eadba8..ce89741a3f 100644
--- a/series.conf
+++ b/series.conf
@@ -2883,6 +2883,7 @@
patches.suse/net-mlx5e-Initialize-on-stack-link-modes-bitmap.patch
patches.suse/qed-fix-spelling-mistake-queuess-queues.patch
patches.suse/vxlan-fix-unexpected-failure-of-vxlan_changelink.patch
+ patches.suse/qed-Optimize-execution-time-for-nvm-attributes-confi.patch
patches.suse/powerpc-powernv-Fix-CPU-idle-to-be-called-with-IRQs-.patch
patches.suse/scsi-qla2xxx-fixup-incorrect-usage-of-host_byte.patch
patches.suse/scsi-lpfc-Check-queue-pointer-before-use.patch