Skip to contentSkip to conversation

qede: update qede pmd to 1.2.0.1 and enable by default

PATCH Superseded Rasesh Mody 3 participants 37 messages Oct 15, 2016 – Oct 17, 2016 Network drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover qede: update qede pmd to 1.2.0.1 and enable by default

Hi,

This patch set includes changes to update the base driver, work with newer FW 8.10.9.0, adds new features, includes enhancements and code cleanup, provides bug fixes and updates documentation for the QEDE poll mode driver.

It enables QEDE PMD in the dpdk config by default. The dependency on external library libz has been addressed.

The patch set updates the QEDE PMD to 1.2.0.1.

Review comments recived for v2 series have been addressed.

Please apply to DPDK tree for v16.11 release.

Thanks!
Rasesh

Harish Patil (14):
qede: change the API signature of ecore_mcp_cmd_and_union()
qede: serialize access to MFW mbox
qede: add APIs to support NIC selftests and query sensor info.
qede: fix port (re)configuration issue
qede/base: allow MTU change via vport-update
qede: add missing 100G link speed capability
qede: remove unused/dead code
qede: fixes for VLAN filters
qede: add enable/disable VLAN filtering
qede: fix RSS related issues
qede/base: add support to initiate PF FLR
qede: skip slowpath polling for 100G VF device
qede: fix driver version string
qede: fix status_blk index for VF queues

Rasesh Mody (16):
qede/base: add new init files and rearrange the code qede/base: formatting changes
qede: use FW CONFIG defines as needed qede/base: add HSI changes and register defines qede/base: fix the attention formating string qede/base: additional formatting/comment changes
qede: fix 32 bit compilation
qede/base: update base driver
qede/base: rename structure and defines qede/base: comment enhancements
qede/base: add MFW crash dump support qede/base: change rx tx queue start APIs
qede: add support for queue statistics
qede: remove zlib dependency and enable PMD by default
doc: update qede pmd documentation
qede: update driver version

Sony Chacko (2):
qede: enable support for unequal number of RX/TX queues
qede: add scatter gather support

 config/common_base                            |    2 +-
 doc/guides/nics/features/qede.ini             |    4 +
 doc/guides/nics/features/qede_vf.ini          |    4 +
 doc/guides/nics/qede.rst                      |   32 +-
 drivers/net/qede/Makefile                     |    6 +-
 drivers/net/qede/base/bcm_osal.c              |   23 +
 drivers/net/qede/base/bcm_osal.h              |   10 +
 drivers/net/qede/base/common_hsi.h            |  956 ++++++++++-
 drivers/net/qede/base/ecore.h                 |  631 +++----
 drivers/net/qede/base/ecore_chain.h           |   51 +-
 drivers/net/qede/base/ecore_cxt.c             |  387 ++++-
 drivers/net/qede/base/ecore_cxt.h             |   52 +-
 drivers/net/qede/base/ecore_cxt_api.h         |   25 +-
 drivers/net/qede/base/ecore_dcbx.c            |  589 ++++++-
 drivers/net/qede/base/ecore_dcbx.h            |   18 +-
 drivers/net/qede/base/ecore_dcbx_api.h        |  154 +-
 drivers/net/qede/base/ecore_dev.c             | 1813 +++++++++++++-------
 drivers/net/qede/base/ecore_dev_api.h         |  238 ++-
 drivers/net/qede/base/ecore_gtt_reg_addr.h    |   30 +-
 drivers/net/qede/base/ecore_gtt_values.h      |   20 +-
 drivers/net/qede/base/ecore_hsi_common.h      | 1358 +++++++++------
 drivers/net/qede/base/ecore_hsi_debug_tools.h | 1025 ++++++++++++
 drivers/net/qede/base/ecore_hsi_eth.h         |  997 ++++++++---
 drivers/net/qede/base/ecore_hsi_init_func.h   |  132 ++
 drivers/net/qede/base/ecore_hsi_init_tool.h   |  454 +++++
 drivers/net/qede/base/ecore_hsi_tools.h       | 1081 ------------
 drivers/net/qede/base/ecore_hw.c              |  222 ++-
 drivers/net/qede/base/ecore_hw.h              |   75 +-
 drivers/net/qede/base/ecore_hw_defs.h         |   39 +-
 drivers/net/qede/base/ecore_init_fw_funcs.c   |  400 +++--
 drivers/net/qede/base/ecore_init_fw_funcs.h   |  250 ++-
 drivers/net/qede/base/ecore_init_ops.c        |   11 +-
 drivers/net/qede/base/ecore_init_ops.h        |   14 +-
 drivers/net/qede/base/ecore_int.c             |  446 +++--
 drivers/net/qede/base/ecore_int.h             |   23 +-
 drivers/net/qede/base/ecore_int_api.h         |   11 +
 drivers/net/qede/base/ecore_iov_api.h         |  519 ++----
 drivers/net/qede/base/ecore_iro.h             |  234 ++-
 drivers/net/qede/base/ecore_iro_values.h      |  140 +-
 drivers/net/qede/base/ecore_l2.c              |  531 +++---
 drivers/net/qede/base/ecore_l2.h              |   85 +-
 drivers/net/qede/base/ecore_l2_api.h          |  167 +-
 drivers/net/qede/base/ecore_mcp.c             |  881 ++++++++--
 drivers/net/qede/base/ecore_mcp.h             |  141 +-
 drivers/net/qede/base/ecore_mcp_api.h         |  220 ++-
 drivers/net/qede/base/ecore_proto_if.h        |   63 +-
 drivers/net/qede/base/ecore_rt_defs.h         |  869 +++++-----
 drivers/net/qede/base/ecore_sp_api.h          |   15 +-
 drivers/net/qede/base/ecore_sp_commands.c     |   99 +-
 drivers/net/qede/base/ecore_sp_commands.h     |   38 +-
 drivers/net/qede/base/ecore_spq.c             |  237 +--
 drivers/net/qede/base/ecore_spq.h             |  162 +-
 drivers/net/qede/base/ecore_sriov.c           | 1826 +++++++++++++--------
 drivers/net/qede/base/ecore_sriov.h           |  247 +--
 drivers/net/qede/base/ecore_status.h          |   18 +-
 drivers/net/qede/base/ecore_vf.c              |  759 +++++----
 drivers/net/qede/base/ecore_vf.h              |  258 +--
 drivers/net/qede/base/ecore_vf_api.h          |  100 +-
 drivers/net/qede/base/ecore_vfpf_if.h         |  436 +++--
 drivers/net/qede/base/eth_common.h            |  439 +++--
 drivers/net/qede/base/mcp_public.h            |  825 +++++++---
 drivers/net/qede/base/nvm_cfg.h               | 2183 +++++++++++++++----------
 drivers/net/qede/base/reg_addr.h              |   36 +
 drivers/net/qede/qede_eth_if.c                |   75 +-
 drivers/net/qede/qede_eth_if.h                |   16 +-
 drivers/net/qede/qede_ethdev.c                |  486 ++++--
 drivers/net/qede/qede_ethdev.h                |   83 +-
 drivers/net/qede/qede_if.h                    |   12 +-
 drivers/net/qede/qede_main.c                  |   84 +-
 drivers/net/qede/qede_rxtx.c                  |  764 +++++----
 drivers/net/qede/qede_rxtx.h                  |   25 +-
 mk/rte.app.mk                                 |    2 +-
 72 files changed, 15635 insertions(+), 9023 deletions(-)
 create mode 100644 drivers/net/qede/base/ecore_hsi_debug_tools.h
 create mode 100644 drivers/net/qede/base/ecore_hsi_init_func.h
 create mode 100644 drivers/net/qede/base/ecore_hsi_init_tool.h
 delete mode 100644 drivers/net/qede/base/ecore_hsi_tools.h
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v3 1/32 qede/base: add new init files and rearrange the code

Added ecore_hsi_debug_tools.h, ecore_hsi_init_func.h, ecore_hsi_init_tool.h files. Rearranged code from ecore_hsi_common.h and ecore_hsi_tools.h to the new files. Removed unused code.

---
 drivers/net/qede/base/ecore.h                 |   17 +-
 drivers/net/qede/base/ecore_dev.c             |   73 +-
 drivers/net/qede/base/ecore_hsi_common.h      |  226 ------
 drivers/net/qede/base/ecore_hsi_debug_tools.h | 1025 +++++++++++++++++++++++
 drivers/net/qede/base/ecore_hsi_init_func.h   |  132 +++
 drivers/net/qede/base/ecore_hsi_init_tool.h   |  454 +++++++++++
 drivers/net/qede/base/ecore_hsi_tools.h       | 1081 -------------------------
 drivers/net/qede/base/ecore_init_fw_funcs.c   |   67 +-
 drivers/net/qede/base/ecore_init_ops.c        |    2 +-
 drivers/net/qede/base/ecore_int.c             |  141 +---
 10 files changed, 1678 insertions(+), 1540 deletions(-)
 create mode 100644 drivers/net/qede/base/ecore_hsi_debug_tools.h
 create mode 100644 drivers/net/qede/base/ecore_hsi_init_func.h
 create mode 100644 drivers/net/qede/base/ecore_hsi_init_tool.h
 delete mode 100644 drivers/net/qede/base/ecore_hsi_tools.h
drivers/net/qede/base/ecore.h +10 -7
index d682a78..db72f03 100644
@@ -10,7 +10,9 @@
 #define __ECORE_H
 
 #include "ecore_hsi_common.h"
-#include "ecore_hsi_tools.h"
+#include "ecore_hsi_debug_tools.h"
+#include "ecore_hsi_init_func.h"
+#include "ecore_hsi_init_tool.h"
 #include "ecore_proto_if.h"
 #include "mcp_public.h"
 
@@ -556,14 +558,15 @@ struct ecore_dev {
 #define ECORE_DEV_TYPE_AH	(1 << 0)
 /* Translate type/revision combo into the proper conditions */
 #define ECORE_IS_BB(dev)	((dev)->type == ECORE_DEV_TYPE_BB)
-#define ECORE_IS_BB_A0(dev)	(ECORE_IS_BB(dev) && \
-				 CHIP_REV_IS_A0(dev))
-#define ECORE_IS_BB_B0(dev)	(ECORE_IS_BB(dev) && \
-				 CHIP_REV_IS_B0(dev))
+#define ECORE_IS_BB_A0(dev)	(ECORE_IS_BB(dev) && CHIP_REV_IS_A0(dev))
+#ifndef ASIC_ONLY
+#define ECORE_IS_BB_B0(dev)	((ECORE_IS_BB(dev) && CHIP_REV_IS_B0(dev)) || \
+				 (CHIP_REV_IS_TEDIBEAR(dev)))
+#else
+#define ECORE_IS_BB_B0(dev)	(ECORE_IS_BB(dev) && CHIP_REV_IS_B0(dev))
+#endif
 #define ECORE_IS_AH(dev)	((dev)->type == ECORE_DEV_TYPE_AH)
 #define ECORE_IS_K2(dev)	ECORE_IS_AH(dev)
-#define ECORE_GET_TYPE(dev)	(ECORE_IS_BB_A0(dev) ? CHIP_BB_A0 : \
-				 ECORE_IS_BB_B0(dev) ? CHIP_BB_B0 : CHIP_K2)
 
 	u16 vendor_id;
 	u16 device_id;
drivers/net/qede/base/ecore_dev.c +6 -67

100 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_common.h +0 -226

250 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_debug_tools.h new file +1025 -0

1,025 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_init_func.h new file +132 -0

132 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_init_tool.h new file +454 -0

454 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_tools.h deleted +0 -1081

1,008 lines not on this page · raw message

drivers/net/qede/base/ecore_init_fw_funcs.c +34 -33

67 lines not on this page · raw message

drivers/net/qede/base/ecore_init_ops.c +1 -1
index 326eb92..e6e4c36 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_int.c +16 -125

141 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v3 2/32 qede/base: formatting changes

In reply to Rasesh Mody

Fixes white spaces and tabs.

---
 drivers/net/qede/base/common_hsi.h          |  252 ++---
 drivers/net/qede/base/ecore.h               |  414 +++----
 drivers/net/qede/base/ecore_chain.h         |   20 +-
 drivers/net/qede/base/ecore_cxt.c           |   16 +-
 drivers/net/qede/base/ecore_cxt_api.h       |   10 +-
 drivers/net/qede/base/ecore_dcbx.c          |    4 +-
 drivers/net/qede/base/ecore_dcbx_api.h      |   26 +-
 drivers/net/qede/base/ecore_dev.c           |  112 +-
 drivers/net/qede/base/ecore_dev_api.h       |   72 +-
 drivers/net/qede/base/ecore_gtt_reg_addr.h  |   20 +-
 drivers/net/qede/base/ecore_gtt_values.h    |   20 +-
 drivers/net/qede/base/ecore_hsi_common.h    |    6 +-
 drivers/net/qede/base/ecore_hsi_eth.h       |    8 +-
 drivers/net/qede/base/ecore_hw.c            |   14 +-
 drivers/net/qede/base/ecore_hw.h            |   28 +-
 drivers/net/qede/base/ecore_hw_defs.h       |    6 +-
 drivers/net/qede/base/ecore_init_fw_funcs.c |   12 +-
 drivers/net/qede/base/ecore_init_fw_funcs.h |   68 +-
 drivers/net/qede/base/ecore_init_ops.c      |    4 +-
 drivers/net/qede/base/ecore_int.c           |   14 +-
 drivers/net/qede/base/ecore_int.h           |    4 +-
 drivers/net/qede/base/ecore_iov_api.h       |   46 +-
 drivers/net/qede/base/ecore_iro.h           |   12 +-
 drivers/net/qede/base/ecore_iro_values.h    |   32 +-
 drivers/net/qede/base/ecore_l2.c            |   18 +-
 drivers/net/qede/base/ecore_l2.h            |    4 +-
 drivers/net/qede/base/ecore_l2_api.h        |   88 +-
 drivers/net/qede/base/ecore_mcp.c           |   28 +-
 drivers/net/qede/base/ecore_mcp.h           |    6 +-
 drivers/net/qede/base/ecore_mcp_api.h       |   16 +-
 drivers/net/qede/base/ecore_proto_if.h      |    4 +-
 drivers/net/qede/base/ecore_rt_defs.h       |  230 ++--
 drivers/net/qede/base/ecore_sp_api.h        |   10 +-
 drivers/net/qede/base/ecore_sp_commands.c   |   16 +-
 drivers/net/qede/base/ecore_sp_commands.h   |    8 +-
 drivers/net/qede/base/ecore_spq.c           |   60 +-
 drivers/net/qede/base/ecore_spq.h           |  136 +--
 drivers/net/qede/base/ecore_sriov.c         |  222 ++--
 drivers/net/qede/base/ecore_sriov.h         |   98 +-
 drivers/net/qede/base/ecore_status.h        |   18 +-
 drivers/net/qede/base/ecore_vf.c            |   18 +-
 drivers/net/qede/base/ecore_vf.h            |   34 +-
 drivers/net/qede/base/ecore_vf_api.h        |    4 +-
 drivers/net/qede/base/ecore_vfpf_if.h       |  270 ++---
 drivers/net/qede/base/eth_common.h          |   52 +-
 drivers/net/qede/base/mcp_public.h          |  194 ++--
 drivers/net/qede/base/nvm_cfg.h             | 1562 +++++++++++++--------------
 47 files changed, 2158 insertions(+), 2158 deletions(-)
drivers/net/qede/base/common_hsi.h +126 -126
index 295a41f..4574800 100644
@@ -9,9 +9,9 @@
 #ifndef __COMMON_HSI__
 #define __COMMON_HSI__
 
-#define CORE_SPQE_PAGE_SIZE_BYTES                       4096
+#define CORE_SPQE_PAGE_SIZE_BYTES			4096
 
-#define FW_MAJOR_VERSION	8
+#define FW_MAJOR_VERSION		8
 #define FW_MINOR_VERSION	7
 #define FW_REVISION_VERSION	7
 #define FW_ENGINEERING_VERSION	0
@@ -21,68 +21,68 @@
 /***********************/
 
 /* PCI functions */
-#define MAX_NUM_PORTS_K2	(4)
-#define MAX_NUM_PORTS_BB	(2)
-#define MAX_NUM_PORTS		(MAX_NUM_PORTS_K2)
+#define MAX_NUM_PORTS_K2		(4)
+#define MAX_NUM_PORTS_BB		(2)
+#define MAX_NUM_PORTS			(MAX_NUM_PORTS_K2)
 
-#define MAX_NUM_PFS_K2	(16)
-#define MAX_NUM_PFS_BB	(8)
-#define MAX_NUM_PFS	(MAX_NUM_PFS_K2)
-#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */
+#define MAX_NUM_PFS_K2			(16)
+#define MAX_NUM_PFS_BB			(8)
+#define MAX_NUM_PFS				(MAX_NUM_PFS_K2)
+#define MAX_NUM_OF_PFS_IN_CHIP	(16) /* On both engines */
 
-#define MAX_NUM_VFS_K2	(192)
-#define MAX_NUM_VFS_BB	(120)
-#define MAX_NUM_VFS	(MAX_NUM_VFS_K2)
+#define MAX_NUM_VFS_K2			(192)
+#define MAX_NUM_VFS_BB			(120)
+#define MAX_NUM_VFS				(MAX_NUM_VFS_K2)
 
 #define MAX_NUM_FUNCTIONS_BB	(MAX_NUM_PFS_BB + MAX_NUM_VFS_BB)
-#define MAX_NUM_FUNCTIONS	(MAX_NUM_PFS + MAX_NUM_VFS)
+#define MAX_NUM_FUNCTIONS		(MAX_NUM_PFS + MAX_NUM_VFS)
 
 #define MAX_FUNCTION_NUMBER_BB	(MAX_NUM_PFS + MAX_NUM_VFS_BB)
-#define MAX_FUNCTION_NUMBER	(MAX_NUM_PFS + MAX_NUM_VFS)
+#define MAX_FUNCTION_NUMBER		(MAX_NUM_PFS + MAX_NUM_VFS)
 
-#define MAX_NUM_VPORTS_K2	(208)
-#define MAX_NUM_VPORTS_BB	(160)
-#define MAX_NUM_VPORTS		(MAX_NUM_VPORTS_K2)
+#define MAX_NUM_VPORTS_K2		(208)
+#define MAX_NUM_VPORTS_BB		(160)
+#define MAX_NUM_VPORTS			(MAX_NUM_VPORTS_K2)
 
 #define MAX_NUM_L2_QUEUES_K2	(320)
 #define MAX_NUM_L2_QUEUES_BB	(256)
-#define MAX_NUM_L2_QUEUES	(MAX_NUM_L2_QUEUES_K2)
+#define MAX_NUM_L2_QUEUES		(MAX_NUM_L2_QUEUES_K2)
 
 /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */
 #define NUM_PHYS_TCS_4PORT_K2	(4)
-#define NUM_OF_PHYS_TCS		(8)
+#define NUM_OF_PHYS_TCS			(8)
 
-#define NUM_TCS_4PORT_K2	(NUM_PHYS_TCS_4PORT_K2 + 1)
-#define NUM_OF_TCS		(NUM_OF_PHYS_TCS + 1)
+#define NUM_TCS_4PORT_K2		(NUM_PHYS_TCS_4PORT_K2 + 1)
+#define NUM_OF_TCS				(NUM_OF_PHYS_TCS + 1)
 
-#define LB_TC			(NUM_OF_PHYS_TCS)
+#define LB_TC					(NUM_OF_PHYS_TCS)
 
 /* Num of possible traffic priority values */
-#define NUM_OF_PRIO		(8)
+#define NUM_OF_PRIO				(8)
 
-#define MAX_NUM_VOQS_K2		(NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2)
-#define MAX_NUM_VOQS_BB		(NUM_OF_TCS * MAX_NUM_PORTS_BB)
-#define MAX_NUM_VOQS		(MAX_NUM_VOQS_K2)
-#define MAX_PHYS_VOQS		(NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB)
+#define MAX_NUM_VOQS_K2			(NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2)
+#define MAX_NUM_VOQS_BB         (NUM_OF_TCS * MAX_NUM_PORTS_BB)
+#define MAX_NUM_VOQS			(MAX_NUM_VOQS_K2)
+#define MAX_PHYS_VOQS			(NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB)
 
 /* CIDs */
-#define NUM_OF_CONNECTION_TYPES	(8)
-#define NUM_OF_LCIDS		(320)
-#define NUM_OF_LTIDS		(320)
+#define NUM_OF_CONNECTION_TYPES (8)
+#define NUM_OF_LCIDS			(320)
+#define NUM_OF_LTIDS			(320)
 
 /*****************/
 /* CDU CONSTANTS */
 /*****************/
 
-#define CDU_SEG_TYPE_OFFSET_REG_TYPE_SHIFT              (17)
-#define CDU_SEG_TYPE_OFFSET_REG_OFFSET_MASK             (0x1ffff)
+#define CDU_SEG_TYPE_OFFSET_REG_TYPE_SHIFT		(17)
+#define CDU_SEG_TYPE_OFFSET_REG_OFFSET_MASK		(0x1ffff)
 
 /*****************/
 /* DQ CONSTANTS  */
 /*****************/
 
 /* DEMS */
-#define DQ_DEMS_LEGACY			0
+#define	DQ_DEMS_LEGACY						0
 
 /* XCM agg val selection */
 #define DQ_XCM_AGG_VAL_SEL_WORD2  0
@@ -107,7 +107,7 @@
 	DQ_XCM_AGG_VAL_SEL_WORD4
 #define DQ_XCM_CORE_SPQ_PROD_CMD \
 	DQ_XCM_AGG_VAL_SEL_WORD4
-#define DQ_XCM_ETH_GO_TO_BD_CONS_CMD            DQ_XCM_AGG_VAL_SEL_WORD5
+#define DQ_XCM_ETH_GO_TO_BD_CONS_CMD        DQ_XCM_AGG_VAL_SEL_WORD5
 
 /* XCM agg counter flag selection */
 #define DQ_XCM_AGG_FLG_SHIFT_BIT14  0
@@ -140,22 +140,22 @@
 /*****************/
 
 /* number of TX queues in the QM */
-#define MAX_QM_TX_QUEUES_K2	512
-#define MAX_QM_TX_QUEUES_BB	448
-#define MAX_QM_TX_QUEUES	MAX_QM_TX_QUEUES_K2
+#define MAX_QM_TX_QUEUES_K2			512
+#define MAX_QM_TX_QUEUES_BB			448
+#define MAX_QM_TX_QUEUES			MAX_QM_TX_QUEUES_K2
 
 /* number of Other queues in the QM */
-#define MAX_QM_OTHER_QUEUES_BB	64
-#define MAX_QM_OTHER_QUEUES_K2	128
-#define MAX_QM_OTHER_QUEUES	MAX_QM_OTHER_QUEUES_K2
+#define MAX_QM_OTHER_QUEUES_BB		64
+#define MAX_QM_OTHER_QUEUES_K2		128
+#define MAX_QM_OTHER_QUEUES			MAX_QM_OTHER_QUEUES_K2
 
 /* number of queues in a PF queue group */
-#define QM_PF_QUEUE_GROUP_SIZE	8
+#define QM_PF_QUEUE_GROUP_SIZE		8
 
 /* base number of Tx PQs in the CM PQ representation.
  * should be used when storing PQ IDs in CM PQ registers and context
  */
-#define CM_TX_PQ_BASE	0x200
+#define CM_TX_PQ_BASE               0x200
 
 /* QM registers data */
 #define QM_LINE_CRD_REG_WIDTH		16
@@ -164,7 +164,7 @@
 #define QM_BYTE_CRD_REG_SIGN_BIT	(1 << (QM_BYTE_CRD_REG_WIDTH - 1))
 #define QM_WFQ_CRD_REG_WIDTH		32
 #define QM_WFQ_CRD_REG_SIGN_BIT		(1 << (QM_WFQ_CRD_REG_WIDTH - 1))
-#define QM_RL_CRD_REG_WIDTH		32
+#define QM_RL_CRD_REG_WIDTH			32
 #define QM_RL_CRD_REG_SIGN_BIT		(1 << (QM_RL_CRD_REG_WIDTH - 1))
 
 /*****************/
@@ -185,100 +185,100 @@
 /* IGU CONSTANTS */
 /*****************/
 
-#define MAX_SB_PER_PATH_K2	(368)
-#define MAX_SB_PER_PATH_BB	(288)
+#define MAX_SB_PER_PATH_K2				(368)
+#define MAX_SB_PER_PATH_BB				(288)
 #define MAX_TOT_SB_PER_PATH \
 	MAX_SB_PER_PATH_K2
 
-#define MAX_SB_PER_PF_MIMD	129
-#define MAX_SB_PER_PF_SIMD	64
-#define MAX_SB_PER_VF		64
+#define MAX_SB_PER_PF_MIMD				129
+#define MAX_SB_PER_PF_SIMD				64
+#define MAX_SB_PER_VF					64
 
 /* Memory addresses on the BAR for the IGU Sub Block */
-#define IGU_MEM_BASE			0x0000
+#define IGU_MEM_BASE					0x0000
 
-#define IGU_MEM_MSIX_BASE		0x0000
-#define IGU_MEM_MSIX_UPPER		0x0101
-#define IGU_MEM_MSIX_RESERVED_UPPER	0x01ff
+#define IGU_MEM_MSIX_BASE				0x0000
+#define IGU_MEM_MSIX_UPPER				0x0101
+#define IGU_MEM_MSIX_RESERVED_UPPER			0x01ff
 
-#define IGU_MEM_PBA_MSIX_BASE		0x0200
-#define IGU_MEM_PBA_MSIX_UPPER		0x0202
-#define IGU_MEM_PBA_MSIX_RESERVED_UPPER	0x03ff
+#define IGU_MEM_PBA_MSIX_BASE				0x0200
+#define IGU_MEM_PBA_MSIX_UPPER				0x0202
+#define IGU_MEM_PBA_MSIX_RESERVED_UPPER			0x03ff
 
-#define IGU_CMD_INT_ACK_BASE		0x0400
+#define IGU_CMD_INT_ACK_BASE				0x0400
 #define IGU_CMD_INT_ACK_UPPER		(IGU_CMD_INT_ACK_BASE +	\
 					 MAX_TOT_SB_PER_PATH -	\
 					 1)
-#define IGU_CMD_INT_ACK_RESERVED_UPPER	0x05ff
+#define IGU_CMD_INT_ACK_RESERVED_UPPER			0x05ff
 
-#define IGU_CMD_ATTN_BIT_UPD_UPPER	0x05f0
-#define IGU_CMD_ATTN_BIT_SET_UPPER	0x05f1
-#define IGU_CMD_ATTN_BIT_CLR_UPPER	0x05f2
+#define IGU_CMD_ATTN_BIT_UPD_UPPER			0x05f0
+#define IGU_CMD_ATTN_BIT_SET_UPPER			0x05f1
+#define IGU_CMD_ATTN_BIT_CLR_UPPER			0x05f2
 
-#define IGU_REG_SISR_MDPC_WMASK_UPPER		0x05f3
-#define IGU_REG_SISR_MDPC_WMASK_LSB_UPPER	0x05f4
-#define IGU_REG_SISR_MDPC_WMASK_MSB_UPPER	0x05f5
-#define IGU_REG_SISR_MDPC_WOMASK_UPPER		0x05f6
+#define IGU_REG_SISR_MDPC_WMASK_UPPER			0x05f3
+#define IGU_REG_SISR_MDPC_WMASK_LSB_UPPER		0x05f4
+#define IGU_REG_SISR_MDPC_WMASK_MSB_UPPER		0x05f5
+#define IGU_REG_SISR_MDPC_WOMASK_UPPER			0x05f6
 
-#define IGU_CMD_PROD_UPD_BASE			0x0600
+#define IGU_CMD_PROD_UPD_BASE				0x0600
 #define IGU_CMD_PROD_UPD_UPPER			(IGU_CMD_PROD_UPD_BASE +\
 						 MAX_TOT_SB_PER_PATH - \
 						 1)
-#define IGU_CMD_PROD_UPD_RESERVED_UPPER		0x07ff
+#define IGU_CMD_PROD_UPD_RESERVED_UPPER			0x07ff
 
 /*****************/
 /* PXP CONSTANTS */
 /*****************/
 
 /* PTT and GTT */
-#define PXP_NUM_PF_WINDOWS		12
-#define PXP_PER_PF_ENTRY_SIZE		8
-#define PXP_NUM_GLOBAL_WINDOWS		243
-#define PXP_GLOBAL_ENTRY_SIZE		4
-#define PXP_ADMIN_WINDOW_ALLOWED_LENGTH	4
-#define PXP_PF_WINDOW_ADMIN_START	0
-#define PXP_PF_WINDOW_ADMIN_LENGTH	0x1000
+#define PXP_NUM_PF_WINDOWS                                  12
+#define PXP_PER_PF_ENTRY_SIZE                               8
+#define PXP_NUM_GLOBAL_WINDOWS                              243
+#define PXP_GLOBAL_ENTRY_SIZE                               4
+#define PXP_ADMIN_WINDOW_ALLOWED_LENGTH                     4
+#define PXP_PF_WINDOW_ADMIN_START                           0
+#define PXP_PF_WINDOW_ADMIN_LENGTH                          0x1000
 #define PXP_PF_WINDOW_ADMIN_END		(PXP_PF_WINDOW_ADMIN_START + \
 					 PXP_PF_WINDOW_ADMIN_LENGTH - 1)
-#define PXP_PF_WINDOW_ADMIN_PER_PF_START	0
+#define PXP_PF_WINDOW_ADMIN_PER_PF_START                    0
 #define PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH	(PXP_NUM_PF_WINDOWS * \
 						 PXP_PER_PF_ENTRY_SIZE)
 #define PXP_PF_WINDOW_ADMIN_PER_PF_END	(PXP_PF_WINDOW_ADMIN_PER_PF_START + \
-					 PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH - 1)
-#define PXP_PF_WINDOW_ADMIN_GLOBAL_START	0x200
+	 PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH - 1)
+#define PXP_PF_WINDOW_ADMIN_GLOBAL_START                    0x200
 #define PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH	(PXP_NUM_GLOBAL_WINDOWS * \
 						 PXP_GLOBAL_ENTRY_SIZE)
-#define PXP_PF_WINDOW_ADMIN_GLOBAL_END \
-		(PXP_PF_WINDOW_ADMIN_GLOBAL_START + \
-		 PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH - 1)
-#define PXP_PF_GLOBAL_PRETEND_ADDR	0x1f0
-#define PXP_PF_ME_OPAQUE_MASK_ADDR	0xf4
-#define PXP_PF_ME_OPAQUE_ADDR		0x1f8
-#define PXP_PF_ME_CONCRETE_ADDR		0x1fc
-
-#define PXP_EXTERNAL_BAR_PF_WINDOW_START	0x1000
-#define PXP_EXTERNAL_BAR_PF_WINDOW_NUM		PXP_NUM_PF_WINDOWS
-#define PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE	0x1000
-#define PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH \
-	(PXP_EXTERNAL_BAR_PF_WINDOW_NUM * \
+#define PXP_PF_WINDOW_ADMIN_GLOBAL_END                      \
+	(PXP_PF_WINDOW_ADMIN_GLOBAL_START +		    \
+	 PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH - 1)
+#define PXP_PF_GLOBAL_PRETEND_ADDR                          0x1f0
+#define PXP_PF_ME_OPAQUE_MASK_ADDR                          0xf4
+#define PXP_PF_ME_OPAQUE_ADDR                               0x1f8
+#define PXP_PF_ME_CONCRETE_ADDR                             0x1fc
+
+#define PXP_EXTERNAL_BAR_PF_WINDOW_START                    0x1000
+#define PXP_EXTERNAL_BAR_PF_WINDOW_NUM                      PXP_NUM_PF_WINDOWS
+#define PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE              0x1000
+#define PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH                   \
+	(PXP_EXTERNAL_BAR_PF_WINDOW_NUM *		    \
 	 PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE)
-#define PXP_EXTERNAL_BAR_PF_WINDOW_END \
-	(PXP_EXTERNAL_BAR_PF_WINDOW_START + \
+#define PXP_EXTERNAL_BAR_PF_WINDOW_END                      \
+	(PXP_EXTERNAL_BAR_PF_WINDOW_START +		    \
 	 PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH - 1)
 
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START                \
 	(PXP_EXTERNAL_BAR_PF_WINDOW_END + 1)
 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM		PXP_NUM_GLOBAL_WINDOWS
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE	0x1000
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH \
-	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM * \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE          0x1000
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH               \
+	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM *		    \
 	 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE)
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_END \
-	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START + \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_END                  \
+	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START +		    \
 	 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH - 1)
 
-#define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN	12
-#define PXP_ILT_BLOCK_FACTOR_MULTIPLIER	1024
+#define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN          12
+#define PXP_ILT_BLOCK_FACTOR_MULTIPLIER         1024
 
 /* ILT Records */
 #define PXP_NUM_ILT_RECORDS_BB 7600
@@ -301,10 +301,10 @@
 
 /* Async data KCQ CQE */
 struct async_data {
-	__le32	cid;
-	__le16	itid;
-	u8	error_code;
-	u8	fw_debug_param;
+	__le32 cid;
+	__le16 itid;
+	u8 error_code;
+	u8 fw_debug_param;
 };
 
 struct regpair {
@@ -359,12 +359,12 @@ struct event_ring_entry {
 	__le16			reserved0;
 	__le16			echo;
 	u8			fw_return_code;
-	u8			flags;
+	u8 flags;
 #define EVENT_RING_ENTRY_ASYNC_MASK      0x1
 #define EVENT_RING_ENTRY_ASYNC_SHIFT     0
 #define EVENT_RING_ENTRY_RESERVED1_MASK  0x7F
 #define EVENT_RING_ENTRY_RESERVED1_SHIFT 1
-	union event_ring_data	data;
+	union event_ring_data data;
 };
 
 /* Multi function mode */
@@ -444,8 +444,8 @@ struct core_db_data {
 #define CORE_DB_DATA_RESERVED_SHIFT    5
 #define CORE_DB_DATA_AGG_VAL_SEL_MASK  0x3
 #define CORE_DB_DATA_AGG_VAL_SEL_SHIFT 6
-	u8	agg_flags;
-	__le16	spq_prod;
+	u8 agg_flags;
+	__le16 spq_prod;
 };
 
 /* Enum of doorbell aggregative command selection */
@@ -479,10 +479,10 @@ struct db_legacy_addr {
 
 /* Igu interrupt command */
 enum igu_int_cmd {
-	IGU_INT_ENABLE	= 0,
+	IGU_INT_ENABLE = 0,
 	IGU_INT_DISABLE = 1,
-	IGU_INT_NOP	= 2,
-	IGU_INT_NOP2	= 3,
+	IGU_INT_NOP = 2,
+	IGU_INT_NOP2 = 3,
 	MAX_IGU_INT_CMD
 };
 
@@ -508,8 +508,8 @@ struct igu_prod_cons_update {
 
 /* Igu segments access for default status block only */
 enum igu_seg_access {
-	IGU_SEG_ACCESS_REG	= 0,
-	IGU_SEG_ACCESS_ATTN	= 1,
+	IGU_SEG_ACCESS_REG = 0,
+	IGU_SEG_ACCESS_ATTN = 1,
 	MAX_IGU_SEG_ACCESS
 };
 
@@ -574,13 +574,13 @@ struct pxp_pretend_concrete_fid {
 
 union pxp_pretend_fid {
 	struct pxp_pretend_concrete_fid concrete_fid;
-	__le16				opaque_fid;
+	__le16 opaque_fid;
 };
 
 /* Pxp Pretend Command Register. */
 struct pxp_pretend_cmd {
-	union pxp_pretend_fid	fid;
-	__le16			control;
+	union pxp_pretend_fid fid;
+	__le16 control;
 #define PXP_PRETEND_CMD_PATH_MASK              0x1
 #define PXP_PRETEND_CMD_PATH_SHIFT             0
 #define PXP_PRETEND_CMD_USE_PORT_MASK          0x1
@@ -603,30 +603,30 @@ struct pxp_pretend_cmd {
 
 /* PTT Record in PXP Admin Window. */
 struct pxp_ptt_entry {
-	__le32			offset;
+	__le32 offset;
 #define PXP_PTT_ENTRY_OFFSET_MASK     0x7FFFFF
 #define PXP_PTT_ENTRY_OFFSET_SHIFT    0
 #define PXP_PTT_ENTRY_RESERVED0_MASK  0x1FF
 #define PXP_PTT_ENTRY_RESERVED0_SHIFT 23
-	struct pxp_pretend_cmd	pretend;
+	struct pxp_pretend_cmd pretend;
 };
 
 /* RSS hash type */
 enum rss_hash_type {
-	RSS_HASH_TYPE_DEFAULT	= 0,
-	RSS_HASH_TYPE_IPV4	= 1,
-	RSS_HASH_TYPE_TCP_IPV4	= 2,
-	RSS_HASH_TYPE_IPV6	= 3,
-	RSS_HASH_TYPE_TCP_IPV6	= 4,
-	RSS_HASH_TYPE_UDP_IPV4	= 5,
-	RSS_HASH_TYPE_UDP_IPV6	= 6,
+	RSS_HASH_TYPE_DEFAULT = 0,
+	RSS_HASH_TYPE_IPV4 = 1,
+	RSS_HASH_TYPE_TCP_IPV4 = 2,
+	RSS_HASH_TYPE_IPV6 = 3,
+	RSS_HASH_TYPE_TCP_IPV6 = 4,
+	RSS_HASH_TYPE_UDP_IPV4 = 5,
+	RSS_HASH_TYPE_UDP_IPV6 = 6,
 	MAX_RSS_HASH_TYPE
 };
 
 /* status block structure */
 struct status_block {
-	__le16	pi_array[PIS_PER_SB];
-	__le32	sb_num;
+	__le16 pi_array[PIS_PER_SB];
+	__le32 sb_num;
 #define STATUS_BLOCK_SB_NUM_MASK      0x1FF
 #define STATUS_BLOCK_SB_NUM_SHIFT     0
 #define STATUS_BLOCK_ZERO_PAD_MASK    0x7F
drivers/net/qede/base/ecore.h +207 -207

617 lines not on this page · raw message

drivers/net/qede/base/ecore_chain.h +10 -10
index c573449..bc18c41 100644
@@ -129,7 +129,7 @@ struct ecore_chain {
 	   (1 + ((sizeof(struct ecore_chain_next) - 1) /		\
 	   (elem_size))) : 0)
 
-#define USABLE_ELEMS_PER_PAGE(elem_size, mode)			\
+#define USABLE_ELEMS_PER_PAGE(elem_size, mode)		\
 	((u32)(ELEMS_PER_PAGE(elem_size) -			\
 	UNUSABLE_ELEMS_PER_PAGE(elem_size, mode)))
 
@@ -183,7 +183,7 @@ static OSAL_INLINE u16 ecore_chain_get_elem_left(struct ecore_chain *p_chain)
 		     (u32)p_chain->u.chain16.cons_idx);
 	if (p_chain->mode == ECORE_CHAIN_MODE_NEXT_PTR)
 		used -= p_chain->u.chain16.prod_idx / p_chain->elem_per_page -
-		    p_chain->u.chain16.cons_idx / p_chain->elem_per_page;
+			p_chain->u.chain16.cons_idx / p_chain->elem_per_page;
 
 	return (u16)(p_chain->capacity - used);
 }
@@ -196,11 +196,11 @@ ecore_chain_get_elem_left_u32(struct ecore_chain *p_chain)
 	OSAL_ASSERT(is_chain_u32(p_chain));
 
 	used = (u32)(((u64)ECORE_U32_MAX + 1 +
-		       (u64)(p_chain->u.chain32.prod_idx)) -
-		      (u64)p_chain->u.chain32.cons_idx);
+		      (u64)(p_chain->u.chain32.prod_idx)) -
+		     (u64)p_chain->u.chain32.cons_idx);
 	if (p_chain->mode == ECORE_CHAIN_MODE_NEXT_PTR)
 		used -= p_chain->u.chain32.prod_idx / p_chain->elem_per_page -
-		    p_chain->u.chain32.cons_idx / p_chain->elem_per_page;
+			p_chain->u.chain32.cons_idx / p_chain->elem_per_page;
 
 	return p_chain->capacity - used;
 }
@@ -518,14 +518,14 @@ static OSAL_INLINE void ecore_chain_reset(struct ecore_chain *p_chain)
 	switch (p_chain->intended_use) {
 	case ECORE_CHAIN_USE_TO_CONSUME_PRODUCE:
 	case ECORE_CHAIN_USE_TO_PRODUCE:
-		/* Do nothing */
-		break;
+			/* Do nothing */
+			break;
 
 	case ECORE_CHAIN_USE_TO_CONSUME:
-		/* produce empty elements */
-		for (i = 0; i < p_chain->capacity; i++)
+			/* produce empty elements */
+			for (i = 0; i < p_chain->capacity; i++)
 			ecore_chain_recycle_consumed(p_chain);
-		break;
+			break;
 	}
 }
 
drivers/net/qede/base/ecore_cxt.c +8 -8
index 1201c1a..415d1c8 100644
@@ -807,8 +807,8 @@ static u32 ecore_cxt_ilt_shadow_size(struct ecore_ilt_client_cfg *ilt_clients)
 		if (!ilt_clients[i].active)
 			continue;
 		else
-			size += (ilt_clients[i].last.val -
-				ilt_clients[i].first.val + 1);
+		size += (ilt_clients[i].last.val -
+			 ilt_clients[i].first.val + 1);
 
 	return size;
 }
@@ -1027,8 +1027,8 @@ enum _ecore_status_t ecore_cxt_mngr_alloc(struct ecore_hwfn *p_hwfn)
 		p_mngr->clients[i].p_size.val = ILT_DEFAULT_HW_P_SIZE;
 
 	/* Initialize task sizes */
-	p_mngr->task_type_size[0] = 512;	/* @DPDK */
-	p_mngr->task_type_size[1] = 128;	/* @DPDK */
+	p_mngr->task_type_size[0] = 512; /* @DPDK */
+	p_mngr->task_type_size[1] = 128; /* @DPDK */
 
 	p_mngr->vf_count = p_hwfn->p_dev->sriov_info.total_vfs;
 	/* Set the cxt mangr pointer priori to further allocations */
@@ -1383,11 +1383,11 @@ static void ecore_ilt_vf_bounds_init(struct ecore_hwfn *p_hwfn)
 	u32 blk_factor;
 
 	/* For simplicty  we set the 'block' to be an ILT page */
-	STORE_RT_REG(p_hwfn,
-		     PSWRQ2_REG_VF_BASE_RT_OFFSET,
+		STORE_RT_REG(p_hwfn,
+			     PSWRQ2_REG_VF_BASE_RT_OFFSET,
 		     p_hwfn->hw_info.first_vf_in_pf);
-	STORE_RT_REG(p_hwfn,
-		     PSWRQ2_REG_VF_LAST_ILT_RT_OFFSET,
+		STORE_RT_REG(p_hwfn,
+			     PSWRQ2_REG_VF_LAST_ILT_RT_OFFSET,
 		     p_hwfn->hw_info.first_vf_in_pf +
 		     p_hwfn->p_dev->sriov_info.total_vfs);
 
drivers/net/qede/base/ecore_cxt_api.h +5 -5
index d98dddb..90aff3e 100644
@@ -12,9 +12,9 @@
 struct ecore_hwfn;
 
 struct ecore_cxt_info {
-	void *p_cxt;
-	u32 iid;
-	enum protocol_type type;
+	void			*p_cxt;
+	u32			iid;
+	enum protocol_type	type;
 };
 
 #define MAX_TID_BLOCKS			512
@@ -22,7 +22,7 @@ struct ecore_tid_mem {
 	u32 tid_size;
 	u32 num_tids_per_block;
 	u32 waste;
-	u8 *blocks[MAX_TID_BLOCKS];	/* 4K */
+	u8 *blocks[MAX_TID_BLOCKS]; /* 4K */
 };
 
 static OSAL_INLINE void *get_task_mem(struct ecore_tid_mem *info, u32 tid)
@@ -49,7 +49,7 @@ static OSAL_INLINE void *get_task_mem(struct ecore_tid_mem *info, u32 tid)
 *
 * @return enum _ecore_status_t
 */
-enum _ecore_status_t ecore_cxt_acquire_cid(struct ecore_hwfn *p_hwfn,
+enum _ecore_status_t ecore_cxt_acquire_cid(struct ecore_hwfn  *p_hwfn,
 					   enum protocol_type type,
 					   u32 *p_cid);
 
drivers/net/qede/base/ecore_dcbx.c +2 -2
index 6a966cb..18843c4 100644
@@ -116,8 +116,8 @@ ecore_dcbx_set_pf_tcs(struct ecore_hw_info *p_info,
 		if (personality == ECORE_PCI_ETH)
 			p_info->non_offload_tc = tc;
 		else
-			p_info->offload_tc = tc;
-	}
+		p_info->offload_tc = tc;
+}
 }
 
 void
drivers/net/qede/base/ecore_dcbx_api.h +13 -13
index 7767d48..7cd8ee0 100644
@@ -53,10 +53,10 @@ enum dcbx_protocol_type {
 struct ecore_dcbx_lldp_remote {
 	u32 peer_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
 	u32 peer_port_id[LLDP_PORT_ID_STAT_LEN];
-	bool enable_rx;
-	bool enable_tx;
-	u32 tx_interval;
-	u32 max_credit;
+	bool	enable_rx;
+	bool	enable_tx;
+	u32     tx_interval;
+	u32     max_credit;
 };
 
 struct ecore_dcbx_lldp_local {
@@ -65,17 +65,17 @@ struct ecore_dcbx_lldp_local {
 };
 
 struct ecore_dcbx_app_prio {
-	u8 eth;
+	u8	eth;
 };
 
 struct ecore_dcbx_params {
 	u32 app_bitmap[DCBX_MAX_APP_PROTOCOL];
-	u16 num_app_entries;
-	bool app_willing;
-	bool app_valid;
-	bool ets_willing;
-	bool ets_enabled;
-	bool valid;		/* Indicate validity of params */
+	u16	num_app_entries;
+	bool	app_willing;
+	bool	app_valid;
+	bool	ets_willing;
+	bool	ets_enabled;
+	bool	valid;          /* Indicate validity of params */
 	u32 ets_pri_tc_tbl[1];
 	u32 ets_tc_bw_tbl[2];
 	u32 ets_tc_tsa_tbl[2];
@@ -83,7 +83,7 @@ struct ecore_dcbx_params {
 	bool pfc_enabled;
 	u32 pfc_bitmap;
 	u8 max_pfc_tc;
-	u8 max_ets_tc;
+	u8	max_ets_tc;
 };
 
 struct ecore_dcbx_admin_params {
@@ -129,7 +129,7 @@ struct ecore_dcbx_results {
 
 struct ecore_dcbx_app_metadata {
 	enum dcbx_protocol_type id;
-	const char *name;	/* @DPDK */
+	const char *name; /* @DPDK */
 	enum ecore_pci_personality personality;
 };
 
drivers/net/qede/base/ecore_dev.c +56 -56

329 lines not on this page · raw message

drivers/net/qede/base/ecore_dev_api.h +36 -36

120 lines not on this page · raw message

drivers/net/qede/base/ecore_gtt_reg_addr.h +10 -10
index cc49fc7..0eba1aa 100644
@@ -10,33 +10,33 @@
 #define GTT_REG_ADDR_H
 
 /* Win 2 */
-#define GTT_BAR0_MAP_REG_IGU_CMD 0x00f000UL
+#define GTT_BAR0_MAP_REG_IGU_CMD                                      0x00f000UL
 
 /* Win 3 */
-#define GTT_BAR0_MAP_REG_TSDM_RAM 0x010000UL
+#define GTT_BAR0_MAP_REG_TSDM_RAM                                     0x010000UL
 
 /* Win 4 */
-#define GTT_BAR0_MAP_REG_MSDM_RAM 0x011000UL
+#define GTT_BAR0_MAP_REG_MSDM_RAM                                     0x011000UL
 
 /* Win 5 */
-#define GTT_BAR0_MAP_REG_MSDM_RAM_1024 0x012000UL
+#define GTT_BAR0_MAP_REG_MSDM_RAM_1024                                0x012000UL
 
 /* Win 6 */
-#define GTT_BAR0_MAP_REG_USDM_RAM 0x013000UL
+#define GTT_BAR0_MAP_REG_USDM_RAM                                     0x013000UL
 
 /* Win 7 */
-#define GTT_BAR0_MAP_REG_USDM_RAM_1024 0x014000UL
+#define GTT_BAR0_MAP_REG_USDM_RAM_1024                                0x014000UL
 
 /* Win 8 */
-#define GTT_BAR0_MAP_REG_USDM_RAM_2048 0x015000UL
+#define GTT_BAR0_MAP_REG_USDM_RAM_2048                                0x015000UL
 
 /* Win 9 */
-#define GTT_BAR0_MAP_REG_XSDM_RAM  0x016000UL
+#define GTT_BAR0_MAP_REG_XSDM_RAM                                     0x016000UL
 
 /* Win 10 */
-#define GTT_BAR0_MAP_REG_YSDM_RAM 0x017000UL
+#define GTT_BAR0_MAP_REG_YSDM_RAM                                     0x017000UL
 
 /* Win 11 */
-#define GTT_BAR0_MAP_REG_PSDM_RAM 0x018000UL
+#define GTT_BAR0_MAP_REG_PSDM_RAM                                     0x018000UL
 
 #endif
drivers/net/qede/base/ecore_gtt_values.h +10 -10
index f2efe24..2ddc5f1 100644
@@ -11,16 +11,16 @@
 static u32 pxp_global_win[] = {
 	0,
 	0,
-	0x1c02,			/* win 2: addr=0x1c02000, size=4096 bytes */
-	0x1c80,			/* win 3: addr=0x1c80000, size=4096 bytes */
-	0x1d00,			/* win 4: addr=0x1d00000, size=4096 bytes */
-	0x1d01,			/* win 5: addr=0x1d01000, size=4096 bytes */
-	0x1d80,			/* win 6: addr=0x1d80000, size=4096 bytes */
-	0x1d81,			/* win 7: addr=0x1d81000, size=4096 bytes */
-	0x1d82,			/* win 8: addr=0x1d82000, size=4096 bytes */
-	0x1e00,			/* win 9: addr=0x1e00000, size=4096 bytes */
-	0x1e80,			/* win 10: addr=0x1e80000, size=4096 bytes */
-	0x1f00,			/* win 11: addr=0x1f00000, size=4096 bytes */
+	0x1c02, /* win 2: addr=0x1c02000, size=4096 bytes */
+	0x1c80, /* win 3: addr=0x1c80000, size=4096 bytes */
+	0x1d00, /* win 4: addr=0x1d00000, size=4096 bytes */
+	0x1d01, /* win 5: addr=0x1d01000, size=4096 bytes */
+	0x1d80, /* win 6: addr=0x1d80000, size=4096 bytes */
+	0x1d81, /* win 7: addr=0x1d81000, size=4096 bytes */
+	0x1d82, /* win 8: addr=0x1d82000, size=4096 bytes */
+	0x1e00, /* win 9: addr=0x1e00000, size=4096 bytes */
+	0x1e80, /* win 10: addr=0x1e80000, size=4096 bytes */
+	0x1f00, /* win 11: addr=0x1f00000, size=4096 bytes */
 	0,
 	0,
 	0,
drivers/net/qede/base/ecore_hsi_common.h +3 -3
index 9cd55c4..877de8b 100644
@@ -953,7 +953,7 @@ enum malicious_vf_error_id {
 	VF_ZONE_MSG_NOT_VALID /* VF channel message is not valid */,
 	VF_ZONE_FUNC_NOT_ENABLED /* Parent PF of VF channel is not active */,
 	ETH_PACKET_TOO_SMALL
-	    /* TX packet is shorter then reported on BDs or from minimal size */
+/* TX packet is shorter then reported on BDs or from minimal size */
 	    ,
 	ETH_ILLEGAL_VLAN_MODE
 	    /* Tx packet with marked as insert VLAN when its illegal */,
@@ -1060,7 +1060,7 @@ struct pf_start_ramrod_data {
 	u8 allow_npar_tx_switching;
 	u8 inner_to_outer_pri_map[8];
 	u8 pri_map_valid
-	    /* If inner_to_outer_pri_map is initialize then set pri_map_valid */
+/* If inner_to_outer_pri_map is initialize then set pri_map_valid */
 	  ;
 	__le32 outer_tag;
 	u8 reserved0[4];
@@ -1244,7 +1244,7 @@ enum tunnel_clss {
 	TUNNEL_CLSS_MAC_VNI
 	    ,
 	TUNNEL_CLSS_INNER_MAC_VLAN
-	    /* Use MAC and VLAN from last L2 header for vport classification */
+/* Use MAC and VLAN from last L2 header for vport classification */
 	    ,
 	TUNNEL_CLSS_INNER_MAC_VNI
 	    ,
drivers/net/qede/base/ecore_hsi_eth.h +4 -4
index 80f4165..78cc55d 100644
@@ -872,7 +872,7 @@ struct eth_vport_tpa_param {
 	u8 tpa_ipv6_tunn_en_flg /* Enable TPA for IPv6 over tunnel */;
 	u8 tpa_pkt_split_flg;
 	u8 tpa_hdr_data_split_flg
-	    /* If set, put header of first TPA segment on bd and data on SGE */
+/* If set, put header of first TPA segment on bd and data on SGE */
 	   ;
 	u8 tpa_gro_consistent_flg
 	    /* If set, GRO data consistent will checked for TPA continue */;
@@ -882,10 +882,10 @@ struct eth_vport_tpa_param {
 	__le16 tpa_min_size_to_start
 	    /* minimum TCP payload size for a packet to start aggregation */;
 	__le16 tpa_min_size_to_cont
-	    /* minimum TCP payload size for a packet to continue aggregation */
+/* minimum TCP payload size for a packet to continue aggregation */
 	   ;
 	u8 max_buff_num
-	    /* maximal number of buffers that can be used for one aggregation */
+/* maximal number of buffers that can be used for one aggregation */
 	   ;
 	u8 reserved;
 };
@@ -1124,7 +1124,7 @@ struct vport_start_ramrod_data {
 	u8 handle_ptp_pkts /* If set, the vport handles PTP Timesync Packets */
 	   ;
 	u8 silent_vlan_removal_en;
-	/* If enable then innerVlan will be striped and not written to cqe */
+/* If enable then innerVlan will be striped and not written to cqe */
 	u8 untagged;
 	struct eth_tx_err_vals tx_err_behav
 	    /* Desired behavior per TX error type */;
drivers/net/qede/base/ecore_hw.c +7 -7
index 5403b94..e9b96d5 100644
@@ -108,15 +108,15 @@ struct ecore_ptt *ecore_ptt_acquire(struct ecore_hwfn *p_hwfn)
 	}
 
 	p_ptt = OSAL_LIST_FIRST_ENTRY(&p_hwfn->p_ptt_pool->free_list,
-				      struct ecore_ptt, list_entry);
-	OSAL_LIST_REMOVE_ENTRY(&p_ptt->list_entry,
-			       &p_hwfn->p_ptt_pool->free_list);
-	OSAL_SPIN_UNLOCK(&p_hwfn->p_ptt_pool->lock);
+						struct ecore_ptt, list_entry);
+			OSAL_LIST_REMOVE_ENTRY(&p_ptt->list_entry,
+					       &p_hwfn->p_ptt_pool->free_list);
+			OSAL_SPIN_UNLOCK(&p_hwfn->p_ptt_pool->lock);
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_HW, "allocated ptt %d\n", p_ptt->idx);
 
-	return p_ptt;
-}
+			return p_ptt;
+		}
 
 void ecore_ptt_release(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt)
 {
@@ -298,7 +298,7 @@ void ecore_fid_pretend(struct ecore_hwfn *p_hwfn,
 	SET_FIELD(control, PXP_PRETEND_CMD_IS_CONCRETE, 1);
 	SET_FIELD(control, PXP_PRETEND_CMD_PRETEND_FUNCTION, 1);
 
-	/* Every pretend undos prev pretends, including previous port pretend */
+/* Every pretend undos prev pretends, including previous port pretend */
 	SET_FIELD(control, PXP_PRETEND_CMD_PORT, 0);
 	SET_FIELD(control, PXP_PRETEND_CMD_USE_PORT, 0);
 	SET_FIELD(control, PXP_PRETEND_CMD_PRETEND_PORT, 1);
drivers/net/qede/base/ecore_hw.h +14 -14
index 8949944..9603c99 100644
@@ -115,7 +115,7 @@ u32 ecore_ptt_get_hw_addr(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
  *
  * @return u32
  */
-u32 ecore_ptt_get_bar_addr(struct ecore_ptt *p_ptt);
+u32 ecore_ptt_get_bar_addr(struct ecore_ptt	*p_ptt);
 
 /**
  * @brief ecore_ptt_set_win - Set PTT Window's GRC BAR address
@@ -124,7 +124,7 @@ u32 ecore_ptt_get_bar_addr(struct ecore_ptt *p_ptt);
  * @param new_hw_addr
  * @param p_ptt
  */
-void ecore_ptt_set_win(struct ecore_hwfn *p_hwfn,
+void ecore_ptt_set_win(struct ecore_hwfn	*p_hwfn,
 		       struct ecore_ptt *p_ptt, u32 new_hw_addr);
 
 /**
@@ -135,8 +135,8 @@ void ecore_ptt_set_win(struct ecore_hwfn *p_hwfn,
  *
  * @return struct ecore_ptt *
  */
-struct ecore_ptt *ecore_get_reserved_ptt(struct ecore_hwfn *p_hwfn,
-					 enum reserved_ptts ptt_idx);
+struct ecore_ptt *ecore_get_reserved_ptt(struct ecore_hwfn	*p_hwfn,
+					 enum reserved_ptts	ptt_idx);
 
 /**
  * @brief ecore_wr - Write value to BAR using the given ptt
@@ -146,7 +146,7 @@ struct ecore_ptt *ecore_get_reserved_ptt(struct ecore_hwfn *p_hwfn,
  * @param val
  * @param hw_addr
  */
-void ecore_wr(struct ecore_hwfn *p_hwfn,
+void ecore_wr(struct ecore_hwfn	*p_hwfn,
 	      struct ecore_ptt *p_ptt, u32 hw_addr, u32 val);
 
 /**
@@ -169,8 +169,8 @@ u32 ecore_rd(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 hw_addr);
  * @param hw_addr
  * @param n
  */
-void ecore_memcpy_from(struct ecore_hwfn *p_hwfn,
-		       struct ecore_ptt *p_ptt,
+void ecore_memcpy_from(struct ecore_hwfn	*p_hwfn,
+		       struct ecore_ptt		*p_ptt,
 		       void *dest, u32 hw_addr, osal_size_t n);
 
 /**
@@ -183,8 +183,8 @@ void ecore_memcpy_from(struct ecore_hwfn *p_hwfn,
  * @param src
  * @param n
  */
-void ecore_memcpy_to(struct ecore_hwfn *p_hwfn,
-		     struct ecore_ptt *p_ptt,
+void ecore_memcpy_to(struct ecore_hwfn	*p_hwfn,
+		     struct ecore_ptt	*p_ptt,
 		     u32 hw_addr, void *src, osal_size_t n);
 /**
  * @brief ecore_fid_pretend - pretend to another function when
@@ -197,7 +197,7 @@ void ecore_memcpy_to(struct ecore_hwfn *p_hwfn,
  * @param fid - fid field of pxp_pretend structure. Can contain
  *            either pf / vf, port/path fields are don't care.
  */
-void ecore_fid_pretend(struct ecore_hwfn *p_hwfn,
+void ecore_fid_pretend(struct ecore_hwfn	*p_hwfn,
 		       struct ecore_ptt *p_ptt, u16 fid);
 
 /**
@@ -208,7 +208,7 @@ void ecore_fid_pretend(struct ecore_hwfn *p_hwfn,
  * @param p_ptt
  * @param port_id - the port to pretend to
  */
-void ecore_port_pretend(struct ecore_hwfn *p_hwfn,
+void ecore_port_pretend(struct ecore_hwfn	*p_hwfn,
 			struct ecore_ptt *p_ptt, u8 port_id);
 
 /**
@@ -235,7 +235,7 @@ u32 ecore_vfid_to_concrete(struct ecore_hwfn *p_hwfn, u8 vfid);
 * which is part of p_hwfn.
 * @param p_hwfn
 */
-enum _ecore_status_t ecore_dmae_info_alloc(struct ecore_hwfn *p_hwfn);
+enum _ecore_status_t ecore_dmae_info_alloc(struct ecore_hwfn	*p_hwfn);
 
 /**
 * @brief ecore_dmae_info_free - Free the dmae_info structure
@@ -243,7 +243,7 @@ enum _ecore_status_t ecore_dmae_info_alloc(struct ecore_hwfn *p_hwfn);
 *
 * @param p_hwfn
 */
-void ecore_dmae_info_free(struct ecore_hwfn *p_hwfn);
+void ecore_dmae_info_free(struct ecore_hwfn	*p_hwfn);
 
 union ecore_qm_pq_params {
 	struct {
@@ -257,7 +257,7 @@ union ecore_qm_pq_params {
 	} eth;
 };
 
-u16 ecore_get_qm_pq(struct ecore_hwfn *p_hwfn,
+u16 ecore_get_qm_pq(struct ecore_hwfn	*p_hwfn,
 		    enum protocol_type proto, union ecore_qm_pq_params *params);
 
 enum _ecore_status_t ecore_init_fw_data(struct ecore_dev *p_dev,
drivers/net/qede/base/ecore_hw_defs.h +3 -3
index fa518ce..19816ff 100644
@@ -36,13 +36,13 @@ enum igu_ctrl_cmd {
  */
 struct igu_ctrl_reg {
 	u32 ctrl_data;
-#define IGU_CTRL_REG_FID_MASK		0xFFFF	/* Opaque_FID     */
+#define IGU_CTRL_REG_FID_MASK		0xFFFF /* Opaque_FID	 */
 #define IGU_CTRL_REG_FID_SHIFT		0
-#define IGU_CTRL_REG_PXP_ADDR_MASK	0xFFF	/* Command address */
+#define IGU_CTRL_REG_PXP_ADDR_MASK	0xFFF /* Command address */
 #define IGU_CTRL_REG_PXP_ADDR_SHIFT	16
 #define IGU_CTRL_REG_RESERVED_MASK	0x1
 #define IGU_CTRL_REG_RESERVED_SHIFT	28
-#define IGU_CTRL_REG_TYPE_MASK		0x1	/* use enum igu_ctrl_cmd */
+#define IGU_CTRL_REG_TYPE_MASK		0x1 /* use enum igu_ctrl_cmd */
 #define IGU_CTRL_REG_TYPE_SHIFT		31
 };
 
drivers/net/qede/base/ecore_init_fw_funcs.c +6 -6
index 5440731..0844194 100644
@@ -206,7 +206,7 @@ static void ecore_cmdq_lines_rt_init(struct ecore_hwfn *p_hwfn,
 			for (tc = 0; tc < NUM_OF_PHYS_TCS; tc++) {
 				if (((port_params[port_id].active_phys_tcs >>
 						tc) & 0x1) == 1)
-				num_tcs_in_port++;
+					num_tcs_in_port++;
 			}
 			phys_lines_per_tc = phys_lines / num_tcs_in_port;
 			/* init registers per active TC */
@@ -293,9 +293,9 @@ static void ecore_btb_blocks_rt_init(struct ecore_hwfn *p_hwfn,
 			     tc < NUM_OF_PHYS_TCS;
 			     tc++) {
 				if (((port_params[port_id].active_phys_tcs >>
-							 tc) & 0x1) == 1) {
+							tc) & 0x1) == 1) {
 					voq = PHYS_VOQ(port_id, tc,
-							max_phys_tcs_per_port);
+						       max_phys_tcs_per_port);
 					STORE_RT_REG(p_hwfn,
 					     PBF_BTB_GUARANTEED_RT_OFFSET(voq),
 					     phys_blocks);
@@ -412,7 +412,7 @@ static void ecore_tx_pq_map_rt_init(struct ecore_hwfn *p_hwfn,
 				u32 curr_mask =
 				    is_first_pf ? 0 : ecore_rd(p_hwfn, p_ptt,
 						       QM_REG_MAXPQSIZETXSEL_0
-							       + i * 4);
+								+ i * 4);
 				STORE_RT_REG(p_hwfn,
 					     QM_REG_MAXPQSIZETXSEL_0_RT_OFFSET +
 					     i, curr_mask | tx_pq_vf_mask[i]);
@@ -518,8 +518,8 @@ static int ecore_vp_wfq_rt_init(struct ecore_hwfn *p_hwfn,
 				    vport_params[i].first_tx_pq_id[tc];
 				if (vport_pq_id != QM_INVALID_PQ_ID) {
 					STORE_RT_REG(p_hwfn,
-						     QM_REG_WFQVPCRD_RT_OFFSET +
-						     vport_pq_id,
+						  QM_REG_WFQVPCRD_RT_OFFSET +
+						  vport_pq_id,
 						     QM_WFQ_CRD_REG_SIGN_BIT);
 					STORE_RT_REG(p_hwfn,
 						QM_REG_WFQVPWEIGHT_RT_OFFSET
drivers/net/qede/base/ecore_init_fw_funcs.h +34 -34

120 lines not on this page · raw message

drivers/net/qede/base/ecore_init_ops.c +2 -2
index e6e4c36..71bad30 100644
@@ -251,9 +251,9 @@ static enum _ecore_status_t ecore_init_cmd_array(struct ecore_hwfn *p_hwfn,
 							   b_can_dmae);
 				if (rc)
 					break;
-			}
-			break;
 		}
+		break;
+	}
 	case INIT_ARR_STANDARD:
 		size = GET_FIELD(data, INIT_ARRAY_STANDARD_HDR_SIZE);
 		rc = ecore_init_array_dmae(p_hwfn, p_ptt, addr,
drivers/net/qede/base/ecore_int.c +7 -7
index bed9ea3..e4c002a 100644
@@ -100,7 +100,7 @@ static enum _ecore_status_t ecore_mcp_attn_cb(struct ecore_hwfn *p_hwfn)
 #define ECORE_PSWHST_ATTNETION_DISABLED_WRITE_SHIFT	(0)
 #define ECORE_PSWHST_ATTENTION_VF_DISABLED		(0x1)
 #define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS		(0x1)
-#define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS_WR_MASK	(0x1)
+#define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS_WR_MASK		(0x1)
 #define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS_WR_SHIFT	(0)
 #define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS_CLIENT_MASK	(0x1e)
 #define ECORE_PSWHST_ATTENTION_INCORRECT_ACCESS_CLIENT_SHIFT	(1)
@@ -1138,7 +1138,7 @@ void ecore_int_sp_dpc(osal_int_ptr_t hwfn_cookie)
 		return;
 	}
 
-	/* Check the validity of the DPC ptt. If not ack interrupts and fail */
+/* Check the validity of the DPC ptt. If not ack interrupts and fail */
 	if (!p_hwfn->p_dpc_ptt) {
 		DP_NOTICE(p_hwfn->p_dev, true, "Failed to allocate PTT\n");
 		ecore_sb_ack(sb_info, IGU_INT_ENABLE, 1);
@@ -1676,7 +1676,7 @@ static void ecore_int_igu_enable_attn(struct ecore_hwfn *p_hwfn,
 
 enum _ecore_status_t
 ecore_int_igu_enable(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
-		     enum ecore_int_mode int_mode)
+			  enum ecore_int_mode int_mode)
 {
 	enum _ecore_status_t rc = ECORE_SUCCESS;
 	u32 tmp;
@@ -2102,10 +2102,10 @@ u16 ecore_int_queue_id_from_sb_id(struct ecore_hwfn *p_hwfn, u16 sb_id)
 		return sb_id - p_info->igu_base_sb_iov + p_info->igu_sb_cnt;
 	}
 
-	DP_NOTICE(p_hwfn, true, "SB %d not in range for function\n",
-		  sb_id);
-	return 0;
-}
+		DP_NOTICE(p_hwfn, true, "SB %d not in range for function\n",
+			  sb_id);
+		return 0;
+	}
 
 void ecore_int_disable_post_isr_release(struct ecore_dev *p_dev)
 {
drivers/net/qede/base/ecore_int.h +2 -2
index 17c9521..eeec8ca 100644
@@ -169,8 +169,8 @@ void ecore_int_cau_conf_sb(struct ecore_hwfn *p_hwfn,
 *
 * @return enum _ecore_status_t
 */
-enum _ecore_status_t ecore_int_alloc(struct ecore_hwfn *p_hwfn,
-				     struct ecore_ptt *p_ptt);
+enum _ecore_status_t ecore_int_alloc(struct ecore_hwfn	*p_hwfn,
+				     struct ecore_ptt	*p_ptt);
 
 /**
 * @brief ecore_int_free
drivers/net/qede/base/ecore_iov_api.h +23 -23

82 lines not on this page · raw message

drivers/net/qede/base/ecore_iro.h +6 -6
index dd53ea9..7cabdf7 100644
@@ -10,24 +10,24 @@
 #define __IRO_H__
 
 /* Ystorm flow control mode. Use enum fw_flow_ctrl_mode */
-#define YSTORM_FLOW_CONTROL_MODE_OFFSET		(IRO[0].base)
-#define YSTORM_FLOW_CONTROL_MODE_SIZE		(IRO[0].size)
+#define YSTORM_FLOW_CONTROL_MODE_OFFSET (IRO[0].base)
+#define YSTORM_FLOW_CONTROL_MODE_SIZE (IRO[0].size)
 /* Tstorm port statistics */
 #define TSTORM_PORT_STAT_OFFSET(port_id) \
 (IRO[1].base + ((port_id) * IRO[1].m1))
-#define TSTORM_PORT_STAT_SIZE			(IRO[1].size)
+#define TSTORM_PORT_STAT_SIZE (IRO[1].size)
 /* Ustorm VF-PF Channel ready flag */
 #define USTORM_VF_PF_CHANNEL_READY_OFFSET(vf_id) \
 (IRO[3].base + ((vf_id) * IRO[3].m1))
-#define USTORM_VF_PF_CHANNEL_READY_SIZE		(IRO[3].size)
+#define USTORM_VF_PF_CHANNEL_READY_SIZE (IRO[3].size)
 /* Ustorm Final flr cleanup ack */
 #define USTORM_FLR_FINAL_ACK_OFFSET(pf_id) \
 (IRO[4].base + ((pf_id) * IRO[4].m1))
-#define USTORM_FLR_FINAL_ACK_SIZE		(IRO[4].size)
+#define USTORM_FLR_FINAL_ACK_SIZE (IRO[4].size)
 /* Ustorm Event ring consumer */
 #define USTORM_EQE_CONS_OFFSET(pf_id) \
 (IRO[5].base + ((pf_id) * IRO[5].m1))
-#define USTORM_EQE_CONS_SIZE			(IRO[5].size)
+#define USTORM_EQE_CONS_SIZE (IRO[5].size)
 /* Ustorm Common Queue ring consumer */
 #define USTORM_COMMON_QUEUE_CONS_OFFSET(global_queue_id) \
 (IRO[6].base + ((global_queue_id) * IRO[6].m1))
drivers/net/qede/base/ecore_iro_values.h +16 -16
index c818b58..548ad14 100644
@@ -10,49 +10,49 @@
 #define __IRO_VALUES_H__
 
 static const struct iro iro_arr[44] = {
-	{0x0, 0x0, 0x0, 0x0, 0x8},
+	{      0x0,      0x0,      0x0,      0x0,      0x8},
 	{0x4db0, 0x60, 0x0, 0x0, 0x60},
 	{0x6418, 0x20, 0x0, 0x0, 0x20},
 	{0x500, 0x8, 0x0, 0x0, 0x4},
 	{0x480, 0x8, 0x0, 0x0, 0x4},
-	{0x0, 0x8, 0x0, 0x0, 0x2},
+	{      0x0,      0x8,      0x0,      0x0,      0x2},
 	{0x80, 0x8, 0x0, 0x0, 0x2},
 	{0x4938, 0x0, 0x0, 0x0, 0x78},
-	{0x3df0, 0x0, 0x0, 0x0, 0x78},
-	{0x29b0, 0x0, 0x0, 0x0, 0x78},
+	{   0x3df0,      0x0,      0x0,      0x0,     0x78},
+	{   0x29b0,      0x0,      0x0,      0x0,     0x78},
 	{0x4d38, 0x0, 0x0, 0x0, 0x78},
 	{0x56c8, 0x0, 0x0, 0x0, 0x78},
-	{0x7e48, 0x0, 0x0, 0x0, 0x78},
-	{0xa28, 0x8, 0x0, 0x0, 0x8},
+	{   0x7e48,      0x0,      0x0,      0x0,     0x78},
+	{    0xa28,      0x8,      0x0,      0x0,      0x8},
 	{0x61f8, 0x10, 0x0, 0x0, 0x10},
 	{0xb500, 0x30, 0x0, 0x0, 0x30},
-	{0x95b8, 0x30, 0x0, 0x0, 0x30},
+	{   0x95b8,     0x30,      0x0,      0x0,     0x30},
 	{0x5898, 0x40, 0x0, 0x0, 0x40},
 	{0x1f8, 0x10, 0x0, 0x0, 0x8},
 	{0xa228, 0x0, 0x0, 0x0, 0x4},
-	{0x8050, 0x40, 0x0, 0x0, 0x30},
+	{   0x8050,     0x40,      0x0,      0x0,     0x30},
 	{0xcf8, 0x8, 0x0, 0x0, 0x8},
-	{0x2b48, 0x80, 0x0, 0x0, 0x38},
+	{   0x2b48,     0x80,      0x0,      0x0,     0x38},
 	{0xadf0, 0x0, 0x0, 0x0, 0xf0},
 	{0xaee0, 0x8, 0x0, 0x0, 0x8},
 	{0x80, 0x8, 0x0, 0x0, 0x8},
-	{0xac0, 0x8, 0x0, 0x0, 0x8},
-	{0x2578, 0x8, 0x0, 0x0, 0x8},
-	{0x24f8, 0x8, 0x0, 0x0, 0x8},
-	{0x0, 0x8, 0x0, 0x0, 0x8},
-	{0x200, 0x10, 0x8, 0x0, 0x8},
+	{    0xac0,      0x8,      0x0,      0x0,      0x8},
+	{   0x2578,      0x8,      0x0,      0x0,      0x8},
+	{   0x24f8,      0x8,      0x0,      0x0,      0x8},
+	{      0x0,      0x8,      0x0,      0x0,      0x8},
+	{    0x200,     0x10,      0x8,      0x0,      0x8},
 	{0x17f8, 0x8, 0x0, 0x0, 0x2},
 	{0x19f8, 0x10, 0x8, 0x0, 0x2},
 	{0xd988, 0x38, 0x0, 0x0, 0x24},
 	{0x11040, 0x10, 0x0, 0x0, 0x8},
 	{0x11670, 0x38, 0x0, 0x0, 0x18},
 	{0xaeb8, 0x30, 0x0, 0x0, 0x10},
-	{0x86f8, 0x28, 0x0, 0x0, 0x18},
+	{   0x86f8,     0x28,      0x0,      0x0,     0x18},
 	{0xebf8, 0x10, 0x0, 0x0, 0x10},
 	{0xde08, 0x40, 0x0, 0x0, 0x30},
 	{0x121a0, 0x38, 0x0, 0x0, 0x8},
 	{0xf060, 0x20, 0x0, 0x0, 0x20},
-	{0x2b80, 0x80, 0x0, 0x0, 0x10},
+	{   0x2b80,     0x80,      0x0,      0x0,     0x10},
 	{0x50a0, 0x10, 0x0, 0x0, 0x10},
 };
 
drivers/net/qede/base/ecore_l2.c +9 -9
index 9e6ef5a..b31523b 100644
@@ -234,7 +234,7 @@ ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn,
 
 		SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_DROP_ALL,
 			  !(!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) ||
-			    !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED)));
+			   !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED)));
 
 		SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_ACCEPT_UNMATCHED,
 			  !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED));
@@ -429,7 +429,7 @@ ecore_sp_vport_update(struct ecore_hwfn *p_hwfn,
 
 	rc = ecore_sp_vport_update_rss(p_hwfn, p_ramrod, p_rss_params);
 	if (rc != ECORE_SUCCESS) {
-		/* Return spq entry which is taken in ecore_sp_init_request() */
+		/* Return spq entry which is taken in ecore_sp_init_request()*/
 		ecore_spq_return_entry(p_hwfn, p_ent);
 		return rc;
 	}
@@ -632,7 +632,7 @@ enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
 						 dma_addr_t bd_chain_phys_addr,
 						 dma_addr_t cqe_pbl_addr,
 						 u16 cqe_pbl_size,
-						 void OSAL_IOMEM * *pp_prod)
+						 void OSAL_IOMEM **pp_prod)
 {
 	struct ecore_hw_cid_data *p_rx_cid = &p_hwfn->p_rx_cids[rx_queue_id];
 	u8 abs_stats_id = 0;
@@ -788,7 +788,7 @@ ecore_sp_eth_rx_queue_stop(struct ecore_hwfn *p_hwfn,
 	 * In addition, VFs require the answer to come as eqe to PF.
 	 */
 	p_ramrod->complete_cqe_flg = (!!(p_rx_cid->opaque_fid ==
-					  p_hwfn->hw_info.opaque_fid) &&
+					 p_hwfn->hw_info.opaque_fid) &&
 				      !eq_completion_only) || cqe_completion;
 	p_ramrod->complete_event_flg = !(p_rx_cid->opaque_fid ==
 					 p_hwfn->hw_info.opaque_fid) ||
@@ -876,7 +876,7 @@ enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
 						 u8 sb_index,
 						 dma_addr_t pbl_addr,
 						 u16 pbl_size,
-						 void OSAL_IOMEM * *pp_doorbell)
+						 void OSAL_IOMEM **pp_doorbell)
 {
 	struct ecore_hw_cid_data *p_tx_cid = &p_hwfn->p_tx_cids[tx_queue_id];
 	union ecore_qm_pq_params pq_params;
@@ -1274,7 +1274,7 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
 	u8 abs_vport_id = 0;
 	int i;
 
-	rc = ecore_fw_vport(p_hwfn,
+		rc = ecore_fw_vport(p_hwfn,
 			    (p_filter_cmd->opcode == ECORE_FILTER_ADD) ?
 			    p_filter_cmd->vport_to_add_to :
 			    p_filter_cmd->vport_to_remove_from, &abs_vport_id);
@@ -1306,9 +1306,9 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
 		    ETH_MULTICAST_MAC_BINS_IN_REGS);
 
 	if (p_filter_cmd->opcode == ECORE_FILTER_ADD) {
-		/* filter ADD op is explicit set op and it removes
-		 *  any existing filters for the vport.
-		 */
+	/* filter ADD op is explicit set op and it removes
+	*  any existing filters for the vport.
+	*/
 		for (i = 0; i < p_filter_cmd->num_mc_addrs; i++) {
 			u32 bit;
 
drivers/net/qede/base/ecore_l2.h +2 -2
index b0850ca..5594a08 100644
@@ -103,7 +103,7 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
  * @return enum _ecore_status_t
  */
 enum _ecore_status_t
-ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
+ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn	*p_hwfn,
 			      u16 opaque_fid,
 			      u32 cid,
 			      u16 rx_queue_id,
@@ -134,7 +134,7 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
  * @return enum _ecore_status_t
  */
 enum _ecore_status_t
-ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
+ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn	*p_hwfn,
 			      u16 opaque_fid,
 			      u16 tx_queue_id,
 			      u32 cid,
drivers/net/qede/base/ecore_l2_api.h +44 -44

155 lines not on this page · raw message

drivers/net/qede/base/ecore_mcp.c +14 -14
index 9dd2eed..2823113 100644
@@ -333,7 +333,7 @@ enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
 }
 
 enum _ecore_status_t ecore_mcp_cmd_and_union(struct ecore_hwfn *p_hwfn,
-					     struct ecore_ptt *p_ptt,
+			struct ecore_ptt *p_ptt,
 					     u32 cmd, u32 param,
 					     union drv_union_data *p_union_data,
 					     u32 *o_mcp_resp,
@@ -354,18 +354,18 @@ enum _ecore_status_t ecore_mcp_cmd_and_union(struct ecore_hwfn *p_hwfn,
 	OSAL_SPIN_LOCK(&p_hwfn->mcp_info->lock);
 
 	if (p_union_data != OSAL_NULL) {
-		union_data_addr = p_hwfn->mcp_info->drv_mb_addr +
-		    OFFSETOF(struct public_drv_mb, union_data);
+	union_data_addr = p_hwfn->mcp_info->drv_mb_addr +
+			  OFFSETOF(struct public_drv_mb, union_data);
 		ecore_memcpy_to(p_hwfn, p_ptt, union_data_addr, p_union_data,
 				sizeof(*p_union_data));
-	}
+}
 
 	rc = ecore_do_mcp_cmd(p_hwfn, p_ptt, cmd, param, o_mcp_resp,
 			      o_mcp_param);
 
 	OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->lock);
 
-	return rc;
+		return rc;
 }
 
 enum _ecore_status_t ecore_mcp_nvm_wr_cmd(struct ecore_hwfn *p_hwfn,
@@ -577,7 +577,7 @@ static void ecore_mcp_handle_transceiver_change(struct ecore_hwfn *p_hwfn,
 
 	DP_VERBOSE(p_hwfn, (ECORE_MSG_HW | ECORE_MSG_SP),
 		   "Received transceiver state update [0x%08x] from mfw"
-		   "[Addr 0x%x]\n",
+		   " [Addr 0x%x]\n",
 		   transceiver_state, (u32)(p_hwfn->mcp_info->port_addr +
 					    OFFSETOF(struct public_port,
 						     transceiver_data)));
@@ -661,18 +661,18 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn,
 	if (p_hwfn->mcp_info->func_info.bandwidth_max && p_link->speed) {
 		u8 max_bw = p_hwfn->mcp_info->func_info.bandwidth_max;
 
-		__ecore_configure_pf_max_bandwidth(p_hwfn, p_ptt,
-						   p_link, max_bw);
+	__ecore_configure_pf_max_bandwidth(p_hwfn, p_ptt,
+					   p_link, max_bw);
 	}
 
 	if (p_hwfn->mcp_info->func_info.bandwidth_min && p_link->speed) {
 		u8 min_bw = p_hwfn->mcp_info->func_info.bandwidth_min;
 
-		__ecore_configure_pf_min_bandwidth(p_hwfn, p_ptt,
-						   p_link, min_bw);
+	__ecore_configure_pf_min_bandwidth(p_hwfn, p_ptt,
+					   p_link, min_bw);
 
-		ecore_configure_vp_wfq_on_link_change(p_hwfn->p_dev,
-						      p_link->min_pf_rate);
+	ecore_configure_vp_wfq_on_link_change(p_hwfn->p_dev,
+					      p_link->min_pf_rate);
 	}
 
 	p_link->an = !!(status & LINK_STATUS_AUTO_NEGOTIATE_ENABLED);
@@ -1090,8 +1090,8 @@ enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_dev *p_dev,
 
 		DP_VERBOSE(p_dev, ECORE_MSG_IOV,
 			   "VF requested MFW vers prior to ACQUIRE\n");
-		return ECORE_INVAL;
-	}
+			return ECORE_INVAL;
+		}
 
 	global_offsize = ecore_rd(p_hwfn, p_ptt,
 				  SECTION_OFFSIZE_ADDR(p_hwfn->mcp_info->
drivers/net/qede/base/ecore_mcp.h +3 -3
index 448c30b..7af4349 100644
@@ -38,10 +38,10 @@ struct ecore_mcp_info {
 	u32 port_addr;		/* Address of the port configuration (link) */
 	u16 drv_mb_seq;		/* Current driver mailbox sequence */
 	u16 drv_pulse_seq;	/* Current driver pulse sequence */
-	struct ecore_mcp_link_params link_input;
-	struct ecore_mcp_link_state link_output;
+	struct ecore_mcp_link_params       link_input;
+	struct ecore_mcp_link_state	   link_output;
 	struct ecore_mcp_link_capabilities link_capabilities;
-	struct ecore_mcp_function_info func_info;
+	struct ecore_mcp_function_info	   func_info;
 
 	u8 *mfw_mb_cur;
 	u8 *mfw_mb_shadow;
drivers/net/qede/base/ecore_mcp_api.h +8 -8
index 7360b35..530c0ec 100644
@@ -13,8 +13,8 @@
 
 struct ecore_mcp_link_speed_params {
 	bool autoneg;
-	u32 advertised_speeds;	/* bitmask of DRV_SPEED_CAPABILITY */
-	u32 forced_speed;	/* In Mb/s */
+	u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
+	u32 forced_speed; /* In Mb/s */
 };
 
 struct ecore_mcp_link_pause_params {
@@ -26,7 +26,7 @@ struct ecore_mcp_link_pause_params {
 struct ecore_mcp_link_params {
 	struct ecore_mcp_link_speed_params speed;
 	struct ecore_mcp_link_pause_params pause;
-	u32 loopback_mode;	/* in PMM_LOOPBACK values */
+	u32 loopback_mode; /* in PMM_LOOPBACK values */
 };
 
 struct ecore_mcp_link_capabilities {
@@ -36,9 +36,9 @@ struct ecore_mcp_link_capabilities {
 struct ecore_mcp_link_state {
 	bool link_up;
 
-	u32 line_speed;		/* In Mb/s */
-	u32 min_pf_rate;	/* In Mb/s */
-	u32 speed;		/* In Mb/s */
+	u32 line_speed; /* In Mb/s */
+	u32 min_pf_rate; /* In Mb/s */
+	u32 speed; /* In Mb/s */
 	bool full_duplex;
 
 	bool an;
@@ -237,7 +237,7 @@ enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_dev *p_dev,
  *      ECORE_BUSY - Operation failed
  */
 enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_dev *p_dev,
-					      u32 *media_type);
+					   u32 *media_type);
 
 /**
  * @brief - Sends a command to the MCP mailbox.
@@ -542,7 +542,7 @@ enum _ecore_status_t ecore_mcp_phy_read(struct ecore_dev *p_dev, u32 cmd,
  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
  */
 enum _ecore_status_t ecore_mcp_nvm_read(struct ecore_dev *p_dev, u32 addr,
-					u8 *p_buf, u32 len);
+			   u8 *p_buf, u32 len);
 
 /**
  * @brief Read from sfp
drivers/net/qede/base/ecore_proto_if.h +2 -2
index 2fecbc8..bcbd9f0 100644
@@ -18,11 +18,11 @@ struct ecore_eth_pf_params {
 	 * and these parameters need to be passed as arguments
 	 * to update_pf_params routine invoked before slowpath start
 	 */
-	u16 num_cons;
+	u16	num_cons;
 };
 
 struct ecore_pf_params {
-	struct ecore_eth_pf_params eth_pf_params;
+	struct ecore_eth_pf_params	eth_pf_params;
 };
 
 #endif
drivers/net/qede/base/ecore_rt_defs.h +115 -115

292 lines not on this page · raw message

drivers/net/qede/base/ecore_sp_api.h +5 -5
index e80f5ef..71e2359 100644
@@ -12,9 +12,9 @@
 #include "ecore_status.h"
 
 enum spq_mode {
-	ECORE_SPQ_MODE_BLOCK,	/* Client will poll a designated mem. address */
-	ECORE_SPQ_MODE_CB,	/* Client supplies a callback */
-	ECORE_SPQ_MODE_EBLOCK,	/* ECORE should block until completion */
+	ECORE_SPQ_MODE_BLOCK, /* Client will poll a designated mem. address */
+	ECORE_SPQ_MODE_CB,  /* Client supplies a callback */
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_sp_commands.c +8 -8
index e9ac898..7ba43e8 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_sp_commands.h +4 -4
index e281ab0..22c7462 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_spq.c +30 -30

60 lines not on this page · raw message

drivers/net/qede/base/ecore_spq.h +68 -68

136 lines not on this page · raw message

drivers/net/qede/base/ecore_sriov.c +111 -111

222 lines not on this page · raw message

drivers/net/qede/base/ecore_sriov.h +49 -49

98 lines not on this page · raw message

drivers/net/qede/base/ecore_status.h +9 -9
index 98d40bb..6277bc8 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_vf.c +9 -9
index d32fb35..a03a2ce 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_vf.h +17 -17
index 334b588..7600710 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_vf_api.h +2 -2
index f28b686..a2b4ba5 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_vfpf_if.h +135 -135

270 lines not on this page · raw message

drivers/net/qede/base/eth_common.h +26 -26

52 lines not on this page · raw message

drivers/net/qede/base/mcp_public.h +97 -97

194 lines not on this page · raw message

drivers/net/qede/base/nvm_cfg.h +781 -781

1,562 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

Re: [PATCH v3 02/32] qede/base: formatting changes

Hi Rasesh,

Quoted 4 lines · Rasesh Mody

Fixes white spaces and tabs.

---

When testing patch by patch compilation, applying this patch gives following build error, the build error disappears after patch 12/32.

It should successfully compile after each patch, can you please fix this?

Build error:

.../drivers/net/qede/base/ecore_sp_commands.c: In function ‘ecore_sp_pf_update_tunn_cfg’:
.../drivers/net/qede/base/ecore_sp_commands.c:473:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
if (p_tunn->update_geneve_udp_port)
^~
.../drivers/net/qede/base/ecore_sp_commands.c:477:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
ecore_set_hw_tunn_mode(p_hwfn, p_hwfn->p_main_ptt, ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[10]: *** [base/ecore_sp_commands.o] Error 1
make[10]: *** Waiting for unfinished jobs.... .../drivers/net/qede/base/ecore_spq.c: In function ‘ecore_spq_add_entry’:
.../drivers/net/qede/base/ecore_spq.c:628:3: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
if (p_ent->comp_cb.cookie == &p_ent->comp_done)
^~
.../drivers/net/qede/base/ecore_spq.c:631:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’

    *p_en2 = *p_ent;
    ^

cc1: all warnings being treated as errors

Thanks,
ferruh

#4 lore raw

Re: [PATCH v3 02/32] qede/base: formatting changes

Hi Ferruh,

Quoted 8 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, October 17, 2016 9:28 AM

Hi Rasesh,

Quoted 2 lines · Rasesh Mody

Fixes white spaces and tabs.

Quoted 7 lines
Quoted 2 lines

---

When testing patch by patch compilation, applying this patch gives following build error, the build error disappears after patch 12/32.

It should successfully compile after each patch, can you please fix this?

We'll fix the build error and resubmit them today.

Thanks!
Rasesh

#5 lore raw

PATCH v3 3/32 qede: use FW CONFIG defines as needed

In reply to Rasesh Mody

Replaced CONFIG_QED_BINARY_FW with CONFIG_ECORE_BINARY_FW. Use CONFIG_ECORE_BINARY_FW and CONFIG_ECORE_ZIPPED_FW defines as required.

---
 drivers/net/qede/base/bcm_osal.c |  2 ++
 drivers/net/qede/base/ecore.h    | 20 +++++++++++++++-----
 drivers/net/qede/qede_main.c     | 20 +++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)
drivers/net/qede/base/bcm_osal.c +2 -0
index 16029b5..67270fd 100644
@@ -152,6 +152,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
 	return mz->addr;
 }
 
+#ifdef CONFIG_ECORE_ZIPPED_FW
 u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 		    u8 *input_buf, u32 max_size, u8 *unzip_buf)
 {
@@ -182,6 +183,7 @@ u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 
 	return p_hwfn->stream->total_out / 4;
 }
+#endif
 
 void
 qede_get_mcp_proto_stats(struct ecore_dev *edev,
drivers/net/qede/base/ecore.h +15 -5
index c83b22b..b9127de 100644
@@ -9,6 +9,18 @@
 #ifndef __ECORE_H
 #define __ECORE_H
 
+/* @DPDK */
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define CONFIG_ECORE_BINARY_FW
+#define CONFIG_ECORE_ZIPPED_FW
+
+#ifdef CONFIG_ECORE_ZIPPED_FW
+#include <zlib.h>
+#endif
+
 #include "ecore_hsi_common.h"
 #include "ecore_hsi_debug_tools.h"
 #include "ecore_hsi_init_func.h"
@@ -423,9 +435,6 @@ struct storm_stats {
 	u32 len;
 };
 
-#define CONFIG_ECORE_BINARY_FW
-#define CONFIG_ECORE_ZIPPED_FW
-
 struct ecore_fw_data {
 #ifdef CONFIG_ECORE_BINARY_FW
 	struct fw_ver_info *fw_ver_info;
@@ -521,8 +530,8 @@ struct ecore_hwfn {
 	/* QM init */
 	struct ecore_qm_info		qm_info;
 
-	/* Buffer for unzipping firmware data */
 #ifdef CONFIG_ECORE_ZIPPED_FW
+	/* Buffer for unzipping firmware data */
 	void *unzip_buf;
 #endif
 
@@ -674,9 +683,10 @@ struct ecore_dev {
 	bool				b_is_emul_full;
 #endif
 
+#ifdef CONFIG_ECORE_BINARY_FW /* @DPDK */
 	void				*firmware;
-
 	u64				fw_len;
+#endif
 
 };
 
drivers/net/qede/qede_main.c +11 -9
index 73608c6..2e62371 100644
@@ -6,10 +6,6 @@
  * See LICENSE.qede_pmd for copyright and licensing details.
  */
 
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <zlib.h>
 #include <limits.h>
 #include <rte_alarm.h>
 
@@ -20,7 +16,6 @@ static uint8_t npar_tx_switching = 1;
 /* Alarm timeout. */
 #define QEDE_ALARM_TIMEOUT_US 100000
 
-#define CONFIG_QED_BINARY_FW
 /* Global variable to hold absolute path of fw file */
 char fw_file[PATH_MAX];
 
@@ -83,6 +78,7 @@ static int qed_nic_setup(struct ecore_dev *edev)
 	return rc;
 }
 
+#ifdef CONFIG_ECORE_ZIPPED_FW
 static int qed_alloc_stream_mem(struct ecore_dev *edev)
 {
 	int i;
@@ -112,7 +108,9 @@ static void qed_free_stream_mem(struct ecore_dev *edev)
 		OSAL_FREE(p_hwfn->p_dev, p_hwfn->stream);
 	}
 }
+#endif
 
+#ifdef CONFIG_ECORE_BINARY_FW
 static int qed_load_firmware_data(struct ecore_dev *edev)
 {
 	int fd;
@@ -158,6 +156,7 @@ static int qed_load_firmware_data(struct ecore_dev *edev)
 
 	return 0;
 }
+#endif
 
 static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
 {
@@ -222,7 +221,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	struct ecore_tunn_start_params tunn_info;
 #endif
 
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev)) {
 		rc = qed_load_firmware_data(edev);
 		if (rc) {
@@ -240,7 +239,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	/* set int_coalescing_mode */
 	edev->int_coalescing_mode = ECORE_COAL_MODE_ENABLE;
 
-	/* Should go with CONFIG_QED_BINARY_FW */
+#ifdef CONFIG_ECORE_ZIPPED_FW
 	if (IS_PF(edev)) {
 		/* Allocate stream for unzipping */
 		rc = qed_alloc_stream_mem(edev);
@@ -252,9 +251,10 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	}
 
 	qed_start_iov_task(edev);
+#endif
 
 	/* Start the slowpath */
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev))
 		data = edev->firmware;
 #endif
@@ -307,7 +307,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 err2:
 	ecore_resc_free(edev);
 err:
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev)) {
 		if (edev->firmware)
 			rte_free(edev->firmware);
@@ -625,7 +625,9 @@ static int qed_slowpath_stop(struct ecore_dev *edev)
 		return -ENODEV;
 
 	if (IS_PF(edev)) {
+#ifdef CONFIG_ECORE_ZIPPED_FW
 		qed_free_stream_mem(edev);
+#endif
 
 #ifdef CONFIG_QED_SRIOV
 		if (IS_QED_ETH_IF(edev))
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH v3 4/32 qede/base: add HSI changes and register defines

In reply to Rasesh Mody

- add the hardware software interface(HSI) changes
- add register definitions

These will be required for 8.10.9.0 FW upgrade.

---
 drivers/net/qede/base/common_hsi.h       | 1202 +++++++++++++++++++++++++-----
 drivers/net/qede/base/ecore_dev.c        |    2 -
 drivers/net/qede/base/ecore_hsi_common.h |  295 +++++++-
 drivers/net/qede/base/ecore_hw.c         |    4 +-
 drivers/net/qede/base/eth_common.h       |   27 -
 drivers/net/qede/base/reg_addr.h         |   36 +
 6 files changed, 1330 insertions(+), 236 deletions(-)
drivers/net/qede/base/common_hsi.h +1020 -182
index 4574800..b431c78 100644
@@ -8,12 +8,89 @@
 
 #ifndef __COMMON_HSI__
 #define __COMMON_HSI__
+/********************************/
+/* PROTOCOL COMMON FW CONSTANTS */
+/********************************/
+
+/* Temporarily here should be added to HSI automatically by resource allocation
+ * tool.
+ */
+#define T_TEST_AGG_INT_TEMP    6
+#define	M_TEST_AGG_INT_TEMP    8
+#define	U_TEST_AGG_INT_TEMP    6
+#define	X_TEST_AGG_INT_TEMP    14
+#define	Y_TEST_AGG_INT_TEMP    4
+#define	P_TEST_AGG_INT_TEMP    4
+
+#define X_FINAL_CLEANUP_AGG_INT  1
+
+#define EVENT_RING_PAGE_SIZE_BYTES          4096
+
+#define NUM_OF_GLOBAL_QUEUES				128
+#define COMMON_QUEUE_ENTRY_MAX_BYTE_SIZE	64
+
+#define ISCSI_CDU_TASK_SEG_TYPE       0
+#define FCOE_CDU_TASK_SEG_TYPE        0
+#define RDMA_CDU_TASK_SEG_TYPE        1
+
+#define FW_ASSERT_GENERAL_ATTN_IDX    32
+
+#define MAX_PINNED_CCFC			32
+
+#define EAGLE_ENG1_WORKAROUND_NIG_FLOWCTRL_MODE	3
+
+/* Queue Zone sizes in bytes */
+#define TSTORM_QZONE_SIZE    8	 /*tstorm_scsi_queue_zone*/
+#define MSTORM_QZONE_SIZE    16  /*mstorm_eth_queue_zone. Used only for RX
+				  *producer of VFs in backward compatibility
+				  *mode.
+				  */
+#define USTORM_QZONE_SIZE    8	 /*ustorm_eth_queue_zone*/
+#define XSTORM_QZONE_SIZE    8	 /*xstorm_eth_queue_zone*/
+#define YSTORM_QZONE_SIZE    0
+#define PSTORM_QZONE_SIZE    0
+
+/*Log of mstorm default VF zone size.*/
+#define MSTORM_VF_ZONE_DEFAULT_SIZE_LOG       7
+/*Maximum number of RX queues that can be allocated to VF by default*/
+#define ETH_MAX_NUM_RX_QUEUES_PER_VF_DEFAULT  16
+/*Maximum number of RX queues that can be allocated to VF with doubled VF zone
+ * size. Up to 96 VF supported in this mode
+ */
+#define ETH_MAX_NUM_RX_QUEUES_PER_VF_DOUBLE   48
+/*Maximum number of RX queues that can be allocated to VF with 4 VF zone size.
+ * Up to 48 VF supported in this mode
+ */
+#define ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD     112
+
+
+/********************************/
+/* CORE (LIGHT L2) FW CONSTANTS */
+/********************************/
+
+#define CORE_LL2_MAX_RAMROD_PER_CON				8
+#define CORE_LL2_TX_BD_PAGE_SIZE_BYTES			4096
+#define CORE_LL2_RX_BD_PAGE_SIZE_BYTES			4096
+#define CORE_LL2_RX_CQE_PAGE_SIZE_BYTES			4096
+#define CORE_LL2_RX_NUM_NEXT_PAGE_BDS			1
+
+#define CORE_LL2_TX_MAX_BDS_PER_PACKET				12
+
+#define CORE_SPQE_PAGE_SIZE_BYTES                       4096
+
+#define MAX_NUM_LL2_RX_QUEUES					32
+#define MAX_NUM_LL2_TX_STATS_COUNTERS			32
+
+
+/****************************************************************************/
+/* Include firmware version number only- do not add constants here to avoid */
+/* redundunt compilations                                                   */
+/****************************************************************************/
 
-#define CORE_SPQE_PAGE_SIZE_BYTES			4096
 
 #define FW_MAJOR_VERSION		8
-#define FW_MINOR_VERSION	7
-#define FW_REVISION_VERSION	7
+#define FW_MINOR_VERSION		10
+#define FW_REVISION_VERSION		9
 #define FW_ENGINEERING_VERSION	0
 
 /***********************/
@@ -21,70 +98,96 @@
 /***********************/
 
 /* PCI functions */
-#define MAX_NUM_PORTS_K2		(4)
-#define MAX_NUM_PORTS_BB		(2)
-#define MAX_NUM_PORTS			(MAX_NUM_PORTS_K2)
+#define MAX_NUM_PORTS_K2	(4)
+#define MAX_NUM_PORTS_BB	(2)
+#define MAX_NUM_PORTS		(MAX_NUM_PORTS_K2)
 
-#define MAX_NUM_PFS_K2			(16)
-#define MAX_NUM_PFS_BB			(8)
-#define MAX_NUM_PFS				(MAX_NUM_PFS_K2)
-#define MAX_NUM_OF_PFS_IN_CHIP	(16) /* On both engines */
+#define MAX_NUM_PFS_K2	(16)
+#define MAX_NUM_PFS_BB	(8)
+#define MAX_NUM_PFS	(MAX_NUM_PFS_K2)
+#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */
 
-#define MAX_NUM_VFS_K2			(192)
-#define MAX_NUM_VFS_BB			(120)
-#define MAX_NUM_VFS				(MAX_NUM_VFS_K2)
+#define MAX_NUM_VFS_K2	(192)
+#define MAX_NUM_VFS_BB	(120)
+#define MAX_NUM_VFS	(MAX_NUM_VFS_K2)
 
 #define MAX_NUM_FUNCTIONS_BB	(MAX_NUM_PFS_BB + MAX_NUM_VFS_BB)
-#define MAX_NUM_FUNCTIONS		(MAX_NUM_PFS + MAX_NUM_VFS)
+#define MAX_NUM_FUNCTIONS_K2	(MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2)
+#define MAX_NUM_FUNCTIONS	(MAX_NUM_PFS + MAX_NUM_VFS)
 
+/* in both BB and K2, the VF number starts from 16. so for arrays containing all
+ * possible PFs and VFs - we need a constant for this size
+ */
 #define MAX_FUNCTION_NUMBER_BB	(MAX_NUM_PFS + MAX_NUM_VFS_BB)
-#define MAX_FUNCTION_NUMBER		(MAX_NUM_PFS + MAX_NUM_VFS)
+#define MAX_FUNCTION_NUMBER_K2	(MAX_NUM_PFS + MAX_NUM_VFS_K2)
+#define MAX_FUNCTION_NUMBER	(MAX_NUM_PFS + MAX_NUM_VFS)
 
-#define MAX_NUM_VPORTS_K2		(208)
-#define MAX_NUM_VPORTS_BB		(160)
-#define MAX_NUM_VPORTS			(MAX_NUM_VPORTS_K2)
+#define MAX_NUM_VPORTS_K2	(208)
+#define MAX_NUM_VPORTS_BB	(160)
+#define MAX_NUM_VPORTS		(MAX_NUM_VPORTS_K2)
 
 #define MAX_NUM_L2_QUEUES_K2	(320)
 #define MAX_NUM_L2_QUEUES_BB	(256)
-#define MAX_NUM_L2_QUEUES		(MAX_NUM_L2_QUEUES_K2)
+#define MAX_NUM_L2_QUEUES	(MAX_NUM_L2_QUEUES_K2)
 
 /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */
+/* 4-Port K2. */
 #define NUM_PHYS_TCS_4PORT_K2	(4)
-#define NUM_OF_PHYS_TCS			(8)
+#define NUM_OF_PHYS_TCS		(8)
 
-#define NUM_TCS_4PORT_K2		(NUM_PHYS_TCS_4PORT_K2 + 1)
-#define NUM_OF_TCS				(NUM_OF_PHYS_TCS + 1)
+#define NUM_TCS_4PORT_K2	(NUM_PHYS_TCS_4PORT_K2 + 1)
+#define NUM_OF_TCS		(NUM_OF_PHYS_TCS + 1)
 
-#define LB_TC					(NUM_OF_PHYS_TCS)
+#define LB_TC			(NUM_OF_PHYS_TCS)
 
 /* Num of possible traffic priority values */
-#define NUM_OF_PRIO				(8)
+#define NUM_OF_PRIO		(8)
 
-#define MAX_NUM_VOQS_K2			(NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2)
-#define MAX_NUM_VOQS_BB         (NUM_OF_TCS * MAX_NUM_PORTS_BB)
-#define MAX_NUM_VOQS			(MAX_NUM_VOQS_K2)
-#define MAX_PHYS_VOQS			(NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB)
+#define MAX_NUM_VOQS_K2		(NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2)
+#define MAX_NUM_VOQS_BB		(NUM_OF_TCS * MAX_NUM_PORTS_BB)
+#define MAX_NUM_VOQS		(MAX_NUM_VOQS_K2)
+#define MAX_PHYS_VOQS		(NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB)
 
 /* CIDs */
-#define NUM_OF_CONNECTION_TYPES (8)
-#define NUM_OF_LCIDS			(320)
-#define NUM_OF_LTIDS			(320)
-
+#define NUM_OF_CONNECTION_TYPES	(8)
+#define NUM_OF_LCIDS		(320)
+#define NUM_OF_LTIDS		(320)
+
+/* Clock values */
+#define MASTER_CLK_FREQ_E4		(375e6)
+#define STORM_CLK_FREQ_E4		(1000e6)
+#define CLK25M_CLK_FREQ_E4		(25e6)
+
+/* Global PXP windows (GTT) */
+#define NUM_OF_GTT			19
+#define GTT_DWORD_SIZE_BITS	10
+#define GTT_BYTE_SIZE_BITS	(GTT_DWORD_SIZE_BITS + 2)
+#define GTT_DWORD_SIZE		(1 << GTT_DWORD_SIZE_BITS)
+
+/* Tools Version */
+#define TOOLS_VERSION 10
 /*****************/
 /* CDU CONSTANTS */
 /*****************/
 
-#define CDU_SEG_TYPE_OFFSET_REG_TYPE_SHIFT		(17)
-#define CDU_SEG_TYPE_OFFSET_REG_OFFSET_MASK		(0x1ffff)
+#define CDU_SEG_TYPE_OFFSET_REG_TYPE_SHIFT              (17)
+#define CDU_SEG_TYPE_OFFSET_REG_OFFSET_MASK             (0x1ffff)
+
+#define CDU_VF_FL_SEG_TYPE_OFFSET_REG_TYPE_SHIFT	(12)
+#define CDU_VF_FL_SEG_TYPE_OFFSET_REG_OFFSET_MASK	(0xfff)
+
 
 /*****************/
 /* DQ CONSTANTS  */
 /*****************/
 
 /* DEMS */
-#define	DQ_DEMS_LEGACY						0
+#define DQ_DEMS_LEGACY			0
+#define DQ_DEMS_TOE_MORE_TO_SEND			3
+#define DQ_DEMS_TOE_LOCAL_ADV_WND			4
+#define DQ_DEMS_ROCE_CQ_CONS				7
 
-/* XCM agg val selection */
+/* XCM agg val selection (HW) */
 #define DQ_XCM_AGG_VAL_SEL_WORD2  0
 #define DQ_XCM_AGG_VAL_SEL_WORD3  1
 #define DQ_XCM_AGG_VAL_SEL_WORD4  2
@@ -94,7 +197,7 @@
 #define DQ_XCM_AGG_VAL_SEL_REG5   6
 #define DQ_XCM_AGG_VAL_SEL_REG6   7
 
-/* XCM agg val selection */
+/* XCM agg val selection (FW) */
 #define DQ_XCM_ETH_EDPM_NUM_BDS_CMD \
 	DQ_XCM_AGG_VAL_SEL_WORD2
 #define DQ_XCM_ETH_TX_BD_CONS_CMD \
@@ -107,9 +210,50 @@
 	DQ_XCM_AGG_VAL_SEL_WORD4
 #define DQ_XCM_CORE_SPQ_PROD_CMD \
 	DQ_XCM_AGG_VAL_SEL_WORD4
-#define DQ_XCM_ETH_GO_TO_BD_CONS_CMD        DQ_XCM_AGG_VAL_SEL_WORD5
-
-/* XCM agg counter flag selection */
+#define DQ_XCM_ETH_GO_TO_BD_CONS_CMD            DQ_XCM_AGG_VAL_SEL_WORD5
+#define DQ_XCM_FCOE_SQ_CONS_CMD             DQ_XCM_AGG_VAL_SEL_WORD3
+#define DQ_XCM_FCOE_SQ_PROD_CMD             DQ_XCM_AGG_VAL_SEL_WORD4
+#define DQ_XCM_FCOE_X_FERQ_PROD_CMD         DQ_XCM_AGG_VAL_SEL_WORD5
+#define DQ_XCM_ISCSI_SQ_CONS_CMD            DQ_XCM_AGG_VAL_SEL_WORD3
+#define DQ_XCM_ISCSI_SQ_PROD_CMD            DQ_XCM_AGG_VAL_SEL_WORD4
+#define DQ_XCM_ISCSI_MORE_TO_SEND_SEQ_CMD   DQ_XCM_AGG_VAL_SEL_REG3
+#define DQ_XCM_ISCSI_EXP_STAT_SN_CMD        DQ_XCM_AGG_VAL_SEL_REG6
+#define DQ_XCM_ROCE_SQ_PROD_CMD             DQ_XCM_AGG_VAL_SEL_WORD4
+#define DQ_XCM_TOE_TX_BD_PROD_CMD           DQ_XCM_AGG_VAL_SEL_WORD4
+#define DQ_XCM_TOE_MORE_TO_SEND_SEQ_CMD     DQ_XCM_AGG_VAL_SEL_REG3
+#define DQ_XCM_TOE_LOCAL_ADV_WND_SEQ_CMD    DQ_XCM_AGG_VAL_SEL_REG4
+
+/* UCM agg val selection (HW) */
+#define DQ_UCM_AGG_VAL_SEL_WORD0  0
+#define DQ_UCM_AGG_VAL_SEL_WORD1  1
+#define DQ_UCM_AGG_VAL_SEL_WORD2  2
+#define DQ_UCM_AGG_VAL_SEL_WORD3  3
+#define DQ_UCM_AGG_VAL_SEL_REG0   4
+#define DQ_UCM_AGG_VAL_SEL_REG1   5
+#define DQ_UCM_AGG_VAL_SEL_REG2   6
+#define DQ_UCM_AGG_VAL_SEL_REG3   7
+
+/* UCM agg val selection (FW) */
+#define DQ_UCM_ETH_PMD_TX_CONS_CMD			DQ_UCM_AGG_VAL_SEL_WORD2
+#define DQ_UCM_ETH_PMD_RX_CONS_CMD			DQ_UCM_AGG_VAL_SEL_WORD3
+#define DQ_UCM_ROCE_CQ_CONS_CMD				DQ_UCM_AGG_VAL_SEL_REG0
+#define DQ_UCM_ROCE_CQ_PROD_CMD				DQ_UCM_AGG_VAL_SEL_REG2
+
+/* TCM agg val selection (HW) */
+#define DQ_TCM_AGG_VAL_SEL_WORD0  0
+#define DQ_TCM_AGG_VAL_SEL_WORD1  1
+#define DQ_TCM_AGG_VAL_SEL_WORD2  2
+#define DQ_TCM_AGG_VAL_SEL_WORD3  3
+#define DQ_TCM_AGG_VAL_SEL_REG1   4
+#define DQ_TCM_AGG_VAL_SEL_REG2   5
+#define DQ_TCM_AGG_VAL_SEL_REG6   6
+#define DQ_TCM_AGG_VAL_SEL_REG9   7
+
+/* TCM agg val selection (FW) */
+#define DQ_TCM_L2B_BD_PROD_CMD				DQ_TCM_AGG_VAL_SEL_WORD1
+#define DQ_TCM_ROCE_RQ_PROD_CMD				DQ_TCM_AGG_VAL_SEL_WORD0
+
+/* XCM agg counter flag selection (HW) */
 #define DQ_XCM_AGG_FLG_SHIFT_BIT14  0
 #define DQ_XCM_AGG_FLG_SHIFT_BIT15  1
 #define DQ_XCM_AGG_FLG_SHIFT_CF12   2
@@ -119,7 +263,7 @@
 #define DQ_XCM_AGG_FLG_SHIFT_CF22   6
 #define DQ_XCM_AGG_FLG_SHIFT_CF23   7
 
-/* XCM agg counter flag selection */
+/* XCM agg counter flag selection (FW) */
 #define DQ_XCM_ETH_DQ_CF_CMD		(1 << \
 					DQ_XCM_AGG_FLG_SHIFT_CF18)
 #define DQ_XCM_CORE_DQ_CF_CMD		(1 << \
@@ -134,28 +278,109 @@
 					DQ_XCM_AGG_FLG_SHIFT_CF22)
 #define DQ_XCM_ETH_TPH_EN_CMD		(1 << \
 					DQ_XCM_AGG_FLG_SHIFT_CF23)
+#define DQ_XCM_FCOE_SLOW_PATH_CMD           (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
+#define DQ_XCM_ISCSI_DQ_FLUSH_CMD           (1 << DQ_XCM_AGG_FLG_SHIFT_CF19)
+#define DQ_XCM_ISCSI_SLOW_PATH_CMD          (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
+#define DQ_XCM_ISCSI_PROC_ONLY_CLEANUP_CMD  (1 << DQ_XCM_AGG_FLG_SHIFT_CF23)
+#define DQ_XCM_TOE_DQ_FLUSH_CMD             (1 << DQ_XCM_AGG_FLG_SHIFT_CF19)
+#define DQ_XCM_TOE_SLOW_PATH_CMD            (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
+
+/* UCM agg counter flag selection (HW) */
+#define DQ_UCM_AGG_FLG_SHIFT_CF0       0
+#define DQ_UCM_AGG_FLG_SHIFT_CF1       1
+#define DQ_UCM_AGG_FLG_SHIFT_CF3       2
+#define DQ_UCM_AGG_FLG_SHIFT_CF4       3
+#define DQ_UCM_AGG_FLG_SHIFT_CF5       4
+#define DQ_UCM_AGG_FLG_SHIFT_CF6       5
+#define DQ_UCM_AGG_FLG_SHIFT_RULE0EN   6
+#define DQ_UCM_AGG_FLG_SHIFT_RULE1EN   7
+
+/* UCM agg counter flag selection (FW) */
+#define DQ_UCM_ETH_PMD_TX_ARM_CMD           (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
+#define DQ_UCM_ETH_PMD_RX_ARM_CMD           (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
+#define DQ_UCM_ROCE_CQ_ARM_SE_CF_CMD        (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
+#define DQ_UCM_ROCE_CQ_ARM_CF_CMD           (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
+#define DQ_UCM_TOE_TIMER_STOP_ALL_CMD       (1 << DQ_UCM_AGG_FLG_SHIFT_CF3)
+#define DQ_UCM_TOE_SLOW_PATH_CF_CMD         (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
+#define DQ_UCM_TOE_DQ_CF_CMD                (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
+
+/* TCM agg counter flag selection (HW) */
+#define DQ_TCM_AGG_FLG_SHIFT_CF0  0
+#define DQ_TCM_AGG_FLG_SHIFT_CF1  1
+#define DQ_TCM_AGG_FLG_SHIFT_CF2  2
+#define DQ_TCM_AGG_FLG_SHIFT_CF3  3
+#define DQ_TCM_AGG_FLG_SHIFT_CF4  4
+#define DQ_TCM_AGG_FLG_SHIFT_CF5  5
+#define DQ_TCM_AGG_FLG_SHIFT_CF6  6
+#define DQ_TCM_AGG_FLG_SHIFT_CF7  7
+
+/* TCM agg counter flag selection (FW) */
+#define DQ_TCM_FCOE_FLUSH_Q0_CMD            (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
+#define DQ_TCM_FCOE_DUMMY_TIMER_CMD         (1 << DQ_TCM_AGG_FLG_SHIFT_CF2)
+#define DQ_TCM_FCOE_TIMER_STOP_ALL_CMD      (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
+#define DQ_TCM_ISCSI_FLUSH_Q0_CMD           (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
+#define DQ_TCM_ISCSI_TIMER_STOP_ALL_CMD     (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
+#define DQ_TCM_TOE_FLUSH_Q0_CMD             (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
+#define DQ_TCM_TOE_TIMER_STOP_ALL_CMD       (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
+#define DQ_TCM_IWARP_POST_RQ_CF_CMD         (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
+
+/* PWM address mapping */
+#define DQ_PWM_OFFSET_DPM_BASE				0x0
+#define DQ_PWM_OFFSET_DPM_END				0x27
+#define DQ_PWM_OFFSET_XCM16_BASE			0x40
+#define DQ_PWM_OFFSET_XCM32_BASE			0x44
+#define DQ_PWM_OFFSET_UCM16_BASE			0x48
+#define DQ_PWM_OFFSET_UCM32_BASE			0x4C
+#define DQ_PWM_OFFSET_UCM16_4				0x50
+#define DQ_PWM_OFFSET_TCM16_BASE			0x58
+#define DQ_PWM_OFFSET_TCM32_BASE			0x5C
+#define DQ_PWM_OFFSET_XCM_FLAGS				0x68
+#define DQ_PWM_OFFSET_UCM_FLAGS				0x69
+#define DQ_PWM_OFFSET_TCM_FLAGS				0x6B
+
+#define DQ_PWM_OFFSET_XCM_RDMA_SQ_PROD		(DQ_PWM_OFFSET_XCM16_BASE + 2)
+#define DQ_PWM_OFFSET_UCM_RDMA_CQ_CONS_32BIT	(DQ_PWM_OFFSET_UCM32_BASE)
+#define DQ_PWM_OFFSET_UCM_RDMA_CQ_CONS_16BIT	(DQ_PWM_OFFSET_UCM16_4)
+#define DQ_PWM_OFFSET_UCM_RDMA_INT_TIMEOUT	(DQ_PWM_OFFSET_UCM16_BASE + 2)
+#define DQ_PWM_OFFSET_UCM_RDMA_ARM_FLAGS	(DQ_PWM_OFFSET_UCM_FLAGS)
+#define DQ_PWM_OFFSET_TCM_ROCE_RQ_PROD		(DQ_PWM_OFFSET_TCM16_BASE + 1)
+#define DQ_PWM_OFFSET_TCM_IWARP_RQ_PROD		(DQ_PWM_OFFSET_TCM16_BASE + 3)
+
+#define DQ_REGION_SHIFT				        (12)
+
+/* DPM */
+#define	DQ_DPM_WQE_BUFF_SIZE			    (320)
+
+/* Conn type ranges */
+#define DQ_CONN_TYPE_RANGE_SHIFT			(4)
 
 /*****************/
 /* QM CONSTANTS  */
 /*****************/
 
 /* number of TX queues in the QM */
-#define MAX_QM_TX_QUEUES_K2			512
-#define MAX_QM_TX_QUEUES_BB			448
-#define MAX_QM_TX_QUEUES			MAX_QM_TX_QUEUES_K2
+#define MAX_QM_TX_QUEUES_K2	512
+#define MAX_QM_TX_QUEUES_BB	448
+#define MAX_QM_TX_QUEUES	MAX_QM_TX_QUEUES_K2
 
 /* number of Other queues in the QM */
-#define MAX_QM_OTHER_QUEUES_BB		64
-#define MAX_QM_OTHER_QUEUES_K2		128
-#define MAX_QM_OTHER_QUEUES			MAX_QM_OTHER_QUEUES_K2
+#define MAX_QM_OTHER_QUEUES_BB	64
+#define MAX_QM_OTHER_QUEUES_K2	128
+#define MAX_QM_OTHER_QUEUES	MAX_QM_OTHER_QUEUES_K2
 
 /* number of queues in a PF queue group */
-#define QM_PF_QUEUE_GROUP_SIZE		8
+#define QM_PF_QUEUE_GROUP_SIZE	8
+
+/* the size of a single queue element in bytes */
+#define QM_PQ_ELEMENT_SIZE			4
 
 /* base number of Tx PQs in the CM PQ representation.
  * should be used when storing PQ IDs in CM PQ registers and context
  */
-#define CM_TX_PQ_BASE               0x200
+#define CM_TX_PQ_BASE	0x200
+
+/* number of global Vport/QCN rate limiters */
+#define MAX_QM_GLOBAL_RLS			256
 
 /* QM registers data */
 #define QM_LINE_CRD_REG_WIDTH		16
@@ -164,7 +389,7 @@
 #define QM_BYTE_CRD_REG_SIGN_BIT	(1 << (QM_BYTE_CRD_REG_WIDTH - 1))
 #define QM_WFQ_CRD_REG_WIDTH		32
 #define QM_WFQ_CRD_REG_SIGN_BIT		(1 << (QM_WFQ_CRD_REG_WIDTH - 1))
-#define QM_RL_CRD_REG_WIDTH			32
+#define QM_RL_CRD_REG_WIDTH		32
 #define QM_RL_CRD_REG_SIGN_BIT		(1 << (QM_RL_CRD_REG_WIDTH - 1))
 
 /*****************/
@@ -177,114 +402,217 @@
 /* Number of Protocol Indices per Status Block */
 #define PIS_PER_SB    12
 
+/* fsm is stopped or not valid for this sb */
 #define CAU_HC_STOPPED_STATE	3
+/* fsm is working without interrupt coalescing for this sb*/
 #define CAU_HC_DISABLE_STATE	4
+/* fsm is working with interrupt coalescing for this sb*/
 #define CAU_HC_ENABLE_STATE	0
 
+
 /*****************/
 /* IGU CONSTANTS */
 /*****************/
 
-#define MAX_SB_PER_PATH_K2				(368)
-#define MAX_SB_PER_PATH_BB				(288)
+#define MAX_SB_PER_PATH_K2	(368)
+#define MAX_SB_PER_PATH_BB	(288)
 #define MAX_TOT_SB_PER_PATH \
 	MAX_SB_PER_PATH_K2
 
-#define MAX_SB_PER_PF_MIMD				129
-#define MAX_SB_PER_PF_SIMD				64
-#define MAX_SB_PER_VF					64
+#define MAX_SB_PER_PF_MIMD	129
+#define MAX_SB_PER_PF_SIMD	64
+#define MAX_SB_PER_VF		64
 
 /* Memory addresses on the BAR for the IGU Sub Block */
-#define IGU_MEM_BASE					0x0000
+#define IGU_MEM_BASE			0x0000
 
-#define IGU_MEM_MSIX_BASE				0x0000
-#define IGU_MEM_MSIX_UPPER				0x0101
-#define IGU_MEM_MSIX_RESERVED_UPPER			0x01ff
+#define IGU_MEM_MSIX_BASE		0x0000
+#define IGU_MEM_MSIX_UPPER		0x0101
+#define IGU_MEM_MSIX_RESERVED_UPPER	0x01ff
 
-#define IGU_MEM_PBA_MSIX_BASE				0x0200
-#define IGU_MEM_PBA_MSIX_UPPER				0x0202
-#define IGU_MEM_PBA_MSIX_RESERVED_UPPER			0x03ff
+#define IGU_MEM_PBA_MSIX_BASE		0x0200
+#define IGU_MEM_PBA_MSIX_UPPER		0x0202
+#define IGU_MEM_PBA_MSIX_RESERVED_UPPER	0x03ff
 
-#define IGU_CMD_INT_ACK_BASE				0x0400
+#define IGU_CMD_INT_ACK_BASE		0x0400
 #define IGU_CMD_INT_ACK_UPPER		(IGU_CMD_INT_ACK_BASE +	\
 					 MAX_TOT_SB_PER_PATH -	\
 					 1)
-#define IGU_CMD_INT_ACK_RESERVED_UPPER			0x05ff
+#define IGU_CMD_INT_ACK_RESERVED_UPPER	0x05ff
 
-#define IGU_CMD_ATTN_BIT_UPD_UPPER			0x05f0
-#define IGU_CMD_ATTN_BIT_SET_UPPER			0x05f1
-#define IGU_CMD_ATTN_BIT_CLR_UPPER			0x05f2
+#define IGU_CMD_ATTN_BIT_UPD_UPPER	0x05f0
+#define IGU_CMD_ATTN_BIT_SET_UPPER	0x05f1
+#define IGU_CMD_ATTN_BIT_CLR_UPPER	0x05f2
 
-#define IGU_REG_SISR_MDPC_WMASK_UPPER			0x05f3
-#define IGU_REG_SISR_MDPC_WMASK_LSB_UPPER		0x05f4
-#define IGU_REG_SISR_MDPC_WMASK_MSB_UPPER		0x05f5
-#define IGU_REG_SISR_MDPC_WOMASK_UPPER			0x05f6
+#define IGU_REG_SISR_MDPC_WMASK_UPPER		0x05f3
+#define IGU_REG_SISR_MDPC_WMASK_LSB_UPPER	0x05f4
+#define IGU_REG_SISR_MDPC_WMASK_MSB_UPPER	0x05f5
+#define IGU_REG_SISR_MDPC_WOMASK_UPPER		0x05f6
 
-#define IGU_CMD_PROD_UPD_BASE				0x0600
+#define IGU_CMD_PROD_UPD_BASE			0x0600
 #define IGU_CMD_PROD_UPD_UPPER			(IGU_CMD_PROD_UPD_BASE +\
 						 MAX_TOT_SB_PER_PATH - \
 						 1)
-#define IGU_CMD_PROD_UPD_RESERVED_UPPER			0x07ff
+#define IGU_CMD_PROD_UPD_RESERVED_UPPER		0x07ff
 
 /*****************/
 /* PXP CONSTANTS */
 /*****************/
 
+/* Bars for Blocks */
+#define PXP_BAR_GRC                                         0
+#define PXP_BAR_TSDM                                        0
+#define PXP_BAR_USDM                                        0
+#define PXP_BAR_XSDM                                        0
+#define PXP_BAR_MSDM                                        0
+#define PXP_BAR_YSDM                                        0
+#define PXP_BAR_PSDM                                        0
+#define PXP_BAR_IGU                                         0
+#define PXP_BAR_DQ                                          1
+
 /* PTT and GTT */
-#define PXP_NUM_PF_WINDOWS                                  12
-#define PXP_PER_PF_ENTRY_SIZE                               8
-#define PXP_NUM_GLOBAL_WINDOWS                              243
-#define PXP_GLOBAL_ENTRY_SIZE                               4
-#define PXP_ADMIN_WINDOW_ALLOWED_LENGTH                     4
-#define PXP_PF_WINDOW_ADMIN_START                           0
-#define PXP_PF_WINDOW_ADMIN_LENGTH                          0x1000
+#define PXP_NUM_PF_WINDOWS		12
+#define PXP_PER_PF_ENTRY_SIZE		8
+#define PXP_NUM_GLOBAL_WINDOWS		243
+#define PXP_GLOBAL_ENTRY_SIZE		4
+#define PXP_ADMIN_WINDOW_ALLOWED_LENGTH	4
+#define PXP_PF_WINDOW_ADMIN_START	0
+#define PXP_PF_WINDOW_ADMIN_LENGTH	0x1000
 #define PXP_PF_WINDOW_ADMIN_END		(PXP_PF_WINDOW_ADMIN_START + \
 					 PXP_PF_WINDOW_ADMIN_LENGTH - 1)
-#define PXP_PF_WINDOW_ADMIN_PER_PF_START                    0
+#define PXP_PF_WINDOW_ADMIN_PER_PF_START	0
 #define PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH	(PXP_NUM_PF_WINDOWS * \
 						 PXP_PER_PF_ENTRY_SIZE)
 #define PXP_PF_WINDOW_ADMIN_PER_PF_END	(PXP_PF_WINDOW_ADMIN_PER_PF_START + \
-	 PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH - 1)
-#define PXP_PF_WINDOW_ADMIN_GLOBAL_START                    0x200
+					 PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH - 1)
+#define PXP_PF_WINDOW_ADMIN_GLOBAL_START	0x200
 #define PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH	(PXP_NUM_GLOBAL_WINDOWS * \
 						 PXP_GLOBAL_ENTRY_SIZE)
-#define PXP_PF_WINDOW_ADMIN_GLOBAL_END                      \
-	(PXP_PF_WINDOW_ADMIN_GLOBAL_START +		    \
-	 PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH - 1)
-#define PXP_PF_GLOBAL_PRETEND_ADDR                          0x1f0
-#define PXP_PF_ME_OPAQUE_MASK_ADDR                          0xf4
-#define PXP_PF_ME_OPAQUE_ADDR                               0x1f8
-#define PXP_PF_ME_CONCRETE_ADDR                             0x1fc
-
-#define PXP_EXTERNAL_BAR_PF_WINDOW_START                    0x1000
-#define PXP_EXTERNAL_BAR_PF_WINDOW_NUM                      PXP_NUM_PF_WINDOWS
-#define PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE              0x1000
-#define PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH                   \
-	(PXP_EXTERNAL_BAR_PF_WINDOW_NUM *		    \
+#define PXP_PF_WINDOW_ADMIN_GLOBAL_END \
+		(PXP_PF_WINDOW_ADMIN_GLOBAL_START + \
+		 PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH - 1)
+#define PXP_PF_GLOBAL_PRETEND_ADDR	0x1f0
+#define PXP_PF_ME_OPAQUE_MASK_ADDR	0xf4
+#define PXP_PF_ME_OPAQUE_ADDR		0x1f8
+#define PXP_PF_ME_CONCRETE_ADDR		0x1fc
+
+#define PXP_EXTERNAL_BAR_PF_WINDOW_START	0x1000
+#define PXP_EXTERNAL_BAR_PF_WINDOW_NUM		PXP_NUM_PF_WINDOWS
+#define PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE	0x1000
+#define PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH \
+	(PXP_EXTERNAL_BAR_PF_WINDOW_NUM * \
 	 PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE)
-#define PXP_EXTERNAL_BAR_PF_WINDOW_END                      \
-	(PXP_EXTERNAL_BAR_PF_WINDOW_START +		    \
+#define PXP_EXTERNAL_BAR_PF_WINDOW_END \
+	(PXP_EXTERNAL_BAR_PF_WINDOW_START + \
 	 PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH - 1)
 
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START                \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START \
 	(PXP_EXTERNAL_BAR_PF_WINDOW_END + 1)
 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM		PXP_NUM_GLOBAL_WINDOWS
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE          0x1000
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH               \
-	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM *		    \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE	0x1000
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH \
+	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM * \
 	 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE)
-#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_END                  \
-	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START +		    \
+#define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_END \
+	(PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START + \
 	 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH - 1)
 
-#define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN          12
-#define PXP_ILT_BLOCK_FACTOR_MULTIPLIER         1024
+/* PF BAR */
+/*#define PXP_BAR0_START_GRC 0x1000 */
+/*#define PXP_BAR0_GRC_LENGTH 0xBFF000 */
+#define PXP_BAR0_START_GRC                      0x0000
+#define PXP_BAR0_GRC_LENGTH                     0x1C00000
+#define PXP_BAR0_END_GRC                        \
+	(PXP_BAR0_START_GRC + PXP_BAR0_GRC_LENGTH - 1)
+
+#define PXP_BAR0_START_IGU                      0x1C00000
+#define PXP_BAR0_IGU_LENGTH                     0x10000
+#define PXP_BAR0_END_IGU                        \
+	(PXP_BAR0_START_IGU + PXP_BAR0_IGU_LENGTH - 1)
+
+#define PXP_BAR0_START_TSDM                     0x1C80000
+#define PXP_BAR0_SDM_LENGTH                     0x40000
+#define PXP_BAR0_SDM_RESERVED_LENGTH            0x40000
+#define PXP_BAR0_END_TSDM                       \
+	(PXP_BAR0_START_TSDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_START_MSDM                     0x1D00000
+#define PXP_BAR0_END_MSDM                       \
+	(PXP_BAR0_START_MSDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_START_USDM                     0x1D80000
+#define PXP_BAR0_END_USDM                       \
+	(PXP_BAR0_START_USDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_START_XSDM                     0x1E00000
+#define PXP_BAR0_END_XSDM                       \
+	(PXP_BAR0_START_XSDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_START_YSDM                     0x1E80000
+#define PXP_BAR0_END_YSDM                       \
+	(PXP_BAR0_START_YSDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_START_PSDM                     0x1F00000
+#define PXP_BAR0_END_PSDM                       \
+	(PXP_BAR0_START_PSDM + PXP_BAR0_SDM_LENGTH - 1)
+
+#define PXP_BAR0_FIRST_INVALID_ADDRESS          \
+	(PXP_BAR0_END_PSDM + 1)
+
+#define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN	12
+#define PXP_ILT_BLOCK_FACTOR_MULTIPLIER	1024
 
 /* ILT Records */
 #define PXP_NUM_ILT_RECORDS_BB 7600
 #define PXP_NUM_ILT_RECORDS_K2 11000
 #define MAX_NUM_ILT_RECORDS MAX(PXP_NUM_ILT_RECORDS_BB, PXP_NUM_ILT_RECORDS_K2)
 
+
+/* Host Interface */
+#define PXP_QUEUES_ZONE_MAX_NUM	320
+
+
+
+
+/*****************/
+/* PRM CONSTANTS */
+/*****************/
+#define PRM_DMA_PAD_BYTES_NUM  2
+/*****************/
+/* SDMs CONSTANTS  */
+/*****************/
+
+
+#define SDM_OP_GEN_TRIG_NONE			0
+#define SDM_OP_GEN_TRIG_WAKE_THREAD		1
+#define SDM_OP_GEN_TRIG_AGG_INT			2
+#define SDM_OP_GEN_TRIG_LOADER			4
+#define SDM_OP_GEN_TRIG_INDICATE_ERROR	6
+#define SDM_OP_GEN_TRIG_RELEASE_THREAD	7
+
+/***********************************************************/
+/* Completion types                                        */
+/***********************************************************/
+
+#define SDM_COMP_TYPE_NONE		0
+#define SDM_COMP_TYPE_WAKE_THREAD	1
+#define SDM_COMP_TYPE_AGG_INT		2
+/* Send direct message to local CM and/or remote CMs. Destinations are defined
+ * by vector in CompParams.
+ */
+#define SDM_COMP_TYPE_CM		3
+#define SDM_COMP_TYPE_LOADER		4
+/* Send direct message to PXP (like "internal write" command) to write to remote
+ * Storm RAM via remote SDM
+ */
+#define SDM_COMP_TYPE_PXP		5
+/* Indicate error per thread */
+#define SDM_COMP_TYPE_INDICATE_ERROR	6
+#define SDM_COMP_TYPE_RELEASE_THREAD	7
+/* Write to local RAM as a completion */
+#define SDM_COMP_TYPE_RAM		8
+
+
 /******************/
 /* PBF CONSTANTS  */
 /******************/
@@ -299,12 +627,43 @@
 /* PRS CONSTANTS */
 /*****************/
 
+#define PRS_GFT_CAM_LINES_NO_MATCH  31
 /* Async data KCQ CQE */
 struct async_data {
-	__le32 cid;
-	__le16 itid;
-	u8 error_code;
-	u8 fw_debug_param;
+	/* Context ID of the connection */
+	__le32	cid;
+	/* Task Id of the task (for error that happened on a a task) */
+	__le16	itid;
+	/* error code - relevant only if the opcode indicates its an error */
+	u8	error_code;
+	/* internal fw debug parameter */
+	u8	fw_debug_param;
+};
+
+/*
+ * Interrupt coalescing TimeSet
+ */
+struct coalescing_timeset {
+	u8 value;
+/* Interrupt coalescing TimeSet (timeout_ticks = TimeSet shl (TimerRes+1)) */
+#define COALESCING_TIMESET_TIMESET_MASK  0x7F
+#define COALESCING_TIMESET_TIMESET_SHIFT 0
+/* Only if this flag is set, timeset will take effect */
+#define COALESCING_TIMESET_VALID_MASK    0x1
+#define COALESCING_TIMESET_VALID_SHIFT   7
+};
+
+struct common_queue_zone {
+	__le16 ring_drv_data_consumer;
+	__le16 reserved;
+};
+
+/*
+ * ETH Rx producers data
+ */
+struct eth_rx_prod_data {
+	__le16 bd_prod /* BD producer. */;
+	__le16 cqe_prod /* CQE producer. */;
 };
 
 struct regpair {
@@ -312,24 +671,38 @@ struct regpair {
 	__le32 hi /* high word for reg-pair */;
 };
 
+/*
+ * Event Ring VF-PF Channel data
+ */
 struct vf_pf_channel_eqe_data {
 	struct regpair msg_addr /* VF-PF message address */;
 };
 
 struct iscsi_eqe_data {
 	__le32 cid /* Context ID of the connection */;
-	__le16 conn_id
 	    /* Task Id of the task (for error that happened on a a task) */;
+	__le16 conn_id;
+/* error code - relevant only if the opcode indicates its an error */
 	u8 error_code;
-	u8 reserved0;
+	u8 error_pdu_opcode_reserved;
+/* The processed PDUs opcode on which happened the error - updated for specific
+ * error codes, by default=0xFF
+ */
+#define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_MASK        0x3F
+#define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_SHIFT       0
+/* Indication for driver is the error_pdu_opcode field has valid value */
+#define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_VALID_MASK  0x1
+#define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_VALID_SHIFT 6
+#define ISCSI_EQE_DATA_RESERVED0_MASK               0x1
+#define ISCSI_EQE_DATA_RESERVED0_SHIFT              7
 };
 
 /*
  * Event Ring malicious VF data
  */
 struct malicious_vf_eqe_data {
-	u8 vf_id /* Malicious VF ID */; /* WARNING:CAMELCASE */
-	u8 err_id /* Malicious VF error */;
+	u8 vfId /* Malicious VF ID */;
+	u8 errId /* Malicious VF error */;
 	__le16 reserved[3];
 };
 
@@ -337,41 +710,46 @@ struct malicious_vf_eqe_data {
  * Event Ring initial cleanup data
  */
 struct initial_cleanup_eqe_data {
-	u8 vf_id /* VF ID */; /* WARNING:CAMELCASE */
+	u8 vfId /* VF ID */;
 	u8 reserved[7];
 };
 
-
+/*
+ * Event Data Union
+ */
 union event_ring_data {
 	u8 bytes[8] /* Byte Array */;
 	struct vf_pf_channel_eqe_data vf_pf_channel /* VF-PF Channel data */;
 	struct iscsi_eqe_data iscsi_info /* Dedicated fields to iscsi data */;
-	struct regpair roce_handle /* WARNING:CAMELCASE */
 	    /* Dedicated field for RoCE affiliated asynchronous error */;
+	struct regpair roceHandle;
 	struct malicious_vf_eqe_data malicious_vf /* Malicious VF data */;
 	struct initial_cleanup_eqe_data vf_init_cleanup
 	    /* VF Initial Cleanup data */;
+/* Host handle for the Async Completions */
+	struct regpair iwarp_handle;
 };
 /* Event Ring Entry */
 struct event_ring_entry {
-	u8			protocol_id;
-	u8			opcode;
-	__le16			reserved0;
-	__le16			echo;
-	u8			fw_return_code;
+	u8 protocol_id /* Event Protocol ID */;
+	u8 opcode /* Event Opcode */;
+	__le16 reserved0 /* Reserved */;
+	__le16 echo /* Echo value from ramrod data on the host */;
+	u8 fw_return_code /* FW return code for SP ramrods */;
 	u8 flags;
+/* 0: synchronous EQE - a completion of SP message. 1: asynchronous EQE */
 #define EVENT_RING_ENTRY_ASYNC_MASK      0x1
 #define EVENT_RING_ENTRY_ASYNC_SHIFT     0
 #define EVENT_RING_ENTRY_RESERVED1_MASK  0x7F
 #define EVENT_RING_ENTRY_RESERVED1_SHIFT 1
-	union event_ring_data data;
+	union event_ring_data	data;
 };
 
 /* Multi function mode */
 enum mf_mode {
-	SF,
-	MF_OVLAN,
-	MF_NPAR,
+	ERROR_MODE /* Unsupported mode */,
+	MF_OVLAN /* Multi function based on outer VLAN */,
+	MF_NPAR /* Multi function based on MAC address (NIC partitioning) */,
 	MAX_MF_MODE
 };
 
@@ -390,35 +768,59 @@ enum protocol_type {
 	MAX_PROTOCOL_TYPE
 };
 
+/*
+ * Ustorm Queue Zone
+ */
+struct ustorm_eth_queue_zone {
+/* Rx interrupt coalescing TimeSet */
+	struct coalescing_timeset int_coalescing_timeset;
+	u8 reserved[3];
+};
+
+
+struct ustorm_queue_zone {
+	struct ustorm_eth_queue_zone eth;
+	struct common_queue_zone common;
+};
+
 /* status block structure */
 struct cau_pi_entry {
-	u32 prod;
+	__le32 prod;
+/* A per protocol indexPROD value. */
 #define CAU_PI_ENTRY_PROD_VAL_MASK    0xFFFF
 #define CAU_PI_ENTRY_PROD_VAL_SHIFT   0
+/* This value determines the TimeSet that the PI is associated with */
 #define CAU_PI_ENTRY_PI_TIMESET_MASK  0x7F
 #define CAU_PI_ENTRY_PI_TIMESET_SHIFT 16
+/* Select the FSM within the SB */
 #define CAU_PI_ENTRY_FSM_SEL_MASK     0x1
 #define CAU_PI_ENTRY_FSM_SEL_SHIFT    23
+/* Select the FSM within the SB */
 #define CAU_PI_ENTRY_RESERVED_MASK    0xFF
 #define CAU_PI_ENTRY_RESERVED_SHIFT   24
 };
 
 /* status block structure */
 struct cau_sb_entry {
-	u32 data;
+	__le32 data;
+/* The SB PROD index which is sent to the IGU. */
 #define CAU_SB_ENTRY_SB_PROD_MASK      0xFFFFFF
 #define CAU_SB_ENTRY_SB_PROD_SHIFT     0
-#define CAU_SB_ENTRY_STATE0_MASK       0xF
+#define CAU_SB_ENTRY_STATE0_MASK       0xF /* RX state */
 #define CAU_SB_ENTRY_STATE0_SHIFT      24
-#define CAU_SB_ENTRY_STATE1_MASK       0xF
+#define CAU_SB_ENTRY_STATE1_MASK       0xF /* TX state */
 #define CAU_SB_ENTRY_STATE1_SHIFT      28
-	u32 params;
+	__le32 params;
+/* Indicates the RX TimeSet that this SB is associated with. */
 #define CAU_SB_ENTRY_SB_TIMESET0_MASK  0x7F
 #define CAU_SB_ENTRY_SB_TIMESET0_SHIFT 0
+/* Indicates the TX TimeSet that this SB is associated with. */
 #define CAU_SB_ENTRY_SB_TIMESET1_MASK  0x7F
 #define CAU_SB_ENTRY_SB_TIMESET1_SHIFT 7
+/* This value will determine the RX FSM timer resolution in ticks */
 #define CAU_SB_ENTRY_TIMER_RES0_MASK   0x3
 #define CAU_SB_ENTRY_TIMER_RES0_SHIFT  14
+/* This value will determine the TX FSM timer resolution in ticks */
 #define CAU_SB_ENTRY_TIMER_RES1_MASK   0x3
 #define CAU_SB_ENTRY_TIMER_RES1_SHIFT  16
 #define CAU_SB_ENTRY_VF_NUMBER_MASK    0xFF
@@ -427,6 +829,9 @@ struct cau_sb_entry {
 #define CAU_SB_ENTRY_VF_VALID_SHIFT    26
 #define CAU_SB_ENTRY_PF_NUMBER_MASK    0xF
 #define CAU_SB_ENTRY_PF_NUMBER_SHIFT   27
+/* If set then indicates that the TPH STAG is equal to the SB number. Otherwise
+ * the STAG will be equal to all ones.
+ */
 #define CAU_SB_ENTRY_TPH_MASK          0x1
 #define CAU_SB_ENTRY_TPH_SHIFT         31
 };
@@ -434,125 +839,317 @@ struct cau_sb_entry {
 /* core doorbell data */
 struct core_db_data {
 	u8 params;
+/* destination of doorbell (use enum db_dest) */
 #define CORE_DB_DATA_DEST_MASK         0x3
 #define CORE_DB_DATA_DEST_SHIFT        0
+/* aggregative command to CM (use enum db_agg_cmd_sel) */
 #define CORE_DB_DATA_AGG_CMD_MASK      0x3
 #define CORE_DB_DATA_AGG_CMD_SHIFT     2
-#define CORE_DB_DATA_BYPASS_EN_MASK    0x1
+#define CORE_DB_DATA_BYPASS_EN_MASK    0x1 /* enable QM bypass */
 #define CORE_DB_DATA_BYPASS_EN_SHIFT   4
 #define CORE_DB_DATA_RESERVED_MASK     0x1
 #define CORE_DB_DATA_RESERVED_SHIFT    5
+/* aggregative value selection */
 #define CORE_DB_DATA_AGG_VAL_SEL_MASK  0x3
 #define CORE_DB_DATA_AGG_VAL_SEL_SHIFT 6
-	u8 agg_flags;
-	__le16 spq_prod;
+/* bit for every DQ counter flags in CM context that DQ can increment */
+	u8	agg_flags;
+	__le16	spq_prod;
 };
 
 /* Enum of doorbell aggregative command selection */
 enum db_agg_cmd_sel {
-	DB_AGG_CMD_NOP,
-	DB_AGG_CMD_SET,
-	DB_AGG_CMD_ADD,
-	DB_AGG_CMD_MAX,
+	DB_AGG_CMD_NOP /* No operation */,
+	DB_AGG_CMD_SET /* Set the value */,
+	DB_AGG_CMD_ADD /* Add the value */,
+	DB_AGG_CMD_MAX /* Set max of current and new value */,
 	MAX_DB_AGG_CMD_SEL
 };
 
 /* Enum of doorbell destination */
 enum db_dest {
-	DB_DEST_XCM,
-	DB_DEST_UCM,
-	DB_DEST_TCM,
+	DB_DEST_XCM /* TX doorbell to XCM */,
+	DB_DEST_UCM /* RX doorbell to UCM */,
+	DB_DEST_TCM /* RX doorbell to TCM */,
 	DB_NUM_DESTINATIONS,
 	MAX_DB_DEST
 };
 
+
+/*
+ * Enum of doorbell DPM types
+ */
+enum db_dpm_type {
+	DPM_LEGACY /* Legacy DPM- to Xstorm RAM */,
+	DPM_ROCE /* RoCE DPM- to NIG */,
+/* L2 DPM inline- to PBF, with packet data on doorbell */
+	DPM_L2_INLINE,
+	DPM_L2_BD /* L2 DPM with BD- to PBF, with TX BD data on doorbell */,
+	MAX_DB_DPM_TYPE
+};
+
+/*
+ * Structure for doorbell data, in L2 DPM mode, for the first doorbell in a DPM
+ * burst
+ */
+struct db_l2_dpm_data {
+	__le16 icid /* internal CID */;
+	__le16 bd_prod /* bd producer value to update */;
+	__le32 params;
+/* Size in QWORD-s of the DPM burst */
+#define DB_L2_DPM_DATA_SIZE_MASK       0x3F
+#define DB_L2_DPM_DATA_SIZE_SHIFT      0
+/* Type of DPM transaction (DPM_L2_INLINE or DPM_L2_BD) (use enum db_dpm_type)
+ */
+#define DB_L2_DPM_DATA_DPM_TYPE_MASK   0x3
+#define DB_L2_DPM_DATA_DPM_TYPE_SHIFT  6
+#define DB_L2_DPM_DATA_NUM_BDS_MASK    0xFF /* number of BD-s */
+#define DB_L2_DPM_DATA_NUM_BDS_SHIFT   8
+/* size of the packet to be transmitted in bytes */
+#define DB_L2_DPM_DATA_PKT_SIZE_MASK   0x7FF
+#define DB_L2_DPM_DATA_PKT_SIZE_SHIFT  16
+#define DB_L2_DPM_DATA_RESERVED0_MASK  0x1
+#define DB_L2_DPM_DATA_RESERVED0_SHIFT 27
+/* In DPM_L2_BD mode: the number of SGE-s */
+#define DB_L2_DPM_DATA_SGE_NUM_MASK    0x7
+#define DB_L2_DPM_DATA_SGE_NUM_SHIFT   28
+#define DB_L2_DPM_DATA_RESERVED1_MASK  0x1
+#define DB_L2_DPM_DATA_RESERVED1_SHIFT 31
+};
+
+/*
+ * Structure for SGE in a DPM doorbell of type DPM_L2_BD
+ */
+struct db_l2_dpm_sge {
+	struct regpair addr /* Single continuous buffer */;
+	__le16 nbytes /* Number of bytes in this BD. */;
+	__le16 bitfields;
+/* The TPH STAG index value */
+#define DB_L2_DPM_SGE_TPH_ST_INDEX_MASK  0x1FF
+#define DB_L2_DPM_SGE_TPH_ST_INDEX_SHIFT 0
+#define DB_L2_DPM_SGE_RESERVED0_MASK     0x3
+#define DB_L2_DPM_SGE_RESERVED0_SHIFT    9
+/* Indicate if ST hint is requested or not */
+#define DB_L2_DPM_SGE_ST_VALID_MASK      0x1
+#define DB_L2_DPM_SGE_ST_VALID_SHIFT     11
+#define DB_L2_DPM_SGE_RESERVED1_MASK     0xF
+#define DB_L2_DPM_SGE_RESERVED1_SHIFT    12
+	__le32 reserved2;
+};
+
 /* Structure for doorbell address, in legacy mode */
 struct db_legacy_addr {
 	__le32 addr;
 #define DB_LEGACY_ADDR_RESERVED0_MASK  0x3
 #define DB_LEGACY_ADDR_RESERVED0_SHIFT 0
+/* doorbell extraction mode specifier- 0 if not used */
 #define DB_LEGACY_ADDR_DEMS_MASK       0x7
 #define DB_LEGACY_ADDR_DEMS_SHIFT      2
-#define DB_LEGACY_ADDR_ICID_MASK       0x7FFFFFF
+#define DB_LEGACY_ADDR_ICID_MASK       0x7FFFFFF /* internal CID */
 #define DB_LEGACY_ADDR_ICID_SHIFT      5
 };
 
+/*
+ * Structure for doorbell address, in PWM mode
+ */
+struct db_pwm_addr {
+	__le32 addr;
+#define DB_PWM_ADDR_RESERVED0_MASK  0x7
+#define DB_PWM_ADDR_RESERVED0_SHIFT 0
+/* Offset in PWM address space */
+#define DB_PWM_ADDR_OFFSET_MASK     0x7F
+#define DB_PWM_ADDR_OFFSET_SHIFT    3
+#define DB_PWM_ADDR_WID_MASK        0x3 /* Window ID */
+#define DB_PWM_ADDR_WID_SHIFT       10
+#define DB_PWM_ADDR_DPI_MASK        0xFFFF /* Doorbell page ID */
+#define DB_PWM_ADDR_DPI_SHIFT       12
+#define DB_PWM_ADDR_RESERVED1_MASK  0xF
+#define DB_PWM_ADDR_RESERVED1_SHIFT 28
+};
+
+/*
+ * Parameters to RoCE firmware, passed in EDPM doorbell
+ */
+struct db_roce_dpm_params {
+	__le32 params;
+/* Size in QWORD-s of the DPM burst */
+#define DB_ROCE_DPM_PARAMS_SIZE_MASK            0x3F
+#define DB_ROCE_DPM_PARAMS_SIZE_SHIFT           0
+/* Type of DPM transacation (DPM_ROCE) (use enum db_dpm_type) */
+#define DB_ROCE_DPM_PARAMS_DPM_TYPE_MASK        0x3
+#define DB_ROCE_DPM_PARAMS_DPM_TYPE_SHIFT       6
+/* opcode for ROCE operation */
+#define DB_ROCE_DPM_PARAMS_OPCODE_MASK          0xFF
+#define DB_ROCE_DPM_PARAMS_OPCODE_SHIFT         8
+/* the size of the WQE payload in bytes */
+#define DB_ROCE_DPM_PARAMS_WQE_SIZE_MASK        0x7FF
+#define DB_ROCE_DPM_PARAMS_WQE_SIZE_SHIFT       16
+#define DB_ROCE_DPM_PARAMS_RESERVED0_MASK       0x1
+#define DB_ROCE_DPM_PARAMS_RESERVED0_SHIFT      27
+/* RoCE completion flag */
+#define DB_ROCE_DPM_PARAMS_COMPLETION_FLG_MASK  0x1
+#define DB_ROCE_DPM_PARAMS_COMPLETION_FLG_SHIFT 28
+#define DB_ROCE_DPM_PARAMS_S_FLG_MASK           0x1 /* RoCE S flag */
+#define DB_ROCE_DPM_PARAMS_S_FLG_SHIFT          29
+#define DB_ROCE_DPM_PARAMS_RESERVED1_MASK       0x3
+#define DB_ROCE_DPM_PARAMS_RESERVED1_SHIFT      30
+};
+
+/*
+ * Structure for doorbell data, in ROCE DPM mode, for the first doorbell in a
+ * DPM burst
+ */
+struct db_roce_dpm_data {
+	__le16 icid /* internal CID */;
+	__le16 prod_val /* aggregated value to update */;
+/* parameters passed to RoCE firmware */
+	struct db_roce_dpm_params params;
+};
+
 /* Igu interrupt command */
 enum igu_int_cmd {
-	IGU_INT_ENABLE = 0,
+	IGU_INT_ENABLE	= 0,
 	IGU_INT_DISABLE = 1,
-	IGU_INT_NOP = 2,
-	IGU_INT_NOP2 = 3,
+	IGU_INT_NOP	= 2,
+	IGU_INT_NOP2	= 3,
 	MAX_IGU_INT_CMD
 };
 
 /* IGU producer or consumer update command */
 struct igu_prod_cons_update {
-	u32 sb_id_and_flags;
+	__le32 sb_id_and_flags;
 #define IGU_PROD_CONS_UPDATE_SB_INDEX_MASK        0xFFFFFF
 #define IGU_PROD_CONS_UPDATE_SB_INDEX_SHIFT       0
 #define IGU_PROD_CONS_UPDATE_UPDATE_FLAG_MASK     0x1
 #define IGU_PROD_CONS_UPDATE_UPDATE_FLAG_SHIFT    24
+/* interrupt enable/disable/nop (use enum igu_int_cmd) */
 #define IGU_PROD_CONS_UPDATE_ENABLE_INT_MASK      0x3
 #define IGU_PROD_CONS_UPDATE_ENABLE_INT_SHIFT     25
+/*  (use enum igu_seg_access) */
 #define IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_MASK  0x1
 #define IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_SHIFT 27
 #define IGU_PROD_CONS_UPDATE_TIMER_MASK_MASK      0x1
 #define IGU_PROD_CONS_UPDATE_TIMER_MASK_SHIFT     28
 #define IGU_PROD_CONS_UPDATE_RESERVED0_MASK       0x3
 #define IGU_PROD_CONS_UPDATE_RESERVED0_SHIFT      29
+/* must always be set cleared (use enum command_type_bit) */
 #define IGU_PROD_CONS_UPDATE_COMMAND_TYPE_MASK    0x1
 #define IGU_PROD_CONS_UPDATE_COMMAND_TYPE_SHIFT   31
-	u32 reserved1;
+	__le32 reserved1;
 };
 
 /* Igu segments access for default status block only */
 enum igu_seg_access {
-	IGU_SEG_ACCESS_REG = 0,
-	IGU_SEG_ACCESS_ATTN = 1,
+	IGU_SEG_ACCESS_REG	= 0,
+	IGU_SEG_ACCESS_ATTN	= 1,
 	MAX_IGU_SEG_ACCESS
 };
 
+
+/*
+ * Enumeration for L3 type field of parsing_and_err_flags_union. L3Type:
+ * 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled according
+ * to the last-ethertype)
+ */
+enum l3_type {
+	e_l3Type_unknown,
+	e_l3Type_ipv4,
+	e_l3Type_ipv6,
+	MAX_L3_TYPE
+};
+
+
+/*
+ * Enumeration for l4Protocol field of parsing_and_err_flags_union. L4-protocol
+ * 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and its not the
+ * first fragment, the protocol-type should be set to none.
+ */
+enum l4_protocol {
+	e_l4Protocol_none,
+	e_l4Protocol_tcp,
+	e_l4Protocol_udp,
+	MAX_L4_PROTOCOL
+};
+
+
+/*
+ * Parsing and error flags field.
+ */
 struct parsing_and_err_flags {
 	__le16 flags;
+/* L3Type: 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled
+ * according to the last-ethertype) (use enum l3_type)
+ */
 #define PARSING_AND_ERR_FLAGS_L3TYPE_MASK                      0x3
 #define PARSING_AND_ERR_FLAGS_L3TYPE_SHIFT                     0
+/* L4-protocol 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and
+ * its not the first fragment, the protocol-type should be set to none.
+ * (use enum l4_protocol)
+ */
 #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_MASK                  0x3
 #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_SHIFT                 2
+/* Set if the packet is IPv4 fragment. */
 #define PARSING_AND_ERR_FLAGS_IPV4FRAG_MASK                    0x1
 #define PARSING_AND_ERR_FLAGS_IPV4FRAG_SHIFT                   4
+/* Set if VLAN tag exists. Invalid if tunnel type are IP GRE or IP GENEVE. */
 #define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK               0x1
 #define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_SHIFT              5
+/* Set if L4 checksum was calculated. */
 #define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_MASK        0x1
 #define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_SHIFT       6
+/* Set for PTP packet. */
 #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_MASK                 0x1
 #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_SHIFT                7
+/* Set if PTP timestamp recorded. */
 #define PARSING_AND_ERR_FLAGS_TIMESTAMPRECORDED_MASK           0x1
 #define PARSING_AND_ERR_FLAGS_TIMESTAMPRECORDED_SHIFT          8
+/* Set if either version-mismatch or hdr-len-error or ipv4-cksm is set or ipv6
+ * ver mismatch
+ */
 #define PARSING_AND_ERR_FLAGS_IPHDRERROR_MASK                  0x1
 #define PARSING_AND_ERR_FLAGS_IPHDRERROR_SHIFT                 9
+/* Set if L4 checksum validation failed. Valid only if L4 checksum was
+ * calculated.
+ */
 #define PARSING_AND_ERR_FLAGS_L4CHKSMERROR_MASK                0x1
 #define PARSING_AND_ERR_FLAGS_L4CHKSMERROR_SHIFT               10
+/* Set if GRE/VXLAN/GENEVE tunnel detected. */
 #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_MASK                 0x1
 #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_SHIFT                11
+/* Set if VLAN tag exists in tunnel header. */
 #define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_MASK         0x1
 #define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_SHIFT        12
+/* Set if either tunnel-ipv4-version-mismatch or tunnel-ipv4-hdr-len-error or
+ * tunnel-ipv4-cksm is set or tunneling ipv6 ver mismatch
+ */
 #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_MASK            0x1
 #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_SHIFT           13
+/* Set if GRE or VXLAN/GENEVE UDP checksum was calculated. */
 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_MASK  0x1
 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_SHIFT 14
+/* Set if tunnel L4 checksum validation failed. Valid only if tunnel L4 checksum
+ * was calculated.
+ */
 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_MASK          0x1
 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_SHIFT         15
 };
 
+
+/*
+ * Pb context
+ */
+struct pb_context {
+	__le32 crc[4];
+};
+
 /* Concrete Function ID. */
 struct pxp_concrete_fid {
 	__le16 fid;
-#define PXP_CONCRETE_FID_PFID_MASK     0xF
+#define PXP_CONCRETE_FID_PFID_MASK     0xF /* Parent PFID */
 #define PXP_CONCRETE_FID_PFID_SHIFT    0
-#define PXP_CONCRETE_FID_PORT_MASK     0x3
+#define PXP_CONCRETE_FID_PORT_MASK     0x3 /* port number */
 #define PXP_CONCRETE_FID_PORT_SHIFT    4
-#define PXP_CONCRETE_FID_PATH_MASK     0x1
+#define PXP_CONCRETE_FID_PATH_MASK     0x1 /* path number */
 #define PXP_CONCRETE_FID_PATH_SHIFT    6
 #define PXP_CONCRETE_FID_VFVALID_MASK  0x1
 #define PXP_CONCRETE_FID_VFVALID_SHIFT 7
@@ -574,13 +1171,13 @@ struct pxp_pretend_concrete_fid {
 
 union pxp_pretend_fid {
 	struct pxp_pretend_concrete_fid concrete_fid;
-	__le16 opaque_fid;
+	__le16				opaque_fid;
 };
 
 /* Pxp Pretend Command Register. */
 struct pxp_pretend_cmd {
-	union pxp_pretend_fid fid;
-	__le16 control;
+	union pxp_pretend_fid	fid;
+	__le16			control;
 #define PXP_PRETEND_CMD_PATH_MASK              0x1
 #define PXP_PRETEND_CMD_PATH_SHIFT             0
 #define PXP_PRETEND_CMD_USE_PORT_MASK          0x1
@@ -603,30 +1200,127 @@ struct pxp_pretend_cmd {
 
 /* PTT Record in PXP Admin Window. */
 struct pxp_ptt_entry {
-	__le32 offset;
+	__le32			offset;
 #define PXP_PTT_ENTRY_OFFSET_MASK     0x7FFFFF
 #define PXP_PTT_ENTRY_OFFSET_SHIFT    0
 #define PXP_PTT_ENTRY_RESERVED0_MASK  0x1FF
 #define PXP_PTT_ENTRY_RESERVED0_SHIFT 23
-	struct pxp_pretend_cmd pretend;
+	struct pxp_pretend_cmd	pretend;
+};
+
+
+/*
+ * VF Zone A Permission Register.
+ */
+struct pxp_vf_zone_a_permission {
+	__le32 control;
+#define PXP_VF_ZONE_A_PERMISSION_VFID_MASK       0xFF
+#define PXP_VF_ZONE_A_PERMISSION_VFID_SHIFT      0
+#define PXP_VF_ZONE_A_PERMISSION_VALID_MASK      0x1
+#define PXP_VF_ZONE_A_PERMISSION_VALID_SHIFT     8
+#define PXP_VF_ZONE_A_PERMISSION_RESERVED0_MASK  0x7F
+#define PXP_VF_ZONE_A_PERMISSION_RESERVED0_SHIFT 9
+#define PXP_VF_ZONE_A_PERMISSION_RESERVED1_MASK  0xFFFF
+#define PXP_VF_ZONE_A_PERMISSION_RESERVED1_SHIFT 16
+};
+
+
+/*
+ * Rdif context
+ */
+struct rdif_task_context {
+	__le32 initialRefTag;
+	__le16 appTagValue;
+	__le16 appTagMask;
+	u8 flags0;
+#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK            0x1
+#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT           0
+#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK      0x1
+#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT     1
+/* 0 = IP checksum, 1 = CRC */
+#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK           0x1
+#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT          2
+#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK         0x1
+#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT        3
+/* 1/2/3 - Protection Type */
+#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK          0x3
+#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT         4
+/* 0=0x0000, 1=0xffff */
+#define RDIF_TASK_CONTEXT_CRC_SEED_MASK                0x1
+#define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT               6
+/* Keep reference tag constant */
+#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK         0x1
+#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT        7
+	u8 partialDifData[7];
+	__le16 partialCrcValue;
+	__le16 partialChecksumValue;
+	__le32 offsetInIO;
+	__le16 flags1;
+#define RDIF_TASK_CONTEXT_VALIDATEGUARD_MASK           0x1
+#define RDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT          0
+#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK          0x1
+#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT         1
+#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK          0x1
+#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT         2
+#define RDIF_TASK_CONTEXT_FORWARDGUARD_MASK            0x1
+#define RDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT           3
+#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK           0x1
+#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT          4
+#define RDIF_TASK_CONTEXT_FORWARDREFTAG_MASK           0x1
+#define RDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT          5
+/* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */
+#define RDIF_TASK_CONTEXT_INTERVALSIZE_MASK            0x7
+#define RDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT           6
+/* 0=None, 1=DIF, 2=DIX */
+#define RDIF_TASK_CONTEXT_HOSTINTERFACE_MASK           0x3
+#define RDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT          9
+/* DIF tag right at the beginning of DIF interval */
+#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK           0x1
+#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT          11
+#define RDIF_TASK_CONTEXT_RESERVED0_MASK               0x1
+#define RDIF_TASK_CONTEXT_RESERVED0_SHIFT              12
+/* 0=None, 1=DIF */
+#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK        0x1
+#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT       13
+/* Forward application tag with mask */
+#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK   0x1
+#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT  14
+/* Forward reference tag with mask */
+#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK   0x1
+#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT  15
+	__le16 state;
+#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_MASK    0xF
+#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_SHIFT   0
+#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_MASK  0xF
+#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_SHIFT 4
+#define RDIF_TASK_CONTEXT_ERRORINIO_MASK               0x1
+#define RDIF_TASK_CONTEXT_ERRORINIO_SHIFT              8
+#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK        0x1
+#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT       9
+/* mask for refernce tag handling */
+#define RDIF_TASK_CONTEXT_REFTAGMASK_MASK              0xF
+#define RDIF_TASK_CONTEXT_REFTAGMASK_SHIFT             10
+#define RDIF_TASK_CONTEXT_RESERVED1_MASK               0x3
+#define RDIF_TASK_CONTEXT_RESERVED1_SHIFT              14
+	__le32 reserved2;
 };
 
 /* RSS hash type */
 enum rss_hash_type {
-	RSS_HASH_TYPE_DEFAULT = 0,
-	RSS_HASH_TYPE_IPV4 = 1,
-	RSS_HASH_TYPE_TCP_IPV4 = 2,
-	RSS_HASH_TYPE_IPV6 = 3,
-	RSS_HASH_TYPE_TCP_IPV6 = 4,
-	RSS_HASH_TYPE_UDP_IPV4 = 5,
-	RSS_HASH_TYPE_UDP_IPV6 = 6,
+	RSS_HASH_TYPE_DEFAULT	= 0,
+	RSS_HASH_TYPE_IPV4	= 1,
+	RSS_HASH_TYPE_TCP_IPV4	= 2,
+	RSS_HASH_TYPE_IPV6	= 3,
+	RSS_HASH_TYPE_TCP_IPV6	= 4,
+	RSS_HASH_TYPE_UDP_IPV4	= 5,
+	RSS_HASH_TYPE_UDP_IPV6	= 6,
 	MAX_RSS_HASH_TYPE
 };
 
 /* status block structure */
 struct status_block {
-	__le16 pi_array[PIS_PER_SB];
-	__le32 sb_num;
+	__le16	pi_array[PIS_PER_SB];
+	__le32	sb_num;
 #define STATUS_BLOCK_SB_NUM_MASK      0x1FF
 #define STATUS_BLOCK_SB_NUM_SHIFT     0
 #define STATUS_BLOCK_ZERO_PAD_MASK    0x7F
@@ -640,20 +1334,6 @@ struct status_block {
 #define STATUS_BLOCK_ZERO_PAD3_SHIFT  24
 };
 
-/* @DPDK */
-#define X_FINAL_CLEANUP_AGG_INT  1
-#define SDM_COMP_TYPE_AGG_INT 2
-#define MAX_NUM_LL2_RX_QUEUES 32
-#define QM_PQ_ELEMENT_SIZE 4
-#define PXP_VF_BAR0_START_IGU 0
-#define EAGLE_ENG1_WORKAROUND_NIG_FLOWCTRL_MODE 3
-
-#define TSTORM_QZONE_SIZE 8
-#define MSTORM_QZONE_SIZE 16
-#define USTORM_QZONE_SIZE 8
-#define XSTORM_QZONE_SIZE 0
-#define YSTORM_QZONE_SIZE 8
-#define PSTORM_QZONE_SIZE 0
 
 /* VF BAR */
 #define PXP_VF_BAR0 0
@@ -708,7 +1388,165 @@ struct status_block {
 
 #define PXP_VF_BAR0_GRC_WINDOW_LENGTH   32
 
-#define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN  12
-#define PXP_ILT_BLOCK_FACTOR_MULTIPLIER 1024
+/*
+ * Tdif context
+ */
+struct tdif_task_context {
+	__le32 initialRefTag;
+	__le16 appTagValue;
+	__le16 appTagMask;
+	__le16 partialCrcValueB;
+	__le16 partialChecksumValueB;
+	__le16 stateB;
+#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_MASK    0xF
+#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_SHIFT   0
+#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_MASK  0xF
+#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_SHIFT 4
+#define TDIF_TASK_CONTEXT_ERRORINIOB_MASK               0x1
+#define TDIF_TASK_CONTEXT_ERRORINIOB_SHIFT              8
+#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK         0x1
+#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT        9
+#define TDIF_TASK_CONTEXT_RESERVED0_MASK                0x3F
+#define TDIF_TASK_CONTEXT_RESERVED0_SHIFT               10
+	u8 reserved1;
+	u8 flags0;
+#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK             0x1
+#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT            0
+#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK       0x1
+#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT      1
+/* 0 = IP checksum, 1 = CRC */
+#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK            0x1
+#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT           2
+#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK          0x1
+#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT         3
+/* 1/2/3 - Protection Type */
+#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK           0x3
+#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT          4
+/* 0=0x0000, 1=0xffff */
+#define TDIF_TASK_CONTEXT_CRC_SEED_MASK                 0x1
+#define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT                6
+#define TDIF_TASK_CONTEXT_RESERVED2_MASK                0x1
+#define TDIF_TASK_CONTEXT_RESERVED2_SHIFT               7
+	__le32 flags1;
+#define TDIF_TASK_CONTEXT_VALIDATEGUARD_MASK            0x1
+#define TDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT           0
+#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK           0x1
+#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT          1
+#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK           0x1
+#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT          2
+#define TDIF_TASK_CONTEXT_FORWARDGUARD_MASK             0x1
+#define TDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT            3
+#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK            0x1
+#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT           4
+#define TDIF_TASK_CONTEXT_FORWARDREFTAG_MASK            0x1
+#define TDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT           5
+/* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */
+#define TDIF_TASK_CONTEXT_INTERVALSIZE_MASK             0x7
+#define TDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT            6
+/* 0=None, 1=DIF, 2=DIX */
+#define TDIF_TASK_CONTEXT_HOSTINTERFACE_MASK            0x3
+#define TDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT           9
+/* DIF tag right at the beginning of DIF interval */
+#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK            0x1
+#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT           11
+/* reserved */
+#define TDIF_TASK_CONTEXT_RESERVED3_MASK                0x1
+#define TDIF_TASK_CONTEXT_RESERVED3_SHIFT               12
+/* 0=None, 1=DIF */
+#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK         0x1
+#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT        13
+#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_MASK    0xF
+#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_SHIFT   14
+#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_MASK  0xF
+#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_SHIFT 18
+#define TDIF_TASK_CONTEXT_ERRORINIOA_MASK               0x1
+#define TDIF_TASK_CONTEXT_ERRORINIOA_SHIFT              22
+#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_MASK        0x1
+#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_SHIFT       23
+/* mask for refernce tag handling */
+#define TDIF_TASK_CONTEXT_REFTAGMASK_MASK               0xF
+#define TDIF_TASK_CONTEXT_REFTAGMASK_SHIFT              24
+/* Forward application tag with mask */
+#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK    0x1
+#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT   28
+/* Forward reference tag with mask */
+#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK    0x1
+#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT   29
+/* Keep reference tag constant */
+#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK          0x1
+#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT         30
+#define TDIF_TASK_CONTEXT_RESERVED4_MASK                0x1
+#define TDIF_TASK_CONTEXT_RESERVED4_SHIFT               31
+	__le32 offsetInIOB;
+	__le16 partialCrcValueA;
+	__le16 partialChecksumValueA;
+	__le32 offsetInIOA;
+	u8 partialDifDataA[8];
+	u8 partialDifDataB[8];
+};
+
+
+/*
+ * Timers context
+ */
+struct timers_context {
+	__le32 logical_client_0;
+/* Expiration time of logical client 0 */
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC0_MASK     0xFFFFFFF
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC0_SHIFT    0
+/* Valid bit of logical client 0 */
+#define TIMERS_CONTEXT_VALIDLC0_MASK              0x1
+#define TIMERS_CONTEXT_VALIDLC0_SHIFT             28
+/* Active bit of logical client 0 */
+#define TIMERS_CONTEXT_ACTIVELC0_MASK             0x1
+#define TIMERS_CONTEXT_ACTIVELC0_SHIFT            29
+#define TIMERS_CONTEXT_RESERVED0_MASK             0x3
+#define TIMERS_CONTEXT_RESERVED0_SHIFT            30
+	__le32 logical_client_1;
+/* Expiration time of logical client 1 */
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC1_MASK     0xFFFFFFF
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC1_SHIFT    0
+/* Valid bit of logical client 1 */
+#define TIMERS_CONTEXT_VALIDLC1_MASK              0x1
+#define TIMERS_CONTEXT_VALIDLC1_SHIFT             28
+/* Active bit of logical client 1 */
+#define TIMERS_CONTEXT_ACTIVELC1_MASK             0x1
+#define TIMERS_CONTEXT_ACTIVELC1_SHIFT            29
+#define TIMERS_CONTEXT_RESERVED1_MASK             0x3
+#define TIMERS_CONTEXT_RESERVED1_SHIFT            30
+	__le32 logical_client_2;
+/* Expiration time of logical client 2 */
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC2_MASK     0xFFFFFFF
+#define TIMERS_CONTEXT_EXPIRATIONTIMELC2_SHIFT    0
+/* Valid bit of logical client 2 */
+#define TIMERS_CONTEXT_VALIDLC2_MASK              0x1
+#define TIMERS_CONTEXT_VALIDLC2_SHIFT             28
+/* Active bit of logical client 2 */
+#define TIMERS_CONTEXT_ACTIVELC2_MASK             0x1
+#define TIMERS_CONTEXT_ACTIVELC2_SHIFT            29
+#define TIMERS_CONTEXT_RESERVED2_MASK             0x3
+#define TIMERS_CONTEXT_RESERVED2_SHIFT            30
+	__le32 host_expiration_fields;
+/* Expiration time on host (closest one) */
+#define TIMERS_CONTEXT_HOSTEXPRIRATIONVALUE_MASK  0xFFFFFFF
+#define TIMERS_CONTEXT_HOSTEXPRIRATIONVALUE_SHIFT 0
+/* Valid bit of host expiration */
+#define TIMERS_CONTEXT_HOSTEXPRIRATIONVALID_MASK  0x1
+#define TIMERS_CONTEXT_HOSTEXPRIRATIONVALID_SHIFT 28
+#define TIMERS_CONTEXT_RESERVED3_MASK             0x7
+#define TIMERS_CONTEXT_RESERVED3_SHIFT            29
+};
+
+
+/*
+ * Enum for next_protocol field of tunnel_parsing_flags
+ */
+enum tunnel_next_protocol {
+	e_unknown = 0,
+	e_l2 = 1,
+	e_ipv4 = 2,
+	e_ipv6 = 3,
+	MAX_TUNNEL_NEXT_PROTOCOL
+};
 
 #endif /* __COMMON_HSI__ */
drivers/net/qede/base/ecore_dev.c +0 -2
index 46d3e80..9e32279 100644
@@ -3056,8 +3056,6 @@ static enum _ecore_status_t ecore_set_coalesce(struct ecore_hwfn *p_hwfn,
 
 	OSAL_MEMSET(p_qzone, 0, qzone_size);
 	p_coalesce_timeset = p_qzone;
-	p_coalesce_timeset->timeset = timeset;
-	p_coalesce_timeset->valid = 1;
 	ecore_memcpy_to(p_hwfn, p_ptt, hw_addr, p_qzone, qzone_size);
 
 	return ECORE_SUCCESS;
drivers/net/qede/base/ecore_hsi_common.h +272 -23

492 lines not on this page · raw message

drivers/net/qede/base/ecore_hw.c +2 -2
index e9b96d5..72bc6de 100644
@@ -461,7 +461,7 @@ ecore_dmae_post_command(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt)
 			  " src=0x%x:%x dst=0x%x:%x\n",
 			  idx_cmd, (u32)p_command->opcode,
 			  (u16)p_command->opcode_b,
-			  (int)p_command->length,
+			  (int)p_command->length_dw,
 			  (int)p_command->src_addr_hi,
 			  (int)p_command->src_addr_lo,
 			  (int)p_command->dst_addr_hi,
@@ -668,7 +668,7 @@ ecore_dmae_execute_sub_operation(struct ecore_hwfn *p_hwfn,
 		return ECORE_INVAL;
 	}
 
-	cmd->length = (u16)length;
+	cmd->length_dw = (u16)length;
 
 	if (src_type == ECORE_DMAE_ADDRESS_HOST_VIRT ||
 	    src_type == ECORE_DMAE_ADDRESS_HOST_PHYS)
drivers/net/qede/base/eth_common.h +0 -27
index 71ef615..bd73f7d 100644
@@ -59,14 +59,6 @@
 #define ETH_TPA_CQE_END_LEN_LIST_SIZE     4
 
 /*
- * Interrupt coalescing TimeSet
- */
-struct coalescing_timeset {
-	u8 timeset;
-	u8 valid /* Only if this flag is set, timeset will take effect */;
-};
-
-/*
  * Destination port mode
  */
 enum dest_port_mode {
@@ -364,16 +356,6 @@ struct eth_rx_pmd_cqe {
 };
 
 /*
- * ETH Rx producers data
- */
-struct eth_rx_prod_data {
-	__le16 bd_prod /* BD producer */;
-	__le16 cqe_prod /* CQE producer */;
-	__le16 reserved;
-	__le16 reserved1 /* FW reserved. */;
-};
-
-/*
  * Aggregation end reason.
  */
 enum eth_tpa_end_reason {
@@ -487,15 +469,6 @@ struct mstorm_eth_queue_zone {
 };
 
 /*
- * Ustorm Queue Zone
- */
-struct ustorm_eth_queue_zone {
-	struct coalescing_timeset int_coalescing_timeset
-	    /* Rx interrupt coalescing TimeSet */;
-	__le16 reserved[3];
-};
-
-/*
  * Ystorm Queue Zone
  */
 struct ystorm_eth_queue_zone {
drivers/net/qede/base/reg_addr.h +36 -0
index 3b25e1a..ab88671 100644
@@ -6,6 +6,14 @@
  * See LICENSE.qede_pmd for copyright and licensing details.
  */
 
+/*
+ * Copyright (c) 2016 QLogic Corporation.
+ * All rights reserved.
+ * www.qlogic.com
+ *
+ * See LICENSE.qede_pmd for copyright and licensing details.
+ */
+
 #define  CDU_REG_CID_ADDR_PARAMS_CONTEXT_SIZE_SHIFT \
 	0
 
@@ -1105,3 +1113,31 @@
 #define CDU_REG_SEGMENT1_PARAMS_T1_TID_SIZE_SHIFT 24
 #define CDU_REG_SEGMENT1_PARAMS_T1_TID_BLOCK_WASTE_SHIFT 16
 #define DORQ_REG_DB_DROP_DETAILS_ADDRESS 0x100a1cUL
+
+/* 8.10.9.0 FW */
+#define NIG_REG_VXLAN_CTRL 0x50105cUL
+#define PRS_REG_SEARCH_ROCE 0x1f040cUL
+#define PRS_REG_CM_HDR_GFT 0x1f11c8UL
+#define PRS_REG_CM_HDR_GFT_EVENT_ID_SHIFT 0
+#define PRS_REG_CM_HDR_GFT_CM_HDR_SHIFT 8
+#define CCFC_REG_WEAK_ENABLE_VF 0x2e0704UL
+#define TCFC_REG_STRONG_ENABLE_VF 0x2d070cUL
+#define TCFC_REG_WEAK_ENABLE_VF 0x2d0704UL
+#define PRS_REG_SEARCH_GFT 0x1f11bcUL
+#define PRS_REG_LOAD_L2_FILTER 0x1f0198UL
+#define PRS_REG_GFT_CAM 0x1f1100UL
+#define PRS_REG_GFT_PROFILE_MASK_RAM 0x1f1000UL
+#define PGLUE_B_REG_MSDM_VF_SHIFT_B 0x2aa1c4UL
+#define PGLUE_B_REG_MSDM_OFFSET_MASK_B 0x2aa1c0UL
+#define PRS_REG_PKT_LEN_STAT_TAGS_NOT_COUNTED_FIRST 0x1f0a0cUL
+#define PRS_REG_SEARCH_FCOE 0x1f0408UL
+#define PGLUE_B_REG_PGL_ADDR_E8_F0 0x2aaf98UL
+#define NIG_REG_DSCP_TO_TC_MAP_ENABLE 0x5088f8UL
+#define PGLUE_B_REG_PGL_ADDR_EC_F0 0x2aaf9cUL
+#define PGLUE_B_REG_PGL_ADDR_F0_F0 0x2aafa0UL
+#define PRS_REG_ROCE_DEST_QP_MAX_PF 0x1f0430UL
+#define PGLUE_B_REG_PGL_ADDR_F4_F0 0x2aafa4UL
+#define IGU_REG_WRITE_DONE_PENDING 0x180900UL
+#define NIG_REG_LLH_TAGMAC_DEF_PF_VECTOR 0x50196cUL
+#define PRS_REG_MSG_INFO 0x1f0a1cUL
+#define BAR0_MAP_REG_XSDM_RAM 0x1e00000UL
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH v3 5/32 qede/base: fix the attention formating string

In reply to Rasesh Mody

In case of attention from a signal that's represented by multiple bits in misc AEU, the format string isn't populated with index and resulting prints show something akin to "<block> %d" as prefix.

---
 drivers/net/qede/base/bcm_osal.c  | 21 +++++++++++++++++++++
 drivers/net/qede/base/bcm_osal.h  |  6 ++++++
 drivers/net/qede/base/ecore_int.c | 35 +++++++++++++++++++++++++++++------
 3 files changed, 56 insertions(+), 6 deletions(-)
drivers/net/qede/base/bcm_osal.c +21 -0
index 67270fd..d53dfee 100644
@@ -65,6 +65,27 @@ inline bool qede_test_bit(u32 nr, unsigned long *addr)
 	return res;
 }
 
+static inline u32 qede_ffb(unsigned long word)
+{
+	unsigned long first_bit;
+
+	first_bit = __builtin_ffsl(word);
+	return first_bit ? (first_bit - 1) : OSAL_BITS_PER_UL;
+}
+
+inline u32 qede_find_first_bit(unsigned long *addr, u32 limit)
+{
+	u32 i;
+	u32 nwords = 0;
+	OSAL_BUILD_BUG_ON(!limit);
+	nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
+	for (i = 0; i < nwords; i++)
+		if (addr[i] != 0)
+			break;
+
+	return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffb(addr[i]);
+}
+
 static inline u32 qede_ffz(unsigned long word)
 {
 	unsigned long first_zero;
drivers/net/qede/base/bcm_osal.h +6 -0
index 3e2aeb0..a535058 100644
@@ -301,6 +301,10 @@ bool qede_test_bit(u32, unsigned long *);
 #define OSAL_TEST_BIT(bit, bitmap) \
 	qede_test_bit(bit, bitmap)
 
+u32 qede_find_first_bit(unsigned long *, u32);
+#define OSAL_FIND_FIRST_BIT(bitmap, length) \
+	qede_find_first_bit(bitmap, length)
+
 u32 qede_find_first_zero_bit(unsigned long *, u32);
 #define OSAL_FIND_FIRST_ZERO_BIT(bitmap, length) \
 	qede_find_first_zero_bit(bitmap, length)
@@ -377,6 +381,8 @@ u32 qede_osal_log2(u32);
 #define OSAL_ARRAY_SIZE(arr) RTE_DIM(arr)
 #define OSAL_SPRINTF(name, pattern, ...) \
 	sprintf(name, pattern, ##__VA_ARGS__)
+#define OSAL_SNPRINTF(buf, size, format, ...) \
+	snprintf(buf, size, format, ##__VA_ARGS__)
 #define OSAL_STRLEN(string) strlen(string)
 #define OSAL_STRCPY(dst, string) strcpy(dst, string)
 #define OSAL_STRNCPY(dst, string, len) strncpy(dst, string, len)
drivers/net/qede/base/ecore_int.c +29 -6
index e4c002a..04c4947 100644
@@ -783,7 +783,9 @@ static void ecore_int_deassertion_print_bit(struct ecore_hwfn *p_hwfn,
 static enum _ecore_status_t
 ecore_int_deassertion_aeu_bit(struct ecore_hwfn *p_hwfn,
 			      struct aeu_invert_reg_bit *p_aeu,
-			      u32 aeu_en_reg, u32 bitmask)
+			      u32 aeu_en_reg,
+			      const char *p_bit_name,
+			      u32 bitmask)
 {
 	enum _ecore_status_t rc = ECORE_INVAL;
 	u32 val, mask;
@@ -795,12 +797,12 @@ ecore_int_deassertion_aeu_bit(struct ecore_hwfn *p_hwfn,
 #endif
 
 	DP_INFO(p_hwfn, "Deasserted attention `%s'[%08x]\n",
-		p_aeu->bit_name, bitmask);
+		p_bit_name, bitmask);
 
 	/* Call callback before clearing the interrupt status */
 	if (p_aeu->cb) {
 		DP_INFO(p_hwfn, "`%s (attention)': Calling Callback function\n",
-			p_aeu->bit_name);
+			p_bit_name);
 		rc = p_aeu->cb(p_hwfn);
 	}
 
@@ -812,7 +814,7 @@ ecore_int_deassertion_aeu_bit(struct ecore_hwfn *p_hwfn,
 	/* Reach assertion if attention is fatal */
 	if (rc != ECORE_SUCCESS) {
 		DP_NOTICE(p_hwfn, true, "`%s': Fatal attention\n",
-			  p_aeu->bit_name);
+			  p_bit_name);
 
 		ecore_hw_err_notify(p_hwfn, ECORE_HW_ERR_HW_ATTN);
 	}
@@ -824,7 +826,7 @@ ecore_int_deassertion_aeu_bit(struct ecore_hwfn *p_hwfn,
 		val = ecore_rd(p_hwfn, p_hwfn->p_dpc_ptt, aeu_en_reg);
 		ecore_wr(p_hwfn, p_hwfn->p_dpc_ptt, aeu_en_reg, (val & mask));
 		DP_INFO(p_hwfn, "`%s' - Disabled future attentions\n",
-			p_aeu->bit_name);
+			p_bit_name);
 	}
 
 	if (p_aeu->flags & (ATTENTION_FW_DUMP | ATTENTION_PANIC_DUMP)) {
@@ -942,8 +944,8 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
 			 * previous assertion.
 			 */
 			for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
+				unsigned long bitmask;
 				u8 bit, bit_len;
-				u32 bitmask;
 
 				p_aeu = &sb_attn_sw->p_aeu_desc[i].bits[j];
 
@@ -961,10 +963,31 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
 
 				bitmask = bits & (((1 << bit_len) - 1) << bit);
 				if (bitmask) {
+					u32 flags = p_aeu->flags;
+					char bit_name[30];
+
+					bit = (u8)OSAL_FIND_FIRST_BIT(&bitmask,
+								bit_len);
+
+					/* Some bits represent more than a
+					 * a single interrupt. Correctly print
+					 * their name.
+					 */
+					if (ATTENTION_LENGTH(flags) > 2 ||
+					    ((flags & ATTENTION_PAR_INT) &&
+					    ATTENTION_LENGTH(flags) > 1))
+						OSAL_SNPRINTF(bit_name, 30,
+							      p_aeu->bit_name,
+							      bit);
+					else
+						OSAL_STRNCPY(bit_name,
+							     p_aeu->bit_name,
+							     30);
 					/* Handle source of the attention */
 					ecore_int_deassertion_aeu_bit(p_hwfn,
 								      p_aeu,
 								      aeu_en,
+								      bit_name,
 								      bitmask);
 				}
 
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH v3 6/32 qede/base: additional formatting/comment changes

In reply to Rasesh Mody

Change details:
- adds new comments
- modifies some of the existing comments
- abstract code into macros
- split long lines

---
 drivers/net/qede/base/ecore.h               |  3 +-
 drivers/net/qede/base/ecore_chain.h         | 14 ++---
 drivers/net/qede/base/ecore_cxt.c           | 52 +++++++++----------
 drivers/net/qede/base/ecore_cxt.h           |  3 +-
 drivers/net/qede/base/ecore_dcbx.c          |  6 ++-
 drivers/net/qede/base/ecore_dev.c           | 70 +++++++++++++------------
 drivers/net/qede/base/ecore_dev_api.h       | 33 ++++++++----
 drivers/net/qede/base/ecore_hsi_eth.h       |  8 +--
 drivers/net/qede/base/ecore_hw.c            |  2 +-
 drivers/net/qede/base/ecore_hw.h            | 31 +++++++----
 drivers/net/qede/base/ecore_hw_defs.h       | 22 ++++----
 drivers/net/qede/base/ecore_init_fw_funcs.c |  3 ++
 drivers/net/qede/base/ecore_init_fw_funcs.h | 80 +++++++++++++++++++----------
 drivers/net/qede/base/ecore_init_ops.h      |  8 ++-
 drivers/net/qede/base/ecore_int.c           |  9 ++--
 drivers/net/qede/base/ecore_iov_api.h       | 57 ++++++++++++++------
 drivers/net/qede/base/ecore_l2.c            | 25 +++++----
 drivers/net/qede/base/ecore_l2_api.h        |  9 ++--
 drivers/net/qede/base/ecore_mcp.c           |  3 +-
 drivers/net/qede/base/ecore_sp_commands.c   | 17 +++---
 drivers/net/qede/base/ecore_spq.c           | 12 ++---
 drivers/net/qede/base/ecore_spq.h           | 21 +++++---
 drivers/net/qede/base/eth_common.h          | 15 ++++--
 drivers/net/qede/base/nvm_cfg.h             | 17 ++++--
 24 files changed, 321 insertions(+), 199 deletions(-)
drivers/net/qede/base/ecore.h +2 -1
index b9127de..9f456e3 100644
@@ -94,7 +94,6 @@ static OSAL_INLINE u32 DB_ADDR(u32 cid, u32 DEMS)
 	return db_addr;
 }
 
-/* @DPDK: This is a backport from latest ecore for TSS fix */
 static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS)
 {
 	u32 db_addr = FIELD_VALUE(DB_LEGACY_ADDR_DEMS, DEMS) |
@@ -107,6 +106,7 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS)
 	((sizeof(type_name) + (u32)(1 << (p_hwfn->p_dev->cache_shift)) - 1) & \
 	 ~((1 << (p_hwfn->p_dev->cache_shift)) - 1))
 
+#ifndef LINUX_REMOVE
 #ifndef U64_HI
 #define U64_HI(val) ((u32)(((u64)(val))  >> 32))
 #endif
@@ -114,6 +114,7 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS)
 #ifndef U64_LO
 #define U64_LO(val) ((u32)(((u64)(val)) & 0xffffffff))
 #endif
+#endif
 
 #ifndef __EXTRACT__LINUX__
 enum DP_LEVEL {
drivers/net/qede/base/ecore_chain.h +8 -6
index bc18c41..56b7b4d 100644
@@ -307,21 +307,23 @@ ecore_chain_advance_page(struct ecore_chain *p_chain, void **p_next_elem,
 	(((p)->u.chain32.idx & (p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define is_unusable_next_idx(p, idx)		\
-	((((p)->u.chain16.idx + 1) & (p)->elem_per_page_mask) == \
-	(p)->usable_per_page)
+	((((p)->u.chain16.idx + 1) &		\
+	(p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define is_unusable_next_idx_u32(p, idx)	\
-	((((p)->u.chain32.idx + 1) & (p)->elem_per_page_mask) \
-	== (p)->usable_per_page)
+	((((p)->u.chain32.idx + 1) &		\
+	(p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define test_and_skip(p, idx)						\
 	do {								\
 		if (is_chain_u16(p)) {					\
 			if (is_unusable_idx(p, idx))			\
-				(p)->u.chain16.idx += (p)->elem_unusable; \
+				(p)->u.chain16.idx +=			\
+					(p)->elem_unusable;		\
 		} else {						\
 			if (is_unusable_idx_u32(p, idx))		\
-				(p)->u.chain32.idx += (p)->elem_unusable; \
+				(p)->u.chain32.idx +=			\
+					(p)->elem_unusable;		\
 		}							\
 	} while (0)
 
drivers/net/qede/base/ecore_cxt.c +25 -27

139 lines not on this page · raw message

drivers/net/qede/base/ecore_cxt.h +2 -1
index 1ac95f9..ba02410 100644
@@ -152,6 +152,7 @@ enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
 #define ECORE_CTX_FL_MEM 1
 enum _ecore_status_t ecore_cxt_get_task_ctx(struct ecore_hwfn *p_hwfn,
 					    u32 tid,
-					    u8 ctx_type, void **task_ctx);
+					    u8 ctx_type,
+					    void **task_ctx);
 
 #endif /* _ECORE_CID_ */
drivers/net/qede/base/ecore_dcbx.c +4 -2
index 18843c4..db73658 100644
@@ -348,14 +348,16 @@ ecore_dcbx_copy_mib(struct ecore_hwfn *p_hwfn,
 		read_count++;
 
 		DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
-			   "mib type = %d, try count = %d prefix seq num  = %d suffix seq num = %d\n",
+			   "mib type = %d, try count = %d prefix seq num  ="
+			   " %d suffix seq num = %d\n",
 			   type, read_count, prefix_seq_num, suffix_seq_num);
 	} while ((prefix_seq_num != suffix_seq_num) &&
 		 (read_count < ECORE_DCBX_MAX_MIB_READ_TRY));
 
 	if (read_count >= ECORE_DCBX_MAX_MIB_READ_TRY) {
 		DP_ERR(p_hwfn,
-		       "MIB read err, mib type = %d, try count = %d prefix seq num = %d suffix seq num = %d\n",
+		       "MIB read err, mib type = %d, try count ="
+		       " %d prefix seq num = %d suffix seq num = %d\n",
 		       type, read_count, prefix_seq_num, suffix_seq_num);
 		rc = ECORE_IO;
 	}
drivers/net/qede/base/ecore_dev.c +38 -32

223 lines not on this page · raw message

drivers/net/qede/base/ecore_dev_api.h +23 -10
index 1b78c32..77f4869 100644
@@ -24,7 +24,9 @@ struct ecore_tunn_start_params;
  * @param dp_ctx
  */
 void ecore_init_dp(struct ecore_dev *p_dev,
-		   u32 dp_module, u8 dp_level, void *dp_ctx);
+		   u32 dp_module,
+		   u8 dp_level,
+		   void *dp_ctx);
 
 /**
  * @brief ecore_init_struct - initialize the device structure to
@@ -172,7 +174,8 @@ struct ecore_ptt *ecore_ptt_acquire(struct ecore_hwfn *p_hwfn);
  * @param p_hwfn
  * @param p_ptt
  */
-void ecore_ptt_release(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
+void ecore_ptt_release(struct ecore_hwfn *p_hwfn,
+		       struct ecore_ptt *p_ptt);
 
 #ifndef __EXTRACT__LINUX__
 struct ecore_eth_stats {
@@ -290,7 +293,9 @@ enum _ecore_status_t
 ecore_dmae_host2grc(struct ecore_hwfn *p_hwfn,
 		    struct ecore_ptt *p_ptt,
 		    u64 source_addr,
-		    u32 grc_addr, u32 size_in_dwords, u32 flags);
+		    u32 grc_addr,
+		    u32 size_in_dwords,
+		    u32 flags);
 
 /**
  * @brief ecore_dmae_grc2host - Read data from dmae data offset
@@ -306,7 +311,9 @@ enum _ecore_status_t
 ecore_dmae_grc2host(struct ecore_hwfn *p_hwfn,
 		    struct ecore_ptt *p_ptt,
 		    u32 grc_addr,
-		    dma_addr_t dest_addr, u32 size_in_dwords, u32 flags);
+		    dma_addr_t dest_addr,
+		    u32 size_in_dwords,
+		    u32 flags);
 
 /**
  * @brief ecore_dmae_host2host - copy data from to source address
@@ -324,7 +331,8 @@ ecore_dmae_host2host(struct ecore_hwfn *p_hwfn,
 		     struct ecore_ptt *p_ptt,
 		     dma_addr_t source_addr,
 		     dma_addr_t dest_addr,
-		     u32 size_in_dwords, struct ecore_dmae_params *p_params);
+		     u32 size_in_dwords,
+		     struct ecore_dmae_params *p_params);
 
 /**
  * @brief ecore_chain_alloc - Allocate and initialize a chain
@@ -344,7 +352,8 @@ ecore_chain_alloc(struct ecore_dev *p_dev,
 		  enum ecore_chain_mode mode,
 		  enum ecore_chain_cnt_type cnt_type,
 		  u32 num_elems,
-		  osal_size_t elem_size, struct ecore_chain *p_chain);
+		  osal_size_t elem_size,
+		  struct ecore_chain *p_chain);
 
 /**
  * @brief ecore_chain_free - Free chain DMA memory
@@ -352,7 +361,8 @@ ecore_chain_alloc(struct ecore_dev *p_dev,
  * @param p_hwfn
  * @param p_chain
  */
-void ecore_chain_free(struct ecore_dev *p_dev, struct ecore_chain *p_chain);
+void ecore_chain_free(struct ecore_dev *p_dev,
+		      struct ecore_chain *p_chain);
 
 /**
  * @@brief ecore_fw_l2_queue - Get absolute L2 queue ID
@@ -364,7 +374,8 @@ void ecore_chain_free(struct ecore_dev *p_dev, struct ecore_chain *p_chain);
  *  @return enum _ecore_status_t
  */
 enum _ecore_status_t ecore_fw_l2_queue(struct ecore_hwfn *p_hwfn,
-				       u16 src_id, u16 *dst_id);
+				       u16 src_id,
+				       u16 *dst_id);
 
 /**
  * @@brief ecore_fw_vport - Get absolute vport ID
@@ -376,7 +387,8 @@ enum _ecore_status_t ecore_fw_l2_queue(struct ecore_hwfn *p_hwfn,
  *  @return enum _ecore_status_t
  */
 enum _ecore_status_t ecore_fw_vport(struct ecore_hwfn *p_hwfn,
-				    u8 src_id, u8 *dst_id);
+				    u8 src_id,
+				    u8 *dst_id);
 
 /**
  * @@brief ecore_fw_rss_eng - Get absolute RSS engine ID
@@ -388,7 +400,8 @@ enum _ecore_status_t ecore_fw_vport(struct ecore_hwfn *p_hwfn,
  *  @return enum _ecore_status_t
  */
 enum _ecore_status_t ecore_fw_rss_eng(struct ecore_hwfn *p_hwfn,
-				      u8 src_id, u8 *dst_id);
+				      u8 src_id,
+				      u8 *dst_id);
 
 /**
  * @brief ecore_llh_add_mac_filter - configures a MAC filter in llh
drivers/net/qede/base/ecore_hsi_eth.h +4 -4
index 78cc55d..dd94d31 100644
@@ -872,7 +872,7 @@ struct eth_vport_tpa_param {
 	u8 tpa_ipv6_tunn_en_flg /* Enable TPA for IPv6 over tunnel */;
 	u8 tpa_pkt_split_flg;
 	u8 tpa_hdr_data_split_flg
-/* If set, put header of first TPA segment on bd and data on SGE */
+	    /* If set, put header of first TPA segment on bd and data on SGE */
 	   ;
 	u8 tpa_gro_consistent_flg
 	    /* If set, GRO data consistent will checked for TPA continue */;
@@ -882,10 +882,10 @@ struct eth_vport_tpa_param {
 	__le16 tpa_min_size_to_start
 	    /* minimum TCP payload size for a packet to start aggregation */;
 	__le16 tpa_min_size_to_cont
-/* minimum TCP payload size for a packet to continue aggregation */
+	    /* minimum TCP payload size for a packet to continue aggregation */
 	   ;
 	u8 max_buff_num
-/* maximal number of buffers that can be used for one aggregation */
+	    /* maximal number of buffers that can be used for one aggregation */
 	   ;
 	u8 reserved;
 };
@@ -998,7 +998,7 @@ struct rx_queue_start_ramrod_data {
 };
 
 /*
- * Ramrod data for rx queue start ramrod
+ * Ramrod data for rx queue stop ramrod
  */
 struct rx_queue_stop_ramrod_data {
 	__le16 rx_queue_id /* ID of RX queue */;
drivers/net/qede/base/ecore_hw.c +1 -1
index 72bc6de..04ec1ea 100644
@@ -580,8 +580,8 @@ void ecore_dmae_info_free(struct ecore_hwfn *p_hwfn)
 
 static enum _ecore_status_t ecore_dmae_operation_wait(struct ecore_hwfn *p_hwfn)
 {
-	enum _ecore_status_t ecore_status = ECORE_SUCCESS;
 	u32 wait_cnt_limit = 10000, wait_cnt = 0;
+	enum _ecore_status_t ecore_status = ECORE_SUCCESS;
 
 #ifndef ASIC_ONLY
 	u32 factor = (CHIP_REV_IS_EMUL(p_hwfn->p_dev) ?
drivers/net/qede/base/ecore_hw.h +22 -9
index 9603c99..154eb3c 100644
@@ -105,7 +105,8 @@ void ecore_ptt_pool_free(struct ecore_hwfn *p_hwfn);
  *
  * @return u32
  */
-u32 ecore_ptt_get_hw_addr(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
+u32 ecore_ptt_get_hw_addr(struct ecore_hwfn	*p_hwfn,
+			  struct ecore_ptt	*p_ptt);
 
 /**
  * @brief ecore_ptt_get_bar_addr - Get PPT's external BAR address
@@ -125,7 +126,8 @@ u32 ecore_ptt_get_bar_addr(struct ecore_ptt	*p_ptt);
  * @param p_ptt
  */
 void ecore_ptt_set_win(struct ecore_hwfn	*p_hwfn,
-		       struct ecore_ptt *p_ptt, u32 new_hw_addr);
+		       struct ecore_ptt		*p_ptt,
+		       u32			new_hw_addr);
 
 /**
  * @brief ecore_get_reserved_ptt - Get a specific reserved PTT
@@ -147,7 +149,9 @@ struct ecore_ptt *ecore_get_reserved_ptt(struct ecore_hwfn	*p_hwfn,
  * @param hw_addr
  */
 void ecore_wr(struct ecore_hwfn	*p_hwfn,
-	      struct ecore_ptt *p_ptt, u32 hw_addr, u32 val);
+	      struct ecore_ptt	*p_ptt,
+	      u32		hw_addr,
+	      u32		val);
 
 /**
  * @brief ecore_rd - Read value from BAR using the given ptt
@@ -157,7 +161,9 @@ void ecore_wr(struct ecore_hwfn	*p_hwfn,
  * @param val
  * @param hw_addr
  */
-u32 ecore_rd(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 hw_addr);
+u32 ecore_rd(struct ecore_hwfn	*p_hwfn,
+	     struct ecore_ptt	*p_ptt,
+	     u32		hw_addr);
 
 /**
  * @brief ecore_memcpy_from - copy n bytes from BAR using the given
@@ -171,7 +177,9 @@ u32 ecore_rd(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 hw_addr);
  */
 void ecore_memcpy_from(struct ecore_hwfn	*p_hwfn,
 		       struct ecore_ptt		*p_ptt,
-		       void *dest, u32 hw_addr, osal_size_t n);
+		       void			*dest,
+		       u32			hw_addr,
+		       osal_size_t		n);
 
 /**
  * @brief ecore_memcpy_to - copy n bytes to BAR using the given
@@ -185,7 +193,9 @@ void ecore_memcpy_from(struct ecore_hwfn	*p_hwfn,
  */
 void ecore_memcpy_to(struct ecore_hwfn	*p_hwfn,
 		     struct ecore_ptt	*p_ptt,
-		     u32 hw_addr, void *src, osal_size_t n);
+		     u32		hw_addr,
+		     void		*src,
+		     osal_size_t	n);
 /**
  * @brief ecore_fid_pretend - pretend to another function when
  *        accessing the ptt window. There is no way to unpretend
@@ -198,7 +208,8 @@ void ecore_memcpy_to(struct ecore_hwfn	*p_hwfn,
  *            either pf / vf, port/path fields are don't care.
  */
 void ecore_fid_pretend(struct ecore_hwfn	*p_hwfn,
-		       struct ecore_ptt *p_ptt, u16 fid);
+		       struct ecore_ptt		*p_ptt,
+		       u16			fid);
 
 /**
  * @brief ecore_port_pretend - pretend to another port when
@@ -209,7 +220,8 @@ void ecore_fid_pretend(struct ecore_hwfn	*p_hwfn,
  * @param port_id - the port to pretend to
  */
 void ecore_port_pretend(struct ecore_hwfn	*p_hwfn,
-			struct ecore_ptt *p_ptt, u8 port_id);
+			struct ecore_ptt	*p_ptt,
+			u8			port_id);
 
 /**
  * @brief ecore_port_unpretend - cancel any previously set port
@@ -218,7 +230,8 @@ void ecore_port_pretend(struct ecore_hwfn	*p_hwfn,
  * @param p_hwfn
  * @param p_ptt
  */
-void ecore_port_unpretend(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt);
+void ecore_port_unpretend(struct ecore_hwfn	*p_hwfn,
+			  struct ecore_ptt	*p_ptt);
 
 /**
  * @brief ecore_vfid_to_concrete - build a concrete FID for a
drivers/net/qede/base/ecore_hw_defs.h +11 -11
index 19816ff..deb8e34 100644
@@ -10,19 +10,19 @@
 #define _ECORE_IGU_DEF_H_
 
 /* Fields of IGU PF CONFIGRATION REGISTER */
-#define IGU_PF_CONF_FUNC_EN       (0x1 << 0)	/* function enable        */
-#define IGU_PF_CONF_MSI_MSIX_EN   (0x1 << 1)	/* MSI/MSIX enable        */
-#define IGU_PF_CONF_INT_LINE_EN   (0x1 << 2)	/* INT enable             */
-#define IGU_PF_CONF_ATTN_BIT_EN   (0x1 << 3)	/* attention enable       */
-#define IGU_PF_CONF_SINGLE_ISR_EN (0x1 << 4)	/* single ISR mode enable */
-#define IGU_PF_CONF_SIMD_MODE     (0x1 << 5)	/* simd all ones mode     */
+#define IGU_PF_CONF_FUNC_EN       (0x1 << 0)   /* function enable        */
+#define IGU_PF_CONF_MSI_MSIX_EN   (0x1 << 1)   /* MSI/MSIX enable        */
+#define IGU_PF_CONF_INT_LINE_EN   (0x1 << 2)   /* INT enable             */
+#define IGU_PF_CONF_ATTN_BIT_EN   (0x1 << 3)   /* attention enable       */
+#define IGU_PF_CONF_SINGLE_ISR_EN (0x1 << 4)   /* single ISR mode enable */
+#define IGU_PF_CONF_SIMD_MODE     (0x1 << 5)   /* simd all ones mode     */
 
 /* Fields of IGU VF CONFIGRATION REGISTER */
-#define IGU_VF_CONF_FUNC_EN        (0x1 << 0)	/* function enable        */
-#define IGU_VF_CONF_MSI_MSIX_EN    (0x1 << 1)	/* MSI/MSIX enable        */
-#define IGU_VF_CONF_SINGLE_ISR_EN  (0x1 << 4)	/* single ISR mode enable */
-#define IGU_VF_CONF_PARENT_MASK    (0xF)	/* Parent PF              */
-#define IGU_VF_CONF_PARENT_SHIFT   5	/* Parent PF              */
+#define IGU_VF_CONF_FUNC_EN        (0x1 << 0)  /* function enable        */
+#define IGU_VF_CONF_MSI_MSIX_EN    (0x1 << 1)  /* MSI/MSIX enable        */
+#define IGU_VF_CONF_SINGLE_ISR_EN  (0x1 << 4)  /* single ISR mode enable */
+#define IGU_VF_CONF_PARENT_MASK    (0xF)       /* Parent PF              */
+#define IGU_VF_CONF_PARENT_SHIFT   5   /* Parent PF              */
 
 /* Igu control commands
  */
drivers/net/qede/base/ecore_init_fw_funcs.c +3 -0
index 0844194..bffc73c 100644
@@ -1099,6 +1099,8 @@ void ecore_init_brb_ram(struct ecore_hwfn *p_hwfn,
 			ecore_wr(p_hwfn, p_ptt,
 				 BRB_REG_MAIN_TC_GUARANTIED_HYST_0 + reg_offset,
 				 BRB_HYST_BLOCKS);
+/* init pause/full thresholds per physical TC - for loopback traffic */
+
 			ecore_wr(p_hwfn, p_ptt,
 				 BRB_REG_LB_TC_FULL_XOFF_THRESHOLD_0 +
 				 reg_offset, full_xoff_th);
@@ -1111,6 +1113,7 @@ void ecore_init_brb_ram(struct ecore_hwfn *p_hwfn,
 			ecore_wr(p_hwfn, p_ptt,
 				 BRB_REG_LB_TC_PAUSE_XON_THRESHOLD_0 +
 				 reg_offset, pause_xon_th);
+/* init pause/full thresholds per physical TC - for main traffic */
 			ecore_wr(p_hwfn, p_ptt,
 				 BRB_REG_MAIN_TC_FULL_XOFF_THRESHOLD_0 +
 				 reg_offset, full_xoff_th);
drivers/net/qede/base/ecore_init_fw_funcs.h +54 -26

187 lines not on this page · raw message

drivers/net/qede/base/ecore_init_ops.h +6 -2
index 8a6fce4..f6b0a2d 100644
@@ -68,7 +68,9 @@ void ecore_init_clear_rt_data(struct ecore_hwfn *p_hwfn);
  * @param rt_offset
  * @param val
  */
-void ecore_init_store_rt_reg(struct ecore_hwfn *p_hwfn, u32 rt_offset, u32 val);
+void ecore_init_store_rt_reg(struct ecore_hwfn *p_hwfn,
+			     u32               rt_offset,
+			     u32               val);
 
 #define STORE_RT_REG(hwfn, offset, val)				\
 	ecore_init_store_rt_reg(hwfn, offset, val)
@@ -87,7 +89,9 @@ void ecore_init_store_rt_reg(struct ecore_hwfn *p_hwfn, u32 rt_offset, u32 val);
 */
 
 void ecore_init_store_rt_agg(struct ecore_hwfn *p_hwfn,
-			     u32 rt_offset, u32 *val, osal_size_t size);
+			     u32               rt_offset,
+			     u32               *val,
+			     osal_size_t       size);
 
 #define STORE_RT_REG_AGG(hwfn, offset, val)			\
 	ecore_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
drivers/net/qede/base/ecore_int.c +6 -3
index 04c4947..4d5543a 100644
@@ -944,7 +944,7 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
 			 * previous assertion.
 			 */
 			for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
-				unsigned long bitmask;
+				unsigned long int bitmask;
 				u8 bit, bit_len;
 
 				p_aeu = &sb_attn_sw->p_aeu_desc[i].bits[j];
@@ -1021,8 +1021,8 @@ static enum _ecore_status_t ecore_int_attentions(struct ecore_hwfn *p_hwfn)
 	struct ecore_sb_attn_info *p_sb_attn_sw = p_hwfn->p_sb_attn;
 	struct atten_status_block *p_sb_attn = p_sb_attn_sw->sb_attn;
 	u16 index = 0, asserted_bits, deasserted_bits;
-	enum _ecore_status_t rc = ECORE_SUCCESS;
 	u32 attn_bits = 0, attn_acks = 0;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	/* Read current attention bits/acks - safeguard against attentions
 	 * by guaranting work on a synchronized timeframe
@@ -1162,6 +1162,7 @@ void ecore_int_sp_dpc(osal_int_ptr_t hwfn_cookie)
 	}
 
 /* Check the validity of the DPC ptt. If not ack interrupts and fail */
+
 	if (!p_hwfn->p_dpc_ptt) {
 		DP_NOTICE(p_hwfn->p_dev, true, "Failed to allocate PTT\n");
 		ecore_sb_ack(sb_info, IGU_INT_ENABLE, 1);
@@ -1582,7 +1583,7 @@ static enum _ecore_status_t ecore_int_sp_sb_alloc(struct ecore_hwfn *p_hwfn,
 	p_virt = OSAL_DMA_ALLOC_COHERENT(p_hwfn->p_dev,
 					 &p_phys, SB_ALIGNED_SIZE(p_hwfn));
 	if (!p_virt) {
-		DP_NOTICE(p_hwfn, true, "Failed to allocate status block");
+		DP_NOTICE(p_hwfn, true, "Failed to allocate status block\n");
 		OSAL_FREE(p_hwfn->p_dev, p_sb);
 		return ECORE_NOMEM;
 	}
@@ -1691,6 +1692,7 @@ static void ecore_int_igu_enable_attn(struct ecore_hwfn *p_hwfn,
 	ecore_wr(p_hwfn, p_ptt, IGU_REG_TRAILING_EDGE_LATCH, 0xfff);
 	ecore_wr(p_hwfn, p_ptt, IGU_REG_ATTENTION_ENABLE, 0xfff);
 
+	/* Flush the writes to IGU */
 	OSAL_MMIOWB(p_hwfn->p_dev);
 
 	/* Unmask AEU signals toward IGU */
@@ -1782,6 +1784,7 @@ void ecore_int_igu_cleanup_sb(struct ecore_hwfn *p_hwfn,
 
 	ecore_wr(p_hwfn, p_ptt, IGU_REG_COMMAND_REG_CTRL, cmd_ctrl);
 
+	/* Flush the write to IGU */
 	OSAL_MMIOWB(p_hwfn->p_dev);
 
 	/* calculate where to read the status bit from */
drivers/net/qede/base/ecore_iov_api.h +40 -17

153 lines not on this page · raw message

drivers/net/qede/base/ecore_l2.c +14 -11
index b31523b..bc6b59d 100644
@@ -35,9 +35,9 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
 {
 	struct vport_start_ramrod_data *p_ramrod = OSAL_NULL;
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
 	u8 abs_vport_id = 0;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	u16 rx_mode = 0;
 
 	rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
@@ -449,8 +449,8 @@ enum _ecore_status_t ecore_sp_vport_stop(struct ecore_hwfn *p_hwfn,
 	struct vport_stop_ramrod_data *p_ramrod;
 	struct ecore_sp_init_data init_data;
 	struct ecore_spq_entry *p_ent;
-	enum _ecore_status_t rc;
 	u8 abs_vport_id = 0;
+	enum _ecore_status_t rc;
 
 	if (IS_VF(p_hwfn->p_dev))
 		return ecore_vf_pf_vport_stop(p_hwfn);
@@ -703,10 +703,10 @@ ecore_sp_eth_rx_queues_update(struct ecore_hwfn *p_hwfn,
 {
 	struct rx_queue_update_ramrod_data *p_ramrod = OSAL_NULL;
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
 	struct ecore_hw_cid_data *p_rx_cid;
 	u16 qid, abs_rx_q_id = 0;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	u8 i;
 
 	if (IS_VF(p_hwfn->p_dev))
@@ -758,9 +758,9 @@ ecore_sp_eth_rx_queue_stop(struct ecore_hwfn *p_hwfn,
 	struct ecore_hw_cid_data *p_rx_cid = &p_hwfn->p_rx_cids[rx_queue_id];
 	struct rx_queue_stop_ramrod_data *p_ramrod = OSAL_NULL;
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
 	u16 abs_rx_q_id = 0;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	if (IS_VF(p_hwfn->p_dev))
 		return ecore_vf_pf_rxq_stop(p_hwfn, rx_queue_id,
@@ -816,15 +816,16 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
 			      u16 pbl_size,
 			      union ecore_qm_pq_params *p_pq_params)
 {
-	struct ecore_hw_cid_data *p_tx_cid = &p_hwfn->p_tx_cids[tx_queue_id];
 	struct tx_queue_start_ramrod_data *p_ramrod = OSAL_NULL;
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
+	struct ecore_hw_cid_data *p_tx_cid;
 	u16 pq_id, abs_tx_q_id = 0;
 	u8 abs_vport_id;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Store information for the stop */
+	p_tx_cid = &p_hwfn->p_tx_cids[tx_queue_id];
 	p_tx_cid->cid = cid;
 	p_tx_cid->opaque_fid = opaque_fid;
 
@@ -908,7 +909,8 @@ enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
 		   "opaque_fid=0x%x, cid=0x%x, tx_qid=0x%x, vport_id=0x%x, sb_id=0x%x\n",
-		   opaque_fid, p_tx_cid->cid, tx_queue_id, vport_id, sb);
+		    opaque_fid, p_tx_cid->cid, tx_queue_id,
+		    vport_id, sb);
 
 	/* TODO - set tc in the pq_params for multi-cos */
 	rc = ecore_sp_eth_txq_start_ramrod(p_hwfn,
@@ -919,7 +921,9 @@ enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
 					   abs_stats_id,
 					   sb,
 					   sb_index,
-					   pbl_addr, pbl_size, &pq_params);
+					   pbl_addr,
+					   pbl_size,
+					   &pq_params);
 
 	*pp_doorbell = (u8 OSAL_IOMEM *)p_hwfn->doorbells +
 	    DB_ADDR(p_tx_cid->cid, DQ_DEMS_LEGACY);
@@ -1011,8 +1015,8 @@ ecore_filter_ucast_common(struct ecore_hwfn *p_hwfn,
 			  enum spq_mode comp_mode,
 			  struct ecore_spq_comp_cb *p_comp_data)
 {
-	struct vport_filter_update_ramrod_data *p_ramrod;
 	u8 vport_to_add_to = 0, vport_to_remove_from = 0;
+	struct vport_filter_update_ramrod_data *p_ramrod;
 	struct eth_filter_cmd *p_first_filter;
 	struct eth_filter_cmd *p_second_filter;
 	struct ecore_sp_init_data init_data;
@@ -1304,11 +1308,10 @@ ecore_sp_eth_filter_mcast(struct ecore_hwfn *p_hwfn,
 		    0, sizeof(p_ramrod->approx_mcast.bins));
 	OSAL_MEMSET(bins, 0, sizeof(unsigned long) *
 		    ETH_MULTICAST_MAC_BINS_IN_REGS);
-
-	if (p_filter_cmd->opcode == ECORE_FILTER_ADD) {
 	/* filter ADD op is explicit set op and it removes
 	*  any existing filters for the vport.
 	*/
+	if (p_filter_cmd->opcode == ECORE_FILTER_ADD) {
 		for (i = 0; i < p_filter_cmd->num_mc_addrs; i++) {
 			u32 bit;
 
drivers/net/qede/base/ecore_l2_api.h +6 -3
index ab9aca0..65a508c 100644
@@ -137,7 +137,8 @@ ecore_filter_mcast_cmd(struct ecore_dev *p_dev,
 
 /* Set "accept" filters */
 enum _ecore_status_t
-ecore_filter_accept_cmd(struct ecore_dev *p_dev,
+ecore_filter_accept_cmd(
+	struct ecore_dev		 *p_dev,
 	u8				 vport,
 	struct ecore_filter_accept_flags accept_flags,
 	u8				 update_accept_any_vlan,
@@ -204,7 +205,8 @@ enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
 enum _ecore_status_t
 ecore_sp_eth_rx_queue_stop(struct ecore_hwfn *p_hwfn,
 			   u16 rx_queue_id,
-			   bool eq_completion_only, bool cqe_completion);
+			   bool eq_completion_only,
+			   bool cqe_completion);
 
 /**
  * @brief ecore_sp_eth_tx_queue_start - TX Queue Start Ramrod
@@ -351,7 +353,8 @@ ecore_sp_vport_update(struct ecore_hwfn *p_hwfn,
  * @return enum _ecore_status_t
  */
 enum _ecore_status_t ecore_sp_vport_stop(struct ecore_hwfn *p_hwfn,
-					 u16 opaque_fid, u8 vport_id);
+					 u16 opaque_fid,
+					 u8 vport_id);
 
 enum _ecore_status_t
 ecore_sp_eth_filter_ucast(struct ecore_hwfn *p_hwfn,
drivers/net/qede/base/ecore_mcp.c +2 -1
index 2823113..b29e630 100644
@@ -135,7 +135,8 @@ static enum _ecore_status_t ecore_load_mcp_offsets(struct ecore_hwfn *p_hwfn,
 						       PUBLIC_DRV_MB));
 	p_info->drv_mb_addr = SECTION_ADDR(drv_mb_offsize, mcp_pf_id);
 	DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
-		   "drv_mb_offsiz = 0x%x, drv_mb_addr = 0x%x mcp_pf_id = 0x%x\n",
+		   "drv_mb_offsiz = 0x%x, drv_mb_addr = 0x%x"
+		   " mcp_pf_id = 0x%x\n",
 		   drv_mb_offsize, p_info->drv_mb_addr, mcp_pf_id);
 
 	/* Set the MFW MB address */
drivers/net/qede/base/ecore_sp_commands.c +8 -9
index 7ba43e8..478c825 100644
@@ -323,11 +323,11 @@ enum _ecore_status_t ecore_sp_pf_start(struct ecore_hwfn *p_hwfn,
 				       bool allow_npar_tx_switch)
 {
 	struct pf_start_ramrod_data *p_ramrod = OSAL_NULL;
-	struct ecore_spq_entry *p_ent = OSAL_NULL;
 	u16 sb = ecore_int_get_sp_sb_id(p_hwfn);
 	u8 sb_index = p_hwfn->p_eq->eq_sb_index;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
+	struct ecore_spq_entry *p_ent = OSAL_NULL;
 	struct ecore_sp_init_data init_data;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	u8 page_cnt;
 
 	/* update initial eq producer */
@@ -416,8 +416,8 @@ enum _ecore_status_t ecore_sp_pf_start(struct ecore_hwfn *p_hwfn,
 enum _ecore_status_t ecore_sp_pf_update(struct ecore_hwfn *p_hwfn)
 {
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Get SPQ entry */
 	OSAL_MEMSET(&init_data, 0, sizeof(init_data));
@@ -445,8 +445,8 @@ ecore_sp_pf_update_tunn_cfg(struct ecore_hwfn *p_hwfn,
 			    struct ecore_spq_comp_cb *p_comp_data)
 {
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Get SPQ entry */
 	OSAL_MEMSET(&init_data, 0, sizeof(init_data));
@@ -473,20 +473,19 @@ ecore_sp_pf_update_tunn_cfg(struct ecore_hwfn *p_hwfn,
 	if (p_tunn->update_geneve_udp_port)
 		ecore_set_geneve_dest_port(p_hwfn, p_hwfn->p_main_ptt,
 					   p_tunn->geneve_udp_port);
+	}
 
-		ecore_set_hw_tunn_mode(p_hwfn, p_hwfn->p_main_ptt,
-				       p_tunn->tunn_mode);
+	ecore_set_hw_tunn_mode(p_hwfn, p_hwfn->p_main_ptt, p_tunn->tunn_mode);
 	p_hwfn->p_dev->tunn_mode = p_tunn->tunn_mode;
-	}
 
 	return rc;
 }
 
 enum _ecore_status_t ecore_sp_pf_stop(struct ecore_hwfn *p_hwfn)
 {
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
 	struct ecore_sp_init_data init_data;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Get SPQ entry */
 	OSAL_MEMSET(&init_data, 0, sizeof(init_data));
@@ -506,8 +505,8 @@ enum _ecore_status_t ecore_sp_pf_stop(struct ecore_hwfn *p_hwfn)
 enum _ecore_status_t ecore_sp_heartbeat_ramrod(struct ecore_hwfn *p_hwfn)
 {
 	struct ecore_spq_entry *p_ent = OSAL_NULL;
-	enum _ecore_status_t rc = ECORE_NOTIMPL;
 	struct ecore_sp_init_data init_data;
+	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Get SPQ entry */
 	OSAL_MEMSET(&init_data, 0, sizeof(init_data));
drivers/net/qede/base/ecore_spq.c +6 -6
index 1839659..edff2d7 100644
@@ -157,7 +157,7 @@ static void ecore_spq_hw_initialize(struct ecore_hwfn *p_hwfn,
 	rc = ecore_cxt_get_cid_info(p_hwfn, &cxt_info);
 
 	if (rc < 0) {
-		DP_NOTICE(p_hwfn, true, "Cannot find context info for cid=%d",
+		DP_NOTICE(p_hwfn, true, "Cannot find context info for cid=%d\n",
 			  p_spq->cid);
 		return;
 	}
@@ -352,7 +352,7 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem)
 			      ECORE_CHAIN_CNT_TYPE_U16,
 			      num_elem,
 			      sizeof(union event_ring_element), &p_eq->chain)) {
-		DP_NOTICE(p_hwfn, true, "Failed to allocate eq chain");
+		DP_NOTICE(p_hwfn, true, "Failed to allocate eq chain\n");
 		goto eq_allocate_fail;
 	}
 
@@ -419,8 +419,8 @@ enum _ecore_status_t ecore_eth_cqe_completion(struct ecore_hwfn *p_hwfn,
  ***************************************************************************/
 void ecore_spq_setup(struct ecore_hwfn *p_hwfn)
 {
-	struct ecore_spq_entry *p_virt = OSAL_NULL;
 	struct ecore_spq *p_spq = p_hwfn->p_spq;
+	struct ecore_spq_entry *p_virt = OSAL_NULL;
 	dma_addr_t p_phys = 0;
 	u32 i, capacity;
 
@@ -475,7 +475,7 @@ enum _ecore_status_t ecore_spq_alloc(struct ecore_hwfn *p_hwfn)
 	    OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL, sizeof(struct ecore_spq));
 	if (!p_spq) {
 		DP_NOTICE(p_hwfn, true,
-			  "Failed to allocate `struct ecore_spq'");
+			  "Failed to allocate `struct ecore_spq'\n");
 		return ECORE_NOMEM;
 	}
 
@@ -484,7 +484,7 @@ enum _ecore_status_t ecore_spq_alloc(struct ecore_hwfn *p_hwfn)
 			ECORE_CHAIN_MODE_SINGLE, ECORE_CHAIN_CNT_TYPE_U16, 0,
 			/* N/A when the mode is SINGLE */
 			sizeof(struct slow_path_element), &p_spq->chain)) {
-		DP_NOTICE(p_hwfn, true, "Failed to allocate spq chain");
+		DP_NOTICE(p_hwfn, true, "Failed to allocate spq chain\n");
 		goto spq_allocate_fail;
 	}
 
@@ -745,7 +745,7 @@ enum _ecore_status_t ecore_spq_post(struct ecore_hwfn *p_hwfn,
 	if (p_hwfn->p_dev->recov_in_prog) {
 		DP_VERBOSE(p_hwfn, ECORE_MSG_SPQ,
 			   "Recovery is in progress -> skip spq post"
-			   " [cmd %02x protocol %02x]",
+			   " [cmd %02x protocol %02x]\n",
 			   p_ent->elem.hdr.cmd_id, p_ent->elem.hdr.protocol_id);
 		/* Return success to let the flows to be completed successfully
 		 * w/o any error handling.
drivers/net/qede/base/ecore_spq.h +14 -7
index 74484ab..490b7d9 100644
@@ -175,7 +175,8 @@ void ecore_spq_free(struct ecore_hwfn *p_hwfn);
  * @return enum _ecore_status_t
  */
 enum _ecore_status_t
-ecore_spq_get_entry(struct ecore_hwfn *p_hwfn, struct ecore_spq_entry **pp_ent);
+ecore_spq_get_entry(struct ecore_hwfn		*p_hwfn,
+		    struct ecore_spq_entry	**pp_ent);
 
 /**
  * @brief ecore_spq_return_entry - Return an entry to spq free
@@ -194,7 +195,8 @@ void ecore_spq_return_entry(struct ecore_hwfn		*p_hwfn,
  *
  * @return struct ecore_eq* - a newly allocated structure; NULL upon error.
  */
-struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem);
+struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn	*p_hwfn,
+				 u16			num_elem);
 
 /**
  * @brief ecore_eq_setup - Reset the SPQ to its start state.
@@ -202,7 +204,8 @@ struct ecore_eq *ecore_eq_alloc(struct ecore_hwfn *p_hwfn, u16 num_elem);
  * @param p_hwfn
  * @param p_eq
  */
-void ecore_eq_setup(struct ecore_hwfn *p_hwfn, struct ecore_eq *p_eq);
+void ecore_eq_setup(struct ecore_hwfn *p_hwfn,
+		    struct ecore_eq   *p_eq);
 
 /**
  * @brief ecore_eq_deallocate - deallocates the given EQ struct.
@@ -210,7 +213,8 @@ void ecore_eq_setup(struct ecore_hwfn *p_hwfn, struct ecore_eq *p_eq);
  * @param p_hwfn
  * @param p_eq
  */
-void ecore_eq_free(struct ecore_hwfn *p_hwfn, struct ecore_eq *p_eq);
+void ecore_eq_free(struct ecore_hwfn *p_hwfn,
+		   struct ecore_eq   *p_eq);
 
 /**
  * @brief ecore_eq_prod_update - update the FW with default EQ producer
@@ -218,7 +222,8 @@ void ecore_eq_free(struct ecore_hwfn *p_hwfn, struct ecore_eq *p_eq);
  * @param p_hwfn
  * @param prod
  */
-void ecore_eq_prod_update(struct ecore_hwfn *p_hwfn, u16 prod);
+void ecore_eq_prod_update(struct ecore_hwfn	*p_hwfn,
+			  u16			prod);
 
 /**
  * @brief ecore_eq_completion - Completes currently pending EQ elements
@@ -271,7 +276,8 @@ struct ecore_consq *ecore_consq_alloc(struct ecore_hwfn	*p_hwfn);
  * @param p_hwfn
  * @param p_eq
  */
-void ecore_consq_setup(struct ecore_hwfn *p_hwfn, struct ecore_consq *p_consq);
+void ecore_consq_setup(struct ecore_hwfn *p_hwfn,
+		    struct ecore_consq   *p_consq);
 
 /**
  * @brief ecore_consq_free - deallocates the given ConsQ struct.
@@ -279,6 +285,7 @@ void ecore_consq_setup(struct ecore_hwfn *p_hwfn, struct ecore_consq *p_consq);
  * @param p_hwfn
  * @param p_eq
  */
-void ecore_consq_free(struct ecore_hwfn *p_hwfn, struct ecore_consq *p_consq);
+void ecore_consq_free(struct ecore_hwfn *p_hwfn,
+		   struct ecore_consq   *p_consq);
 
 #endif /* __ECORE_SPQ_H__ */
drivers/net/qede/base/eth_common.h +10 -5
index bd73f7d..cc310e3 100644
@@ -41,14 +41,18 @@
 #define ETH_NUM_VLAN_FILTERS                512
 
 /* approx. multicast constants */
+/* CRC seed for multicast bin calculation */
 #define ETH_MULTICAST_BIN_FROM_MAC_SEED     0
 #define ETH_MULTICAST_MAC_BINS              256
 #define ETH_MULTICAST_MAC_BINS_IN_REGS      (ETH_MULTICAST_MAC_BINS / 32)
 
 /*  ethernet vport update constants */
 #define ETH_FILTER_RULES_COUNT              10
+/* number of RSS indirection table entries, per Vport) */
 #define ETH_RSS_IND_TABLE_ENTRIES_NUM       128
+/* Length of RSS key (in regs) */
 #define ETH_RSS_KEY_SIZE_REGS               10
+/* number of available RSS engines in K2 */
 #define ETH_RSS_ENGINE_NUM_K2               207
 #define ETH_RSS_ENGINE_NUM_BB               127
 
@@ -156,10 +160,10 @@ struct eth_tx_data_2nd_bd {
  * Firmware data for L2-EDPM packet.
  */
 struct eth_edpm_fw_data {
-	struct eth_tx_data_1st_bd data_1st_bd
-	    /* Parsing information data from the 1st BD. */;
-	struct eth_tx_data_2nd_bd data_2nd_bd
-	    /* Parsing information data from the 2nd BD. */;
+/* Parsing information data from the 1st BD. */
+	struct eth_tx_data_1st_bd data_1st_bd;
+/* Parsing information data from the 2nd BD. */
+	struct eth_tx_data_2nd_bd data_2nd_bd;
 	__le32 reserved;
 };
 
@@ -348,7 +352,8 @@ enum eth_rx_cqe_type {
 };
 
 /*
- * Wrapp for PD RX CQE used in order to cover full cache line when writing CQE
+ * Wrapper for PD RX CQE - used in order to cover full cache line when writing
+ * CQE
  */
 struct eth_rx_pmd_cqe {
 	union eth_rx_cqe cqe /* CQE data itself */;
drivers/net/qede/base/nvm_cfg.h +12 -5
index 8d99880..fe980d5 100644
@@ -225,7 +225,8 @@ struct nvm_cfg1_glob {
 		#define NVM_CFG1_GLOB_ON_CHIP_SENSOR_MODE_INT_EXT_I2C 0x1
 		#define NVM_CFG1_GLOB_ON_CHIP_SENSOR_MODE_INT_ONLY 0x2
 		#define NVM_CFG1_GLOB_ON_CHIP_SENSOR_MODE_INT_EXT_SMBUS 0x3
-#define NVM_CFG1_GLOB_TEMPERATURE_MONITORING_MODE_MASK          0x06000000
+		#define NVM_CFG1_GLOB_TEMPERATURE_MONITORING_MODE_MASK \
+			0x06000000
 		#define NVM_CFG1_GLOB_TEMPERATURE_MONITORING_MODE_OFFSET 25
 		#define NVM_CFG1_GLOB_TEMPERATURE_MONITORING_MODE_DISABLE 0x0
 		#define NVM_CFG1_GLOB_TEMPERATURE_MONITORING_MODE_INTERNAL 0x1
@@ -272,10 +273,12 @@ struct nvm_cfg1_glob {
 		#define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_MASK 0x00000080
 		#define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_OFFSET 7
 	/*  Control the period between two successive checks */
-#define NVM_CFG1_GLOB_TEMPERATURE_PERIOD_BETWEEN_CHECKS_MASK    0x0000FF00
+		#define NVM_CFG1_GLOB_TEMPERATURE_PERIOD_BETWEEN_CHECKS_MASK \
+			0x0000FF00
 		#define NVM_CFG1_GLOB_TEMPERATURE_PERIOD_BETWEEN_CHECKS_OFFSET 8
 	/*  Set shutdown temperature */
-#define NVM_CFG1_GLOB_SHUTDOWN_THRESHOLD_TEMPERATURE_MASK       0x00FF0000
+		#define NVM_CFG1_GLOB_SHUTDOWN_THRESHOLD_TEMPERATURE_MASK \
+			0x00FF0000
 		#define NVM_CFG1_GLOB_SHUTDOWN_THRESHOLD_TEMPERATURE_OFFSET 16
 	/*  Set max. count for over operational temperature */
 		#define NVM_CFG1_GLOB_MAX_COUNT_OPER_THRESHOLD_MASK 0xFF000000
@@ -320,10 +323,12 @@ struct nvm_cfg1_glob {
 		#define NVM_CFG1_GLOB_VENDOR_ID_MASK 0x0000FFFF
 		#define NVM_CFG1_GLOB_VENDOR_ID_OFFSET 0
 	/*  Set caution temperature */
-#define NVM_CFG1_GLOB_CAUTION_THRESHOLD_TEMPERATURE_MASK        0x00FF0000
+		#define NVM_CFG1_GLOB_CAUTION_THRESHOLD_TEMPERATURE_MASK \
+			0x00FF0000
 		#define NVM_CFG1_GLOB_CAUTION_THRESHOLD_TEMPERATURE_OFFSET 16
 	/*  Set external thermal sensor I2C address */
-#define NVM_CFG1_GLOB_EXTERNAL_THERMAL_SENSOR_ADDRESS_MASK      0xFF000000
+		#define NVM_CFG1_GLOB_EXTERNAL_THERMAL_SENSOR_ADDRESS_MASK \
+			0xFF000000
 		#define NVM_CFG1_GLOB_EXTERNAL_THERMAL_SENSOR_ADDRESS_OFFSET 24
 	u32 pci_subsys_id; /* 0x54 */
 		#define NVM_CFG1_GLOB_SUBSYSTEM_VENDOR_ID_MASK 0x0000FFFF
@@ -349,6 +354,7 @@ struct nvm_cfg1_glob {
 		#define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_8M 0xD
 		#define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_16M 0xE
 		#define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_32M 0xF
+	/*  BB VF BAR2 size */
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_MASK 0x000000F0
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_OFFSET 4
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_DISABLED 0x0
@@ -367,6 +373,7 @@ struct nvm_cfg1_glob {
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_16M 0xD
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_32M 0xE
 		#define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_64M 0xF
+	/*  BB BAR2 size (global) */
 		#define NVM_CFG1_GLOB_BAR2_SIZE_MASK 0x00000F00
 		#define NVM_CFG1_GLOB_BAR2_SIZE_OFFSET 8
 		#define NVM_CFG1_GLOB_BAR2_SIZE_DISABLED 0x0
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH v3 7/32 qede: fix 32 bit compilation

In reply to Rasesh Mody

Fix 32 bit compilation for gcc version 4.3.4.

---
 drivers/net/qede/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/qede/Makefile +4 -0
index fe449aa..7965a83 100644
@@ -48,9 +48,13 @@ endif
 endif
 
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
+ifeq ($(shell gcc -Wno-unused-but-set-variable -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0)
 CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
+endif
 CFLAGS_BASE_DRIVER += -Wno-missing-declarations
+ifeq ($(shell gcc -Wno-maybe-uninitialized -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0)
 CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized
+endif
 CFLAGS_BASE_DRIVER += -Wno-strict-prototypes
 ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-shift-negative-value
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH v3 8/32 qede: change the API signature of ecore_mcp_cmd_and_union()

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Change ecore_mcp_cmd_and_union() to accept pointer to a structure rather than accepting multiple arguments. A new struct ecore_mcp_mb_params is added for that purpose. Also make this function static. This change is mostly keeping in mind the future requests which needs additional arguments.

---
 drivers/net/qede/base/bcm_osal.h  |   2 +
 drivers/net/qede/base/ecore_mcp.c | 138 ++++++++++++++++++++++++--------------
 drivers/net/qede/base/ecore_mcp.h |  31 +++------
 3 files changed, 98 insertions(+), 73 deletions(-)
drivers/net/qede/base/bcm_osal.h +2 -0
index a535058..9d84ae2 100644
@@ -9,6 +9,8 @@
 #ifndef __BCM_OSAL_H
 #define __BCM_OSAL_H
 
+#include <string.h>
+
 #include <rte_byteorder.h>
 #include <rte_spinlock.h>
 #include <rte_malloc.h>
drivers/net/qede/base/ecore_mcp.c +87 -51

229 lines not on this page · raw message

drivers/net/qede/base/ecore_mcp.h +9 -22
index 7af4349..28a8f93 100644
@@ -49,6 +49,15 @@ struct ecore_mcp_info {
 	u16 mcp_hist;
 };
 
+struct ecore_mcp_mb_params {
+	u32 cmd;
+	u32 param;
+	union drv_union_data *p_data_src;
+	union drv_union_data *p_data_dst;
+	u32 mcp_resp;
+	u32 mcp_param;
+};
+
 /**
  * @brief Initialize the interface with the MCP
  *
@@ -177,28 +186,6 @@ enum _ecore_status_t ecore_mcp_reset(struct ecore_hwfn *p_hwfn,
 				     struct ecore_ptt *p_ptt);
 
 /**
- * @brief - Sets the union data in the MCP mailbox and sends a mailbox command.
- *
- * @param p_hwfn       - hw function
- * @param p_ptt        - PTT required for register access
- * @param cmd          - command to be sent to the MCP
- * @param param        - optional param
- * @param p_union_data - pointer to a drv_union_data
- * @param o_mcp_resp   - the MCP response code (exclude sequence)
- * @param o_mcp_param  - optional parameter provided by the MCP response
- *
- * @return enum _ecore_status_t -
- *      ECORE_SUCCESS - operation was successful
- *      ECORE_BUSY    - operation failed
- */
-enum _ecore_status_t ecore_mcp_cmd_and_union(struct ecore_hwfn *p_hwfn,
-					     struct ecore_ptt *p_ptt,
-					     u32 cmd, u32 param,
-					     union drv_union_data *p_union_data,
-					     u32 *o_mcp_resp,
-					     u32 *o_mcp_param);
-
-/**
  * @brief - Sends an NVM write command request to the MFW with
  *          payload.
  *
Signature · 1 line
1.8.3.1
#11 lore raw

PATCH v3 9/32 qede: serialize access to MFW mbox

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Add ecore_mcp_mb_lock() and ecore_mcp_mb_unlock() APIs to ensure a single thread is accessing MFW mailbox.

---
 drivers/net/qede/base/ecore_mcp.c | 70 ++++++++++++++++++++++++++++++++++-----
 drivers/net/qede/base/ecore_mcp.h |  4 +++
 2 files changed, 66 insertions(+), 8 deletions(-)
drivers/net/qede/base/ecore_mcp.c +62 -8
index 24211a3..12e1ec1 100644
@@ -202,6 +202,51 @@ err:
 	return ECORE_NOMEM;
 }
 
+/* Locks the MFW mailbox of a PF to ensure a single access.
+ * The lock is achieved in most cases by holding a spinlock, causing other
+ * threads to wait till a previous access is done.
+ * In some cases (currently when a [UN]LOAD_REQ commands are sent), the single
+ * access is achieved by setting a blocking flag, which will fail other
+ * competing contexts to send their mailboxes.
+ */
+static enum _ecore_status_t ecore_mcp_mb_lock(struct ecore_hwfn *p_hwfn,
+					      u32 cmd)
+{
+	OSAL_SPIN_LOCK(&p_hwfn->mcp_info->lock);
+
+	/* The spinlock shouldn't be acquired when the mailbox command is
+	 * [UN]LOAD_REQ, since the engine is locked by the MFW, and a parallel
+	 * pending [UN]LOAD_REQ command of another PF together with a spinlock
+	 * (i.e. interrupts are disabled) - can lead to a deadlock.
+	 * It is assumed that for a single PF, no other mailbox commands can be
+	 * sent from another context while sending LOAD_REQ, and that any
+	 * parallel commands to UNLOAD_REQ can be cancelled.
+	 */
+	if (cmd == DRV_MSG_CODE_LOAD_DONE || cmd == DRV_MSG_CODE_UNLOAD_DONE)
+		p_hwfn->mcp_info->block_mb_sending = false;
+
+	if (p_hwfn->mcp_info->block_mb_sending) {
+		DP_NOTICE(p_hwfn, false,
+			  "Trying to send a MFW mailbox command [0x%x] in parallel to [UN]LOAD_REQ. Aborting.\n",
+			  cmd);
+		OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->lock);
+		return ECORE_BUSY;
+	}
+
+	if (cmd == DRV_MSG_CODE_LOAD_REQ || cmd == DRV_MSG_CODE_UNLOAD_REQ) {
+		p_hwfn->mcp_info->block_mb_sending = true;
+		OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->lock);
+	}
+
+	return ECORE_SUCCESS;
+}
+
+static void ecore_mcp_mb_unlock(struct ecore_hwfn *p_hwfn, u32 cmd)
+{
+	if (cmd != DRV_MSG_CODE_LOAD_REQ && cmd != DRV_MSG_CODE_UNLOAD_REQ)
+		OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->lock);
+}
+
 enum _ecore_status_t ecore_mcp_reset(struct ecore_hwfn *p_hwfn,
 				     struct ecore_ptt *p_ptt)
 {
@@ -214,8 +259,12 @@ enum _ecore_status_t ecore_mcp_reset(struct ecore_hwfn *p_hwfn,
 	if (CHIP_REV_IS_EMUL(p_hwfn->p_dev))
 		delay = EMUL_MCP_RESP_ITER_US;
 #endif
-
-	OSAL_SPIN_LOCK(&p_hwfn->mcp_info->lock);
+	/* Ensure that only a single thread is accessing the mailbox at a
+	 * certain time.
+	 */
+	rc = ecore_mcp_mb_lock(p_hwfn, DRV_MSG_CODE_MCP_RESET);
+	if (rc != ECORE_SUCCESS)
+		return rc;
 
 	/* Set drv command along with the updated sequence */
 	org_mcp_reset_seq = ecore_rd(p_hwfn, p_ptt, MISCS_REG_GENERIC_POR_0);
@@ -238,7 +287,7 @@ enum _ecore_status_t ecore_mcp_reset(struct ecore_hwfn *p_hwfn,
 		rc = ECORE_AGAIN;
 	}
 
-	OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->lock);
+	ecore_mcp_mb_unlock(p_hwfn, DRV_MSG_CODE_MCP_RESET);
 
 	return rc;
 }
@@ -327,14 +376,16 @@ ecore_mcp_cmd_and_union(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
 		return ECORE_BUSY;
 	}
 
-	/* Acquiring a spinlock is needed to ensure that only a single thread
-	 * is accessing the mailbox at a certain time.
-	 */
-	OSAL_SPIN_LOCK(&p_hwfn->mcp_info->lock);
-
 	union_data_addr = p_hwfn->mcp_info->drv_mb_addr +
 			  OFFSETOF(struct public_drv_mb, union_data);
 
+	/* Ensure that only a single thread is accessing the mailbox at a
+	 * certain time.
+	 */
+	rc = ecore_mcp_mb_lock(p_hwfn, p_mb_params->cmd);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
 	if (p_mb_params->p_data_src != OSAL_NULL)
 		ecore_memcpy_to(p_hwfn, p_ptt, union_data_addr,
 				p_mb_params->p_data_src,
@@ -348,6 +399,9 @@ ecore_mcp_cmd_and_union(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
 		ecore_memcpy_from(p_hwfn, p_ptt, p_mb_params->p_data_dst,
 				  union_data_addr,
 				  sizeof(*p_mb_params->p_data_dst));
+
+	ecore_mcp_mb_unlock(p_hwfn, p_mb_params->cmd);
+
 	return rc;
 }
 
drivers/net/qede/base/ecore_mcp.h +4 -0
index 28a8f93..e055835 100644
@@ -32,6 +32,10 @@
 				 ((_p_hwfn)->p_dev->num_ports_in_engines * 2))
 struct ecore_mcp_info {
 	osal_spinlock_t lock;	/* Spinlock used for accessing MCP mailbox */
+
+	/* Flag to indicate whether sending a MFW mailbox is forbidden */
+	bool block_mb_sending;
+
 	u32 public_base;	/* Address of the MCP public area */
 	u32 drv_mb_addr;	/* Address of the driver mailbox */
 	u32 mfw_mb_addr;	/* Address of the MFW mailbox */
Signature · 1 line
1.8.3.1
#12 lore raw

PATCH v3 10/32 qede: add APIs to support NIC selftests and query sensor info.

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

This patch adds API support for NIC selftests (BIST) and APIs to retrieve GPIO info, sensor data like temperature, MBA versions, ECC events etc.

---
 drivers/net/qede/base/ecore_mcp.c     | 314 ++++++++++++++++++++++++++++++++++
 drivers/net/qede/base/ecore_mcp_api.h | 155 +++++++++++++++++
 drivers/net/qede/base/mcp_public.h    | 100 +++++++++++
 3 files changed, 569 insertions(+)
drivers/net/qede/base/ecore_mcp.c +314 -0
index 12e1ec1..5baa5a7 100644
@@ -2021,3 +2021,317 @@ enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn,
 
 	return ECORE_SUCCESS;
 }
+
+enum _ecore_status_t ecore_mcp_gpio_info(struct ecore_hwfn *p_hwfn,
+					 struct ecore_ptt *p_ptt,
+					 u16 gpio, u32 *gpio_direction,
+					 u32 *gpio_ctrl)
+{
+	u32 drv_mb_param = 0, rsp, val = 0;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
+
+	drv_mb_param = gpio << DRV_MB_PARAM_GPIO_NUMBER_SHIFT;
+
+	rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_GPIO_INFO,
+			   drv_mb_param, &rsp, &val);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	*gpio_direction = (val & DRV_MB_PARAM_GPIO_DIRECTION_MASK) >>
+			   DRV_MB_PARAM_GPIO_DIRECTION_SHIFT;
+	*gpio_ctrl = (val & DRV_MB_PARAM_GPIO_CTRL_MASK) >>
+		      DRV_MB_PARAM_GPIO_CTRL_SHIFT;
+
+	if ((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_GPIO_OK)
+		return ECORE_UNKNOWN_ERROR;
+
+	return ECORE_SUCCESS;
+}
+
+enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,
+						  struct ecore_ptt *p_ptt)
+{
+	u32 drv_mb_param = 0, rsp, param;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
+
+	drv_mb_param = (DRV_MB_PARAM_BIST_REGISTER_TEST <<
+			DRV_MB_PARAM_BIST_TEST_INDEX_SHIFT);
+
+	rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_BIST_TEST,
+			   drv_mb_param, &rsp, &param);
+
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK) ||
+	    (param != DRV_MB_PARAM_BIST_RC_PASSED))
+		rc = ECORE_UNKNOWN_ERROR;
+
+	return rc;
+}
+
+enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn,
+					       struct ecore_ptt *p_ptt)
+{
+	u32 drv_mb_param = 0, rsp, param;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
+
+	drv_mb_param = (DRV_MB_PARAM_BIST_CLOCK_TEST <<
+			DRV_MB_PARAM_BIST_TEST_INDEX_SHIFT);
+
+	rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_BIST_TEST,
+			   drv_mb_param, &rsp, &param);
+
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK) ||
+	    (param != DRV_MB_PARAM_BIST_RC_PASSED))
+		rc = ECORE_UNKNOWN_ERROR;
+
+	return rc;
+}
+
+enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images(
+	struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u32 *num_images)
+{
+	u32 drv_mb_param = 0, rsp;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
+
+	drv_mb_param = (DRV_MB_PARAM_BIST_NVM_TEST_NUM_IMAGES <<
+			DRV_MB_PARAM_BIST_TEST_INDEX_SHIFT);
+
+	rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_BIST_TEST,
+			   drv_mb_param, &rsp, num_images);
+
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	if (((rsp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK))
+		rc = ECORE_UNKNOWN_ERROR;
+
+	return rc;
+}
+
+enum _ecore_status_t ecore_mcp_bist_nvm_test_get_image_att(
+	struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
+	struct bist_nvm_image_att *p_image_att, u32 image_index)
+{
+	struct ecore_mcp_nvm_params params;
+	enum _ecore_status_t rc;
+	u32 buf_size;
+
+	OSAL_MEMSET(&params, 0, sizeof(struct ecore_mcp_nvm_params));
+	params.nvm_common.offset = (DRV_MB_PARAM_BIST_NVM_TEST_IMAGE_BY_INDEX <<
+				    DRV_MB_PARAM_BIST_TEST_INDEX_SHIFT);
+	params.nvm_common.offset |= (image_index <<
+				    DRV_MB_PARAM_BIST_TEST_IMAGE_INDEX_SHIFT);
+
+	params.type = ECORE_MCP_NVM_RD;
+	params.nvm_rd.buf_size = &buf_size;
+	params.nvm_common.cmd = DRV_MSG_CODE_BIST_TEST;
+	params.nvm_rd.buf = (u32 *)p_image_att;
+
+	rc = ecore_mcp_nvm_command(p_hwfn, p_ptt, &params);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	if (((params.nvm_common.resp & FW_MSG_CODE_MASK) != FW_MSG_CODE_OK) ||
+	    (p_image_att->return_code != 1))
+		rc = ECORE_UNKNOWN_ERROR;
+
+	return rc;
+}
+
+enum _ecore_status_t ecore_mcp_get_nvm_image(struct ecore_hwfn *p_hwfn,
+					     struct ecore_ptt *p_ptt,
+					     enum ecore_nvm_images image_id,
+					     char *p_buffer, u16 buffer_len)
+{
+	struct bist_nvm_image_att image_att;
+	/* enum nvm_image_type type; */ /* @DPDK */
+	u32 type;
+	u32 num_images, i;
+	enum _ecore_status_t rc;
+
+	OSAL_MEM_ZERO(p_buffer, buffer_len);
+
+	/* Translate image_id into MFW definitions */
+	switch (image_id) {
+	case ECORE_NVM_IMAGE_ISCSI_CFG:
+		/* @DPDK */
+		type = 0x1d; /* NVM_TYPE_ISCSI_CFG; */
+		break;
+	case ECORE_NVM_IMAGE_FCOE_CFG:
+		type = 0x1f; /* NVM_TYPE_FCOE_CFG; */
+		break;
+	default:
+		DP_NOTICE(p_hwfn, false, "Unknown request of image_id %08x\n",
+			  image_id);
+		return ECORE_INVAL;
+	}
+
+	/* Learn number of images, then traverse and see if one fits */
+	rc = ecore_mcp_bist_nvm_test_get_num_images(p_hwfn, p_ptt,
+						    &num_images);
+	if ((rc != ECORE_SUCCESS) || (!num_images))
+		return ECORE_INVAL;
+
+	for (i = 0; i < num_images; i++) {
+		rc = ecore_mcp_bist_nvm_test_get_image_att(p_hwfn, p_ptt,
+							   &image_att, i);
+		if (rc != ECORE_SUCCESS)
+			return ECORE_INVAL;
+
+		if (type == image_att.image_type)
+			break;
+	}
+	if (i == num_images) {
+		DP_VERBOSE(p_hwfn, ECORE_MSG_STORAGE,
+			   "Failed to find nvram image of type %08x\n",
+			   image_id);
+		return ECORE_INVAL;
+	}
+
+	/* Validate sizes - both the image's and the supplied buffer's */
+	if (image_att.len <= 4) {
+		DP_VERBOSE(p_hwfn, ECORE_MSG_STORAGE,
+			   "Image [%d] is too small - only %d bytes\n",
+			   image_id, image_att.len);
+		return ECORE_INVAL;
+	}
+
+	/* Each NVM image is suffixed by CRC; Upper-layer has no need for it */
+	image_att.len -= 4;
+
+	if (image_att.len > buffer_len) {
+		DP_VERBOSE(p_hwfn, ECORE_MSG_STORAGE,
+			   "Image [%d] is too big - %08x bytes where only %08x are available\n",
+			   image_id, image_att.len, buffer_len);
+		return ECORE_NOMEM;
+	}
+
+	return ecore_mcp_nvm_read(p_hwfn->p_dev, image_att.nvm_start_addr,
+				  (u8 *)p_buffer, image_att.len);
+}
+
+enum _ecore_status_t
+ecore_mcp_get_temperature_info(struct ecore_hwfn *p_hwfn,
+			       struct ecore_ptt *p_ptt,
+			       struct ecore_temperature_info *p_temp_info)
+{
+	struct ecore_temperature_sensor *p_temp_sensor;
+	struct temperature_status_stc *p_mfw_temp_info;
+	struct ecore_mcp_mb_params mb_params;
+	union drv_union_data union_data;
+	u32 val;
+	enum _ecore_status_t rc;
+	u8 i;
+
+	OSAL_MEM_ZERO(&mb_params, sizeof(mb_params));
+	mb_params.cmd = DRV_MSG_CODE_GET_TEMPERATURE;
+	mb_params.p_data_dst = &union_data;
+	rc = ecore_mcp_cmd_and_union(p_hwfn, p_ptt, &mb_params);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	p_mfw_temp_info = &union_data.temp_info;
+
+	OSAL_BUILD_BUG_ON(ECORE_MAX_NUM_OF_SENSORS != MAX_NUM_OF_SENSORS);
+	p_temp_info->num_sensors = OSAL_MIN_T(u32,
+					      p_mfw_temp_info->num_of_sensors,
+					      ECORE_MAX_NUM_OF_SENSORS);
+	for (i = 0; i < p_temp_info->num_sensors; i++) {
+		val = p_mfw_temp_info->sensor[i];
+		p_temp_sensor = &p_temp_info->sensors[i];
+		p_temp_sensor->sensor_location = (val & SENSOR_LOCATION_MASK) >>
+						  SENSOR_LOCATION_SHIFT;
+		p_temp_sensor->threshold_high = (val & THRESHOLD_HIGH_MASK) >>
+						 THRESHOLD_HIGH_SHIFT;
+		p_temp_sensor->critical = (val & CRITICAL_TEMPERATURE_MASK) >>
+					  CRITICAL_TEMPERATURE_SHIFT;
+		p_temp_sensor->current_temp = (val & CURRENT_TEMP_MASK) >>
+					      CURRENT_TEMP_SHIFT;
+	}
+
+	return ECORE_SUCCESS;
+}
+
+enum _ecore_status_t ecore_mcp_get_mba_versions(
+	struct ecore_hwfn *p_hwfn,
+	struct ecore_ptt *p_ptt,
+	struct ecore_mba_vers *p_mba_vers)
+{
+	struct ecore_mcp_nvm_params params;
+	enum _ecore_status_t rc;
+	u32 buf_size;
+
+	OSAL_MEM_ZERO(&params, sizeof(params));
+	params.type = ECORE_MCP_NVM_RD;
+	params.nvm_common.cmd = DRV_MSG_CODE_GET_MBA_VERSION;
+	params.nvm_common.offset = 0;
+	params.nvm_rd.buf = &p_mba_vers->mba_vers[0];
+	params.nvm_rd.buf_size = &buf_size;
+	rc = ecore_mcp_nvm_command(p_hwfn, p_ptt, &params);
+
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	if ((params.nvm_common.resp & FW_MSG_CODE_MASK) !=
+	    FW_MSG_CODE_NVM_OK)
+		rc = ECORE_UNKNOWN_ERROR;
+
+	if (buf_size != MCP_DRV_NVM_BUF_LEN)
+		rc = ECORE_UNKNOWN_ERROR;
+
+	return rc;
+}
+
+enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
+					      struct ecore_ptt *p_ptt,
+					      u64 *num_events)
+{
+	u32 rsp;
+
+	return ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_MEM_ECC_EVENTS,
+			     0, &rsp, (u32 *)num_events);
+}
+
+#define ECORE_RESC_ALLOC_VERSION_MAJOR  1
+#define ECORE_RESC_ALLOC_VERSION_MINOR  0
+#define ECORE_RESC_ALLOC_VERSION                                \
+	((ECORE_RESC_ALLOC_VERSION_MAJOR <<                     \
+	  DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_SHIFT) |    \
+	 (ECORE_RESC_ALLOC_VERSION_MINOR <<                     \
+	  DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_SHIFT))
+
+enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
+					     struct ecore_ptt *p_ptt,
+					     struct resource_info *p_resc_info,
+					     u32 *p_mcp_resp, u32 *p_mcp_param)
+{
+	struct ecore_mcp_mb_params mb_params;
+	union drv_union_data *p_union_data;
+	enum _ecore_status_t rc;
+
+	OSAL_MEM_ZERO(&mb_params, sizeof(mb_params));
+	mb_params.cmd = DRV_MSG_GET_RESOURCE_ALLOC_MSG;
+	mb_params.param = ECORE_RESC_ALLOC_VERSION;
+	p_union_data = (union drv_union_data *)p_resc_info;
+	mb_params.p_data_src = p_union_data;
+	mb_params.p_data_dst = p_union_data;
+	rc = ecore_mcp_cmd_and_union(p_hwfn, p_ptt, &mb_params);
+	if (rc != ECORE_SUCCESS)
+		return rc;
+
+	*p_mcp_resp = mb_params.mcp_resp;
+	*p_mcp_param = mb_params.mcp_param;
+
+	DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
+		   "MFW resource_info: version 0x%x, res_id 0x%x, size 0x%x, offset 0x%x, vf_size 0x%x, vf_offset 0x%x, flags 0x%x\n",
+		   *p_mcp_param, p_resc_info->res_id, p_resc_info->size,
+		   p_resc_info->offset, p_resc_info->vf_size,
+		   p_resc_info->vf_offset, p_resc_info->flags);
+
+	return ECORE_SUCCESS;
+}
drivers/net/qede/base/ecore_mcp_api.h +155 -0

172 lines not on this page · raw message

drivers/net/qede/base/mcp_public.h +100 -0

140 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#13 lore raw

PATCH v3 11/32 qede/base: update base driver

In reply to Rasesh Mody

This patch updates the base driver and incorporates necessary changes required to bring in the new firmware 8.10.9.0.

In addition, it would allow driver to add new functionalities that might be needed in future.

---
 doc/guides/nics/features/qede.ini           |    2 +
 doc/guides/nics/features/qede_vf.ini        |    2 +
 doc/guides/nics/qede.rst                    |   15 +-
 drivers/net/qede/base/bcm_osal.h            |    6 +-
 drivers/net/qede/base/ecore.h               |  166 ++-
 drivers/net/qede/base/ecore_chain.h         |   17 +-
 drivers/net/qede/base/ecore_cxt.c           |  319 +++++-
 drivers/net/qede/base/ecore_cxt.h           |   49 +-
 drivers/net/qede/base/ecore_cxt_api.h       |   15 -
 drivers/net/qede/base/ecore_dcbx.c          |  581 +++++++++-
 drivers/net/qede/base/ecore_dcbx.h          |   18 +-
 drivers/net/qede/base/ecore_dcbx_api.h      |  128 ++-
 drivers/net/qede/base/ecore_dev.c           | 1551 +++++++++++++++++++-------
 drivers/net/qede/base/ecore_dev_api.h       |   92 +-
 drivers/net/qede/base/ecore_hsi_eth.h       |  120 +-
 drivers/net/qede/base/ecore_hw.c            |  212 ++--
 drivers/net/qede/base/ecore_hw.h            |   16 +-
 drivers/net/qede/base/ecore_init_fw_funcs.c |  324 ++++--
 drivers/net/qede/base/ecore_init_fw_funcs.h |  102 +-
 drivers/net/qede/base/ecore_init_ops.c      |    5 +-
 drivers/net/qede/base/ecore_int.c           |  271 ++---
 drivers/net/qede/base/ecore_int.h           |   19 +-
 drivers/net/qede/base/ecore_int_api.h       |   11 +
 drivers/net/qede/base/ecore_iov_api.h       |  104 +-
 drivers/net/qede/base/ecore_iro.h           |  222 ++--
 drivers/net/qede/base/ecore_iro_values.h    |  108 +-
 drivers/net/qede/base/ecore_l2.c            |  292 ++---
 drivers/net/qede/base/ecore_l2.h            |   57 +-
 drivers/net/qede/base/ecore_l2_api.h        |    9 +-
 drivers/net/qede/base/ecore_mcp.c           |  350 +++---
 drivers/net/qede/base/ecore_mcp.h           |   29 +-
 drivers/net/qede/base/ecore_mcp_api.h       |   81 +-
 drivers/net/qede/base/ecore_proto_if.h      |   59 +
 drivers/net/qede/base/ecore_rt_defs.h       |  639 +++++------
 drivers/net/qede/base/ecore_sp_commands.c   |   68 +-
 drivers/net/qede/base/ecore_sp_commands.h   |   30 +
 drivers/net/qede/base/ecore_spq.c           |  169 +--
 drivers/net/qede/base/ecore_spq.h           |    5 +-
 drivers/net/qede/base/ecore_sriov.c         | 1596 +++++++++++++++++----------
 drivers/net/qede/base/ecore_sriov.h         |  149 +--
 drivers/net/qede/base/ecore_vf.c            |  736 ++++++------
 drivers/net/qede/base/ecore_vf.h            |  224 +---
 drivers/net/qede/base/ecore_vf_api.h        |   93 +-
 drivers/net/qede/base/ecore_vfpf_if.h       |  162 ++-
 drivers/net/qede/base/eth_common.h          |  203 ++--
 drivers/net/qede/base/mcp_public.h          |  408 +++++--
 drivers/net/qede/base/nvm_cfg.h             |  606 +++++++++-
 drivers/net/qede/qede_eth_if.c              |    1 +
 drivers/net/qede/qede_main.c                |   20 +-
 drivers/net/qede/qede_rxtx.h                |    4 +
 50 files changed, 6899 insertions(+), 3566 deletions(-)
doc/guides/nics/features/qede.ini +2 -0
index 0df93a6..7690773 100644
@@ -19,6 +19,8 @@ VLAN filter          = Y
 Flow control         = Y
 CRC offload          = Y
 VLAN offload         = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
 Packet type parsing  = Y
 Basic stats          = Y
 Extended stats       = Y
doc/guides/nics/features/qede_vf.ini +2 -0
index f925659..aeb20d2 100644
@@ -20,6 +20,8 @@ VLAN filter          = Y
 Flow control         = Y
 CRC offload          = Y
 VLAN offload         = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
 Packet type parsing  = Y
 Basic stats          = Y
 Extended stats       = Y
doc/guides/nics/qede.rst +8 -7
index 53d749c..df6fecc 100644
@@ -32,7 +32,7 @@ QEDE Poll Mode Driver
 ======================
 
 The QEDE poll mode driver library (**librte_pmd_qede**) implements support
-for **QLogic FastLinQ QL4xxxx 25G/40G CNA** family of adapters as well
+for **QLogic FastLinQ QL4xxxx 25G/40G/100G CNA** family of adapters as well
 as their virtual functions (VF) in SR-IOV context. It is supported on
 several standard Linux distros like RHEL7.x, SLES12.x and Ubuntu.
 It is compile-tested under FreeBSD OS.
@@ -55,14 +55,15 @@ Supported Features
 - TSS
 - Multiple MAC address
 - Default pause flow control
-- SR-IOV VF for 25G/40G modes
+- SR-IOV VF
+- MTU change
+- Multiprocess aware
 
 Non-supported Features
 ----------------------
 
 - Scatter-Gather Rx/Tx frames
 - Unequal number of Rx/Tx queues
-- MTU change (dynamic)
 - SR-IOV PF
 - Tunneling offloads
 - Reload of the PMD after a non-graceful termination
@@ -75,10 +76,10 @@ Supported QLogic Adapters
 Prerequisites
 -------------
 
-- Requires firmware version **8.7.x.** and management firmware
-  version **8.7.x or higher**. Firmware may be available
+- Requires firmware version **8.10.x.** and management firmware
+  version **8.10.x or higher**. Firmware may be available
   inbox in certain newer Linux distros under the standard directory
-  ``E.g. /lib/firmware/qed/qed_init_values_zipped-8.7.7.0.bin``
+  ``E.g. /lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin``
 
 - If the required firmware files are not available then visit
   `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`_.
@@ -120,7 +121,7 @@ enabling debugging options may affect system performance.
 - ``CONFIG_RTE_LIBRTE_QEDE_FW`` (default **""**)
 
   Gives absolute path of firmware file.
-  ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.7.7.0.bin"``
+  ``Eg: "/lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin"``
   Empty string indicates driver will pick up the firmware file
   from the default location.
 
drivers/net/qede/base/bcm_osal.h +4 -2
index 9d84ae2..0b446f2 100644
@@ -9,8 +9,6 @@
 #ifndef __BCM_OSAL_H
 #define __BCM_OSAL_H
 
-#include <string.h>
-
 #include <rte_byteorder.h>
 #include <rte_spinlock.h>
 #include <rte_malloc.h>
@@ -43,6 +41,8 @@ void qed_link_update(struct ecore_hwfn *hwfn);
 #endif
 #endif
 
+#define OSAL_WARN(arg1, arg2, arg3, ...) (0)
+
 /* Memory Types */
 typedef uint8_t u8;
 typedef uint16_t u16;
@@ -330,6 +330,8 @@ u32 qede_find_first_zero_bit(unsigned long *, u32);
 #define OSAL_IOV_VF_VPORT_UPDATE(hwfn, vfid, p_params, p_mask) 0
 #define OSAL_VF_UPDATE_ACQUIRE_RESC_RESP(_dev_p, _resc_resp) 0
 #define OSAL_IOV_GET_OS_TYPE() 0
+#define OSAL_IOV_VF_MSG_TYPE(hwfn, vfid, vf_msg_type) 0
+#define OSAL_IOV_PF_RESP_TYPE(hwfn, vfid, pf_resp_type) 0
 
 u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 		   u8 *input_buf, u32 max_size, u8 *unzip_buf);
drivers/net/qede/base/ecore.h +106 -60

365 lines not on this page · raw message

drivers/net/qede/base/ecore_chain.h +16 -1
index 56b7b4d..9ad1874 100644
@@ -118,6 +118,8 @@ struct ecore_chain {
 	u16 next_page_mask;
 
 	struct ecore_chain_pbl pbl;
+
+	void *dp_ctx;
 };
 
 #define ECORE_CHAIN_PBL_ENTRY_SIZE	(8)
@@ -542,12 +544,13 @@ static OSAL_INLINE void ecore_chain_reset(struct ecore_chain *p_chain)
  * @param intended_use
  * @param mode
  * @param cnt_type
+ * @param dp_ctx
  */
 static OSAL_INLINE void
 ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size,
 			enum ecore_chain_use_mode intended_use,
 			enum ecore_chain_mode mode,
-			enum ecore_chain_cnt_type cnt_type)
+			enum ecore_chain_cnt_type cnt_type, void *dp_ctx)
 {
 	/* chain fixed parameters */
 	p_chain->p_virt_addr = OSAL_NULL;
@@ -571,6 +574,8 @@ ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size,
 	p_chain->pbl.p_phys_table = 0;
 	p_chain->pbl.p_virt_table = OSAL_NULL;
 	p_chain->pbl.pp_virt_addr_tbl = OSAL_NULL;
+
+	p_chain->dp_ctx = dp_ctx;
 }
 
 /**
@@ -723,4 +728,14 @@ static OSAL_INLINE void ecore_chain_pbl_zero_mem(struct ecore_chain *p_chain)
 			      ECORE_CHAIN_PAGE_SIZE);
 }
 
+int ecore_chain_print(struct ecore_chain *p_chain, char *buffer,
+		      u32 buffer_size, u32 *element_indx, u32 stop_indx,
+		      bool print_metadata,
+		      int (*func_ptr_print_element)(struct ecore_chain *p_chain,
+						    void *p_element,
+						    char *buffer),
+		      int (*func_ptr_print_metadata)(struct ecore_chain
+						     *p_chain,
+						     char *buffer));
+
 #endif /* __ECORE_CHAIN_H__ */
drivers/net/qede/base/ecore_cxt.c +284 -35

521 lines not on this page · raw message

drivers/net/qede/base/ecore_cxt.h +34 -15

83 lines not on this page · raw message

drivers/net/qede/base/ecore_cxt_api.h +0 -15
index 90aff3e..6a50412 100644
@@ -25,21 +25,6 @@ struct ecore_tid_mem {
 	u8 *blocks[MAX_TID_BLOCKS]; /* 4K */
 };
 
-static OSAL_INLINE void *get_task_mem(struct ecore_tid_mem *info, u32 tid)
-{
-	/* note: waste is superfluous */
-	return (void *)(info->blocks[tid / info->num_tids_per_block] +
-			(tid % info->num_tids_per_block) * info->tid_size);
-
-	/* more elaborate alternative with no modulo
-	 * u32 mask = info->tid_size * info->num_tids_per_block +
-	 *            info->waste - 1;
-	 * u32 index = tid / info->num_tids_per_block;
-	 * u32 offset = tid * info->tid_size + index * info->waste;
-	 * return (void *)(blocks[index] + (offset & mask));
-	 */
-}
-
 /**
 * @brief ecore_cxt_acquire - Acquire a new cid of a specific protocol type
 *
drivers/net/qede/base/ecore_dcbx.c +522 -59

840 lines not on this page · raw message

drivers/net/qede/base/ecore_dcbx.h +14 -4
index d577f4e..1518624 100644
@@ -25,6 +25,8 @@ struct ecore_dcbx_info {
 	struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS];
 	struct dcbx_local_params local_admin;
 	struct ecore_dcbx_results results;
+	struct dcb_dscp_map dscp_map;
+	bool dscp_nig_update;
 	struct dcbx_mib operational;
 	struct dcbx_mib remote;
 	struct ecore_dcbx_set set;
@@ -32,10 +34,15 @@ struct ecore_dcbx_info {
 	u8 dcbx_cap;
 };
 
-/* Upper layer driver interface routines */
-enum _ecore_status_t ecore_dcbx_config_params(struct ecore_hwfn *,
-					      struct ecore_ptt *,
-					      struct ecore_dcbx_set *);
+struct ecore_dcbx_mib_meta_data {
+	struct lldp_config_params_s *lldp_local;
+	struct lldp_status_params_s *lldp_remote;
+	struct dcbx_local_params *local_admin;
+	struct dcb_dscp_map *dscp_map;
+	struct dcbx_mib *mib;
+	osal_size_t size;
+	u32 addr;
+};
 
 /* ECORE local interface routines */
 enum _ecore_status_t
@@ -48,8 +55,11 @@ enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn);
 void ecore_dcbx_info_free(struct ecore_hwfn *, struct ecore_dcbx_info *);
 void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
 				     struct pf_update_ramrod_data *p_dest);
+
+#ifndef REAL_ASIC_ONLY
 /* @@@TBD eagle phy workaround */
 void ecore_dcbx_eagle_workaround(struct ecore_hwfn *, struct ecore_ptt *,
 				 bool set_to_pfc);
+#endif
 
 #endif /* __ECORE_DCBX_H__ */
drivers/net/qede/base/ecore_dcbx_api.h +82 -46

203 lines not on this page · raw message

drivers/net/qede/base/ecore_dev.c +1148 -403

799 lines not on this page · raw message

drivers/net/qede/base/ecore_dev_api.h +66 -26

92 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_eth.h +80 -40

120 lines not on this page · raw message

drivers/net/qede/base/ecore_hw.c +131 -81

212 lines not on this page · raw message

drivers/net/qede/base/ecore_hw.h +15 -1
index 154eb3c..0750b2e 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_init_fw_funcs.c +260 -64

324 lines not on this page · raw message

drivers/net/qede/base/ecore_init_fw_funcs.h +95 -7

102 lines not on this page · raw message

drivers/net/qede/base/ecore_init_ops.c +3 -2
index 71bad30..351e946 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_int.c +145 -126

271 lines not on this page · raw message

drivers/net/qede/base/ecore_int.h +3 -16
index eeec8ca..45358b9 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_int_api.h +11 -0
index f6db807..fc873e7 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_iov_api.h +81 -23

104 lines not on this page · raw message

drivers/net/qede/base/ecore_iro.h +148 -74

222 lines not on this page · raw message

drivers/net/qede/base/ecore_iro_values.h +79 -29

108 lines not on this page · raw message

drivers/net/qede/base/ecore_l2.c +118 -174

292 lines not on this page · raw message

drivers/net/qede/base/ecore_l2.h +5 -52

57 lines not on this page · raw message

drivers/net/qede/base/ecore_l2_api.h +6 -3
index 65a508c..09688eb 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_mcp.c +153 -197

350 lines not on this page · raw message

drivers/net/qede/base/ecore_mcp.h +17 -12
index e055835..8a2c84c 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_mcp_api.h +55 -26

81 lines not on this page · raw message

drivers/net/qede/base/ecore_proto_if.h +59 -0

59 lines not on this page · raw message

drivers/net/qede/base/ecore_rt_defs.h +323 -316

639 lines not on this page · raw message

drivers/net/qede/base/ecore_sp_commands.c +63 -5

68 lines not on this page · raw message

drivers/net/qede/base/ecore_sp_commands.h +30 -0
index 22c7462..66c9a69 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_spq.c +104 -65

169 lines not on this page · raw message

drivers/net/qede/base/ecore_spq.h +3 -2
index 490b7d9..717ede3 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_sriov.c +1021 -575

1,596 lines not on this page · raw message

drivers/net/qede/base/ecore_sriov.h +34 -115

149 lines not on this page · raw message

drivers/net/qede/base/ecore_vf.c +429 -307

736 lines not on this page · raw message

drivers/net/qede/base/ecore_vf.h +40 -184

224 lines not on this page · raw message

drivers/net/qede/base/ecore_vf_api.h +23 -70

93 lines not on this page · raw message

drivers/net/qede/base/ecore_vfpf_if.h +69 -93

162 lines not on this page · raw message

drivers/net/qede/base/eth_common.h +136 -67

203 lines not on this page · raw message

drivers/net/qede/base/mcp_public.h +306 -102

408 lines not on this page · raw message

drivers/net/qede/base/nvm_cfg.h +547 -59

606 lines not on this page · raw message

drivers/net/qede/qede_eth_if.c +1 -0
index b6f6487..a00f05d 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/qede_main.c +14 -6
index 2e62371..e4ef4f0 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/qede_rxtx.h +4 -0
index 34eaf8b..90da603 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#14 lore raw

PATCH v3 12/32 qede/base: rename structure and defines

In reply to Rasesh Mody

Renamed following to match with HSI changes
- PMM_* to ETH_*
- pmm_* to eth_*

---
 drivers/net/qede/base/ecore_l2.c   |  90 ++++++++++-----------
 drivers/net/qede/base/ecore_mcp.c  |  12 +--
 drivers/net/qede/base/mcp_public.h | 158 +++++++++++++++++++++----------------
 3 files changed, 140 insertions(+), 120 deletions(-)
drivers/net/qede/base/ecore_l2.c +45 -45
index b1190e4..5a38ad2 100644
@@ -1583,51 +1583,51 @@ static void __ecore_get_vport_port_stats(struct ecore_hwfn *p_hwfn,
 			  OFFSETOF(struct public_port, stats),
 			  sizeof(port_stats));
 
-	p_stats->rx_64_byte_packets += port_stats.pmm.r64;
-	p_stats->rx_65_to_127_byte_packets += port_stats.pmm.r127;
-	p_stats->rx_128_to_255_byte_packets += port_stats.pmm.r255;
-	p_stats->rx_256_to_511_byte_packets += port_stats.pmm.r511;
-	p_stats->rx_512_to_1023_byte_packets += port_stats.pmm.r1023;
-	p_stats->rx_1024_to_1518_byte_packets += port_stats.pmm.r1518;
-	p_stats->rx_1519_to_1522_byte_packets += port_stats.pmm.r1522;
-	p_stats->rx_1519_to_2047_byte_packets += port_stats.pmm.r2047;
-	p_stats->rx_2048_to_4095_byte_packets += port_stats.pmm.r4095;
-	p_stats->rx_4096_to_9216_byte_packets += port_stats.pmm.r9216;
-	p_stats->rx_9217_to_16383_byte_packets += port_stats.pmm.r16383;
-	p_stats->rx_crc_errors += port_stats.pmm.rfcs;
-	p_stats->rx_mac_crtl_frames += port_stats.pmm.rxcf;
-	p_stats->rx_pause_frames += port_stats.pmm.rxpf;
-	p_stats->rx_pfc_frames += port_stats.pmm.rxpp;
-	p_stats->rx_align_errors += port_stats.pmm.raln;
-	p_stats->rx_carrier_errors += port_stats.pmm.rfcr;
-	p_stats->rx_oversize_packets += port_stats.pmm.rovr;
-	p_stats->rx_jabbers += port_stats.pmm.rjbr;
-	p_stats->rx_undersize_packets += port_stats.pmm.rund;
-	p_stats->rx_fragments += port_stats.pmm.rfrg;
-	p_stats->tx_64_byte_packets += port_stats.pmm.t64;
-	p_stats->tx_65_to_127_byte_packets += port_stats.pmm.t127;
-	p_stats->tx_128_to_255_byte_packets += port_stats.pmm.t255;
-	p_stats->tx_256_to_511_byte_packets += port_stats.pmm.t511;
-	p_stats->tx_512_to_1023_byte_packets += port_stats.pmm.t1023;
-	p_stats->tx_1024_to_1518_byte_packets += port_stats.pmm.t1518;
-	p_stats->tx_1519_to_2047_byte_packets += port_stats.pmm.t2047;
-	p_stats->tx_2048_to_4095_byte_packets += port_stats.pmm.t4095;
-	p_stats->tx_4096_to_9216_byte_packets += port_stats.pmm.t9216;
-	p_stats->tx_9217_to_16383_byte_packets += port_stats.pmm.t16383;
-	p_stats->tx_pause_frames += port_stats.pmm.txpf;
-	p_stats->tx_pfc_frames += port_stats.pmm.txpp;
-	p_stats->tx_lpi_entry_count += port_stats.pmm.tlpiec;
-	p_stats->tx_total_collisions += port_stats.pmm.tncl;
-	p_stats->rx_mac_bytes += port_stats.pmm.rbyte;
-	p_stats->rx_mac_uc_packets += port_stats.pmm.rxuca;
-	p_stats->rx_mac_mc_packets += port_stats.pmm.rxmca;
-	p_stats->rx_mac_bc_packets += port_stats.pmm.rxbca;
-	p_stats->rx_mac_frames_ok += port_stats.pmm.rxpok;
-	p_stats->tx_mac_bytes += port_stats.pmm.tbyte;
-	p_stats->tx_mac_uc_packets += port_stats.pmm.txuca;
-	p_stats->tx_mac_mc_packets += port_stats.pmm.txmca;
-	p_stats->tx_mac_bc_packets += port_stats.pmm.txbca;
-	p_stats->tx_mac_ctrl_frames += port_stats.pmm.txcf;
+	p_stats->rx_64_byte_packets += port_stats.eth.r64;
+	p_stats->rx_65_to_127_byte_packets += port_stats.eth.r127;
+	p_stats->rx_128_to_255_byte_packets += port_stats.eth.r255;
+	p_stats->rx_256_to_511_byte_packets += port_stats.eth.r511;
+	p_stats->rx_512_to_1023_byte_packets += port_stats.eth.r1023;
+	p_stats->rx_1024_to_1518_byte_packets += port_stats.eth.r1518;
+	p_stats->rx_1519_to_1522_byte_packets += port_stats.eth.r1522;
+	p_stats->rx_1519_to_2047_byte_packets += port_stats.eth.r2047;
+	p_stats->rx_2048_to_4095_byte_packets += port_stats.eth.r4095;
+	p_stats->rx_4096_to_9216_byte_packets += port_stats.eth.r9216;
+	p_stats->rx_9217_to_16383_byte_packets += port_stats.eth.r16383;
+	p_stats->rx_crc_errors += port_stats.eth.rfcs;
+	p_stats->rx_mac_crtl_frames += port_stats.eth.rxcf;
+	p_stats->rx_pause_frames += port_stats.eth.rxpf;
+	p_stats->rx_pfc_frames += port_stats.eth.rxpp;
+	p_stats->rx_align_errors += port_stats.eth.raln;
+	p_stats->rx_carrier_errors += port_stats.eth.rfcr;
+	p_stats->rx_oversize_packets += port_stats.eth.rovr;
+	p_stats->rx_jabbers += port_stats.eth.rjbr;
+	p_stats->rx_undersize_packets += port_stats.eth.rund;
+	p_stats->rx_fragments += port_stats.eth.rfrg;
+	p_stats->tx_64_byte_packets += port_stats.eth.t64;
+	p_stats->tx_65_to_127_byte_packets += port_stats.eth.t127;
+	p_stats->tx_128_to_255_byte_packets += port_stats.eth.t255;
+	p_stats->tx_256_to_511_byte_packets += port_stats.eth.t511;
+	p_stats->tx_512_to_1023_byte_packets += port_stats.eth.t1023;
+	p_stats->tx_1024_to_1518_byte_packets += port_stats.eth.t1518;
+	p_stats->tx_1519_to_2047_byte_packets += port_stats.eth.t2047;
+	p_stats->tx_2048_to_4095_byte_packets += port_stats.eth.t4095;
+	p_stats->tx_4096_to_9216_byte_packets += port_stats.eth.t9216;
+	p_stats->tx_9217_to_16383_byte_packets += port_stats.eth.t16383;
+	p_stats->tx_pause_frames += port_stats.eth.txpf;
+	p_stats->tx_pfc_frames += port_stats.eth.txpp;
+	p_stats->tx_lpi_entry_count += port_stats.eth.tlpiec;
+	p_stats->tx_total_collisions += port_stats.eth.tncl;
+	p_stats->rx_mac_bytes += port_stats.eth.rbyte;
+	p_stats->rx_mac_uc_packets += port_stats.eth.rxuca;
+	p_stats->rx_mac_mc_packets += port_stats.eth.rxmca;
+	p_stats->rx_mac_bc_packets += port_stats.eth.rxbca;
+	p_stats->rx_mac_frames_ok += port_stats.eth.rxpok;
+	p_stats->tx_mac_bytes += port_stats.eth.tbyte;
+	p_stats->tx_mac_uc_packets += port_stats.eth.txuca;
+	p_stats->tx_mac_mc_packets += port_stats.eth.txmca;
+	p_stats->tx_mac_bc_packets += port_stats.eth.txbca;
+	p_stats->tx_mac_ctrl_frames += port_stats.eth.txcf;
 	for (j = 0; j < 8; j++) {
 		p_stats->brb_truncates += port_stats.brb.brb_truncate[j];
 		p_stats->brb_discards += port_stats.brb.brb_discard[j];
drivers/net/qede/base/ecore_mcp.c +6 -6
index 5002ee3..cf67fa1 100644
@@ -659,9 +659,9 @@ static void ecore_mcp_handle_transceiver_change(struct ecore_hwfn *p_hwfn,
 					    OFFSETOF(struct public_port,
 						     transceiver_data)));
 
-	transceiver_state = GET_FIELD(transceiver_state, PMM_TRANSCEIVER_STATE);
+	transceiver_state = GET_FIELD(transceiver_state, ETH_TRANSCEIVER_STATE);
 
-	if (transceiver_state == PMM_TRANSCEIVER_STATE_PRESENT)
+	if (transceiver_state == ETH_TRANSCEIVER_STATE_PRESENT)
 		DP_NOTICE(p_hwfn, false, "Transceiver is present.\n");
 	else
 		DP_NOTICE(p_hwfn, false, "Transceiver is unplugged.\n");
@@ -813,7 +813,7 @@ enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
 	struct ecore_mcp_link_params *params = &p_hwfn->mcp_info->link_input;
 	struct ecore_mcp_mb_params mb_params;
 	union drv_union_data union_data;
-	struct pmm_phy_cfg *p_phy_cfg;
+	struct eth_phy_cfg *p_phy_cfg;
 	enum _ecore_status_t rc = ECORE_SUCCESS;
 	u32 cmd;
 
@@ -828,9 +828,9 @@ enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
 	cmd = b_up ? DRV_MSG_CODE_INIT_PHY : DRV_MSG_CODE_LINK_RESET;
 	if (!params->speed.autoneg)
 		p_phy_cfg->speed = params->speed.forced_speed;
-	p_phy_cfg->pause |= (params->pause.autoneg) ? PMM_PAUSE_AUTONEG : 0;
-	p_phy_cfg->pause |= (params->pause.forced_rx) ? PMM_PAUSE_RX : 0;
-	p_phy_cfg->pause |= (params->pause.forced_tx) ? PMM_PAUSE_TX : 0;
+	p_phy_cfg->pause |= (params->pause.autoneg) ? ETH_PAUSE_AUTONEG : 0;
+	p_phy_cfg->pause |= (params->pause.forced_rx) ? ETH_PAUSE_RX : 0;
+	p_phy_cfg->pause |= (params->pause.forced_tx) ? ETH_PAUSE_TX : 0;
 	p_phy_cfg->adv_speed = params->speed.advertised_speeds;
 	p_phy_cfg->loopback_mode = params->loopback_mode;
 	p_hwfn->b_drv_link_init = b_up;
drivers/net/qede/base/mcp_public.h +89 -69

204 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#15 lore raw

PATCH v3 13/32 qede/base: comment enhancements

In reply to Rasesh Mody

Comment additions and modifications

---
 drivers/net/qede/base/ecore_dev_api.h      |   4 +-
 drivers/net/qede/base/ecore_gtt_reg_addr.h |  10 +
 drivers/net/qede/base/ecore_hsi_common.h   | 863 +++++++++++++++++++---------
 drivers/net/qede/base/ecore_hsi_eth.h      | 877 ++++++++++++++++++++++-------
 drivers/net/qede/base/ecore_hw_defs.h      |  33 +-
 drivers/net/qede/base/ecore_init_ops.h     |   6 +-
 drivers/net/qede/base/ecore_mcp.h          |  31 +-
 drivers/net/qede/base/ecore_sp_api.h       |   5 +-
 drivers/net/qede/base/eth_common.h         | 154 +++--
 drivers/net/qede/base/mcp_public.h         |  99 +++-
 10 files changed, 1519 insertions(+), 563 deletions(-)
drivers/net/qede/base/ecore_dev_api.h +2 -2
index e6924bd..1a810b5 100644
@@ -98,8 +98,8 @@ enum _ecore_status_t ecore_hw_stop(struct ecore_dev *p_dev);
 
 /**
  * @brief ecore_hw_stop_fastpath -should be called incase
- *        slowpath is still required for the device, but
- *        fastpath is not.
+ *        slowpath is still required for the device,
+ *        but fastpath is not.
  *
  * @param p_dev
  *
drivers/net/qede/base/ecore_gtt_reg_addr.h +10 -0
index 0eba1aa..6395b7c 100644
@@ -10,33 +10,43 @@
 #define GTT_REG_ADDR_H
 
 /* Win 2 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_IGU_CMD                                      0x00f000UL
 
 /* Win 3 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_TSDM_RAM                                     0x010000UL
 
 /* Win 4 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_MSDM_RAM                                     0x011000UL
 
 /* Win 5 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_MSDM_RAM_1024                                0x012000UL
 
 /* Win 6 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_USDM_RAM                                     0x013000UL
 
 /* Win 7 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_USDM_RAM_1024                                0x014000UL
 
 /* Win 8 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_USDM_RAM_2048                                0x015000UL
 
 /* Win 9 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_XSDM_RAM                                     0x016000UL
 
 /* Win 10 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_YSDM_RAM                                     0x017000UL
 
 /* Win 11 */
+/* Access:RW   DataWidth:0x20    Chips: BB_A0 BB_B0 K2 */
 #define GTT_BAR0_MAP_REG_PSDM_RAM                                     0x018000UL
 
 #endif
drivers/net/qede/base/ecore_hsi_common.h +583 -280

1,926 lines not on this page · raw message

drivers/net/qede/base/ecore_hsi_eth.h +668 -209

1,021 lines not on this page · raw message

drivers/net/qede/base/ecore_hw_defs.h +22 -11
index deb8e34..4456af4 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_init_ops.h +5 -1
index f6b0a2d..d58c7d6 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_mcp.h +21 -10
index 8a2c84c..64c639f 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/ecore_sp_api.h +4 -1
index 71e2359..a4cb507 100644

Lines of this file are not shown. View the raw message.

drivers/net/qede/base/eth_common.h +120 -34

154 lines not on this page · raw message

drivers/net/qede/base/mcp_public.h +84 -15

99 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.3.1

Part of the diff is not shown here. View the raw message.

#16 lore raw

PATCH v3 14/32 qede/base: add MFW crash dump support

In reply to Rasesh Mody

Add support for management firmware(MFW) crash dump collection.

---
 drivers/net/qede/base/ecore.h         |   3 +
 drivers/net/qede/base/ecore_dev.c     |  22 ++---
 drivers/net/qede/base/ecore_dev_api.h |  29 ++++---
 drivers/net/qede/base/ecore_mcp.c     | 151 ++++++++++++++++++++++++++++++++++
 drivers/net/qede/base/ecore_mcp.h     |  45 ++++++++++
 drivers/net/qede/base/ecore_mcp_api.h |  10 +++
 drivers/net/qede/qede_main.c          |  17 ++--
 7 files changed, 249 insertions(+), 28 deletions(-)
drivers/net/qede/base/ecore.h +3 -0
index 874c3a3..89e2bd0 100644
@@ -735,6 +735,9 @@ struct ecore_dev {
 
 	bool				attn_clr_en;
 
+	/* Indicates whether allowing the MFW to collect a crash dump */
+	bool				mdump_en;
+
 	/* Indicates if the reg_fifo is checked after any register access */
 	bool				chk_reg_fifo;
 
drivers/net/qede/base/ecore_dev.c +12 -10
index 319edeb..b530173 100644
@@ -1619,24 +1619,20 @@ static void ecore_reset_mb_shadow(struct ecore_hwfn *p_hwfn,
 }
 
 enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,
-				   struct ecore_tunn_start_params *p_tunn,
-				   bool b_hw_start,
-				   enum ecore_int_mode int_mode,
-				   bool allow_npar_tx_switch,
-				   const u8 *bin_fw_data)
+				   struct ecore_hw_init_params *p_params)
 {
 	enum _ecore_status_t rc, mfw_rc;
 	u32 load_code, param;
 	int i, j;
 
-	if ((int_mode == ECORE_INT_MODE_MSI) && (p_dev->num_hwfns > 1)) {
+	if (p_params->int_mode == ECORE_INT_MODE_MSI && p_dev->num_hwfns > 1) {
 		DP_NOTICE(p_dev, false,
 			  "MSI mode is not supported for CMT devices\n");
 		return ECORE_INVAL;
 	}
 
 	if (IS_PF(p_dev)) {
-		rc = ecore_init_fw_data(p_dev, bin_fw_data);
+		rc = ecore_init_fw_data(p_dev, p_params->bin_fw_data);
 		if (rc != ECORE_SUCCESS)
 			return rc;
 	}
@@ -1733,9 +1729,11 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,
 			/* Fall into */
 		case FW_MSG_CODE_DRV_LOAD_FUNCTION:
 			rc = ecore_hw_init_pf(p_hwfn, p_hwfn->p_main_ptt,
-					      p_tunn, p_hwfn->hw_info.hw_mode,
-					      b_hw_start, int_mode,
-					      allow_npar_tx_switch);
+					      p_params->p_tunn,
+					      p_hwfn->hw_info.hw_mode,
+					      p_params->b_hw_start,
+					      p_params->int_mode,
+					      p_params->allow_npar_tx_switch);
 			break;
 		default:
 			rc = ECORE_NOTIMPL;
@@ -1759,6 +1757,10 @@ enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,
 			return mfw_rc;
 		}
 
+		ecore_mcp_mdump_get_info(p_hwfn, p_hwfn->p_main_ptt);
+		ecore_mcp_mdump_set_values(p_hwfn, p_hwfn->p_main_ptt,
+					   p_params->epoch);
+
 		/* send DCBX attention request command */
 		DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
 			   "sending phony dcbx set command to trigger DCBx attention handling\n");
drivers/net/qede/base/ecore_dev_api.h +17 -12
index 1a810b5..042c0af 100644
@@ -57,26 +57,31 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev);
  */
 void ecore_resc_setup(struct ecore_dev *p_dev);
 
+struct ecore_hw_init_params {
+	/* tunnelling parameters */
+	struct ecore_tunn_start_params *p_tunn;
+	bool b_hw_start;
+	/* interrupt mode [msix, inta, etc.] to use */
+	enum ecore_int_mode int_mode;
+/* npar tx switching to be used for vports configured for tx-switching */
+
+	bool allow_npar_tx_switch;
+	/* binary fw data pointer in binary fw file */
+	const u8 *bin_fw_data;
+	/* the OS Epoch time in seconds */
+	u32 epoch;
+};
+
 /**
  * @brief ecore_hw_init -
  *
  * @param p_dev
- * @param p_tunn - tunneling parameters
- * @param b_hw_start
- * @param int_mode - interrupt mode [msix, inta, etc.] to use.
- * @param allow_npar_tx_switch - npar tx switching to be used
- *	  for vports configured for tx-switching.
- * @param bin_fw_data - binary fw data pointer in binary fw file.
- *			Pass NULL if not using binary fw file.
+ * @param p_params
  *
  * @return enum _ecore_status_t
  */
 enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,
-				   struct ecore_tunn_start_params *p_tunn,
-				   bool b_hw_start,
-				   enum ecore_int_mode int_mode,
-				   bool allow_npar_tx_switch,
-				   const u8 *bin_fw_data);
+				   struct ecore_hw_init_params *p_params);
 
 /**
  * @brief ecore_hw_timers_stop_all -
drivers/net/qede/base/ecore_mcp.c +151 -0

163 lines not on this page · raw message

drivers/net/qede/base/ecore_mcp.h +45 -0

51 lines not on this page · raw message

drivers/net/qede/base/ecore_mcp_api.h +10 -0
index ff4f1ca..c26b494 100644
@@ -792,4 +792,14 @@ enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
 					      struct ecore_ptt *p_ptt,
 					      u64 *num_events);
 
+/**
+ * @brief Sets whether a critical error notification from the MFW is acked, or
+ *        is it being ignored and thus allowing the MFW crash dump.
+ *
+ * @param p_dev
+ * @param mdump_enable
+ *
+ */
+void ecore_mcp_mdump_enable(struct ecore_dev *p_dev, bool mdump_enable);
+
 #endif
drivers/net/qede/qede_main.c +11 -6
index e4ef4f0..60655b7 100644
@@ -7,6 +7,7 @@
  */
 
 #include <limits.h>
+#include <time.h>
 #include <rte_alarm.h>
 
 #include "qede_ethdev.h"
@@ -221,6 +222,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	const uint8_t *data = NULL;
 	struct ecore_hwfn *hwfn;
 	struct ecore_mcp_drv_version drv_version;
+	struct ecore_hw_init_params hw_init_params;
 	struct qede_dev *qdev = (struct qede_dev *)edev;
 	int rc;
 #ifdef QED_ENC_SUPPORTED
@@ -259,7 +261,6 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	qed_start_iov_task(edev);
 #endif
 
-	/* Start the slowpath */
 #ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev))
 		data = (const uint8_t *)edev->firmware + sizeof(u32);
@@ -267,6 +268,8 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 
 	allow_npar_tx_switching = npar_tx_switching ? true : false;
 
+	/* Start the slowpath */
+	memset(&hw_init_params, 0, sizeof(hw_init_params));
 #ifdef QED_ENC_SUPPORTED
 	memset(&tunn_info, 0, sizeof(tunn_info));
 	tunn_info.tunn_mode |= 1 << QED_MODE_VXLAN_TUNN |
@@ -276,12 +279,14 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	tunn_info.tunn_clss_vxlan = QED_TUNN_CLSS_MAC_VLAN;
 	tunn_info.tunn_clss_l2gre = QED_TUNN_CLSS_MAC_VLAN;
 	tunn_info.tunn_clss_ipgre = QED_TUNN_CLSS_MAC_VLAN;
-	rc = ecore_hw_init(edev, &tunn_info, true, ECORE_INT_MODE_MSIX,
-			   allow_npar_tx_switching, data);
-#else
-	rc = ecore_hw_init(edev, NULL, true, ECORE_INT_MODE_MSIX,
-			   allow_npar_tx_switching, data);
+	hw_init_params.p_tunn = &tunn_info;
 #endif
+	hw_init_params.b_hw_start = true;
+	hw_init_params.int_mode = ECORE_INT_MODE_MSIX;
+	hw_init_params.allow_npar_tx_switch = allow_npar_tx_switching;
+	hw_init_params.bin_fw_data = data;
+	hw_init_params.epoch = (u32)time(NULL);
+	rc = ecore_hw_init(edev, &hw_init_params);
 	if (rc) {
 		DP_ERR(edev, "ecore_hw_init failed\n");
 		goto err2;
Signature · 1 line
1.8.3.1
#17 lore raw

PATCH v3 15/32 qede: enable support for unequal number of RX/TX queues

In reply to Rasesh Mody

From: Sony Chacko <[email protected]>

Previous release of the qede PMD had a limitation that the driver expects the number of tx and rx queues to be the same. This patch fixes this issue by making appropriate changes in control and data path.

Fixes 2ea6f76 ("qede: add core driver")
---
 doc/guides/nics/qede.rst       |   3 +-
 drivers/net/qede/qede_ethdev.c |  23 +--
 drivers/net/qede/qede_ethdev.h |  16 +-
 drivers/net/qede/qede_rxtx.c   | 376 ++++++++++++++++++++---------------------
 drivers/net/qede/qede_rxtx.h   |   7 +-
 5 files changed, 212 insertions(+), 213 deletions(-)
doc/guides/nics/qede.rst +1 -2
index df6fecc..5b921cc 100644
@@ -50,7 +50,7 @@ Supported Features
 - Jumbo frames (using single buffer)
 - VLAN offload - Filtering and stripping
 - Stateless checksum offloads (IPv4/TCP/UDP)
-- Multiple Rx/Tx queues (queue-pairs)
+- Multiple Rx/Tx queues
 - RSS (with user configurable table/key)
 - TSS
 - Multiple MAC address
@@ -63,7 +63,6 @@ Non-supported Features
 ----------------------
 
 - Scatter-Gather Rx/Tx frames
-- Unequal number of Rx/Tx queues
 - SR-IOV PF
 - Tunneling offloads
 - Reload of the PMD after a non-graceful termination
drivers/net/qede/qede_ethdev.c +9 -14
index 3b2d8ea..93cad91 100644
@@ -496,31 +496,26 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
-	if (eth_dev->data->nb_rx_queues != eth_dev->data->nb_tx_queues) {
-		DP_NOTICE(edev, false,
-			  "Unequal number of rx/tx queues "
-			  "is not supported RX=%u TX=%u\n",
-			  eth_dev->data->nb_rx_queues,
-			  eth_dev->data->nb_tx_queues);
-		return -EINVAL;
-	}
-
 	/* Check requirements for 100G mode */
 	if (edev->num_hwfns > 1) {
-		if (eth_dev->data->nb_rx_queues < 2) {
+		if (eth_dev->data->nb_rx_queues < 2 ||
+		    eth_dev->data->nb_tx_queues < 2) {
 			DP_NOTICE(edev, false,
-				  "100G mode requires minimum two queues\n");
+				  "100G mode needs min. 2 RX/TX queues\n");
 			return -EINVAL;
 		}
 
-		if ((eth_dev->data->nb_rx_queues % 2) != 0) {
+		if ((eth_dev->data->nb_rx_queues % 2 != 0) ||
+		    (eth_dev->data->nb_tx_queues % 2 != 0)) {
 			DP_NOTICE(edev, false,
-				  "100G mode requires even number of queues\n");
+				  "100G mode needs even no. of RX/TX queues\n");
 			return -EINVAL;
 		}
 	}
 
-	qdev->num_rss = eth_dev->data->nb_rx_queues;
+	qdev->fp_num_tx = eth_dev->data->nb_tx_queues;
+	qdev->fp_num_rx = eth_dev->data->nb_rx_queues;
+	qdev->num_queues = qdev->fp_num_tx + qdev->fp_num_rx;
 
 	/* Initial state */
 	qdev->state = QEDE_CLOSE;
drivers/net/qede/qede_ethdev.h +12 -4
index abb33af..1f62283 100644
@@ -62,8 +62,8 @@
 #define QEDE_MAX_TSS_CNT(edev)  ((edev)->dev_info.num_queues * \
 					(edev)->dev_info.num_tc)
 
-#define QEDE_RSS_CNT(edev)	((edev)->num_rss)
-#define QEDE_TSS_CNT(edev)	((edev)->num_rss * (edev)->num_tc)
+#define QEDE_RSS_CNT(edev)	((edev)->fp_num_rx)
+#define QEDE_TSS_CNT(edev)	((edev)->fp_num_rx * (edev)->num_tc)
 
 #define QEDE_DUPLEX_FULL	1
 #define QEDE_DUPLEX_HALF	2
@@ -76,6 +76,12 @@
 
 #define QEDE_INIT_EDEV(adapter) (&((struct qede_dev *)adapter)->edev)
 
+#define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues)
+#define QEDE_RSS_COUNT(qdev) ((qdev)->num_queues - (qdev)->fp_num_tx)
+#define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
+		(qdev)->num_tc)
+#define QEDE_TC_IDX(qdev, txqidx) ((txqidx) / QEDE_TSS_COUNT(qdev))
+
 #define QEDE_INIT(eth_dev) {					\
 	struct qede_dev *qdev = eth_dev->data->dev_private;	\
 	struct ecore_dev *edev = &qdev->edev;			\
@@ -138,8 +144,10 @@ struct qede_dev {
 	struct qed_update_vport_rss_params rss_params;
 	uint32_t flags;
 	bool gro_disable;
-	struct qede_rx_queue **rx_queues;
-	struct qede_tx_queue **tx_queues;
+	uint16_t num_queues;
+	uint8_t fp_num_tx;
+	uint8_t fp_num_rx;
+
 	enum dev_state state;
 
 	/* Vlans */
drivers/net/qede/qede_rxtx.c +186 -190

596 lines not on this page · raw message

drivers/net/qede/qede_rxtx.h +4 -3
index 90da603..a8520ed 100644
@@ -75,7 +75,7 @@
 
 #define MAX_NUM_TC		8
 
-#define for_each_rss(i) for (i = 0; i < qdev->num_rss; i++)
+#define for_each_queue(i) for (i = 0; i < qdev->num_queues; i++)
 
 /*
  * RX BD descriptor ring
@@ -139,7 +139,8 @@ struct qede_tx_queue {
 
 struct qede_fastpath {
 	struct qede_dev *qdev;
-	uint8_t rss_id;
+	u8 type;
+	uint8_t id;
 	struct ecore_sb_info *sb_info;
 	struct qede_rx_queue *rxq;
 	struct qede_tx_queue *txqs[MAX_NUM_TC];
@@ -168,7 +169,7 @@ int qede_dev_start(struct rte_eth_dev *eth_dev);
 
 void qede_dev_stop(struct rte_eth_dev *eth_dev);
 
-void qede_reset_fp_rings(struct qede_dev *qdev);
+int qede_reset_fp_rings(struct qede_dev *qdev);
 
 void qede_free_fp_arrays(struct qede_dev *qdev);
 
Signature · 1 line
1.8.3.1
#18 lore raw

PATCH v3 16/32 qede: fix port (re)configuration issue

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Some applications set port configuration params like promisc mode before calling dev_start(). This config results in a firmware exception since this operation internally translates to sending of VPORT-UPDATE before VPORT-START ramrod which is considered illegal from firmware standpoint. So the fix is to send VPORT-START ramrod sooner in dev_configure() rather than deferring it to dev_start(). This requires a bit of reshuffling in the code to move sending of VPORT-START from qede_start_queues() to qede_dev_configure() and VPORT-STOP from qede_stop_queues() to qede_dev_stop().

This sequence change also exposes a flaw in the port restart flows where the fastpath resource allocation routine qede_init_fp() fuctionalities need to be split, so that appropriate action is taken based on the current port state. Eg: Do not re-initialize the status block in a port restart case. This change ensures port start/stop can be paired.

A new port state QEDE_DEV_CONFIG is added to distinguish between port started from scratch vs port requiring a reconfig (like MTU). The function qede_config_rx_mode() is removed since the individual port config will be replayed anyways on a restart.

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/qede_eth_if.c |  14 ++-
 drivers/net/qede/qede_eth_if.h |   2 +
 drivers/net/qede/qede_ethdev.c | 130 ++++++++++++-----------
 drivers/net/qede/qede_ethdev.h |  12 +--
 drivers/net/qede/qede_rxtx.c   | 232 +++++++++++++++++++++--------------------
 drivers/net/qede/qede_rxtx.h   |   7 +-
 6 files changed, 208 insertions(+), 189 deletions(-)
drivers/net/qede/qede_eth_if.c +12 -2
index a00f05d..e108af1 100644
@@ -40,8 +40,6 @@ qed_start_vport(struct ecore_dev *edev, struct qed_start_vport_params *p_params)
 			return rc;
 		}
 
-		ecore_hw_start_fastpath(p_hwfn);
-
 		DP_VERBOSE(edev, ECORE_MSG_SPQ,
 			   "Started V-PORT %d with MTU %d\n",
 			   p_params->vport_id, p_params->mtu);
@@ -295,6 +293,17 @@ static int qed_fastpath_stop(struct ecore_dev *edev)
 	return 0;
 }
 
+static void qed_fastpath_start(struct ecore_dev *edev)
+{
+	struct ecore_hwfn *p_hwfn;
+	int i;
+
+	for_each_hwfn(edev, i) {
+		p_hwfn = &edev->hwfns[i];
+		ecore_hw_start_fastpath(p_hwfn);
+	}
+}
+
 static void
 qed_get_vport_stats(struct ecore_dev *edev, struct ecore_eth_stats *stats)
 {
@@ -444,6 +453,7 @@ static const struct qed_eth_ops qed_eth_ops_pass = {
 	INIT_STRUCT_FIELD(q_tx_stop, &qed_stop_txq),
 	INIT_STRUCT_FIELD(eth_cqe_completion, &qed_fp_cqe_completion),
 	INIT_STRUCT_FIELD(fastpath_stop, &qed_fastpath_stop),
+	INIT_STRUCT_FIELD(fastpath_start, &qed_fastpath_start),
 	INIT_STRUCT_FIELD(get_vport_stats, &qed_get_vport_stats),
 	INIT_STRUCT_FIELD(filter_config, &qed_configure_filter),
 };
drivers/net/qede/qede_eth_if.h +2 -0
index 26968eb..299a2aa 100644
@@ -158,6 +158,8 @@ struct qed_eth_ops {
 
 	int (*fastpath_stop)(struct ecore_dev *edev);
 
+	void (*fastpath_start)(struct ecore_dev *edev);
+
 	void (*get_vport_stats)(struct ecore_dev *edev,
 				struct ecore_eth_stats *stats);
 
drivers/net/qede/qede_ethdev.c +64 -66

191 lines not on this page · raw message

drivers/net/qede/qede_ethdev.h +6 -6
index 1f62283..f0bb720 100644
@@ -109,10 +109,11 @@
 extern char fw_file[];
 
 /* Port/function states */
-enum dev_state {
-	QEDE_START,
-	QEDE_STOP,
-	QEDE_CLOSE
+enum qede_dev_state {
+	QEDE_DEV_INIT, /* Init the chip and Slowpath */
+	QEDE_DEV_CONFIG, /* Create Vport/Fastpath resources */
+	QEDE_DEV_START, /* Start RX/TX queues, enable traffic */
+	QEDE_DEV_STOP, /* Deactivate vport and stop traffic */
 };
 
 struct qed_int_param {
@@ -148,7 +149,7 @@ struct qede_dev {
 	uint8_t fp_num_tx;
 	uint8_t fp_num_rx;
 
-	enum dev_state state;
+	enum qede_dev_state state;
 
 	/* Vlans */
 	osal_list_t vlan_list;
@@ -165,6 +166,5 @@ struct qede_dev {
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);
-void qede_config_rx_mode(struct rte_eth_dev *eth_dev);
 
 #endif /* _QEDE_ETHDEV_H_ */
drivers/net/qede/qede_rxtx.c +118 -114

381 lines not on this page · raw message

drivers/net/qede/qede_rxtx.h +6 -1
index a8520ed..9ee69ed 100644
@@ -173,7 +173,7 @@ int qede_reset_fp_rings(struct qede_dev *qdev);
 
 void qede_free_fp_arrays(struct qede_dev *qdev);
 
-void qede_free_mem_load(struct qede_dev *qdev);
+void qede_free_mem_load(struct rte_eth_dev *eth_dev);
 
 uint16_t qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts,
 			uint16_t nb_pkts);
@@ -181,4 +181,9 @@ uint16_t qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts,
 uint16_t qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts,
 			uint16_t nb_pkts);
 
+/* Fastpath resource alloc/dealloc helpers */
+int qede_alloc_fp_resc(struct qede_dev *qdev);
+
+void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev);
+
 #endif /* _QEDE_RXTX_H_ */
Signature · 1 line
1.8.3.1
#19 lore raw

PATCH v3 17/32 qede/base: allow MTU change via vport-update

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Add support to allow MTU change on a deactivated vport in the qede/base driver and the core driver shall utilize the same.

---
 drivers/net/qede/base/ecore_l2.c     | 5 +++++
 drivers/net/qede/base/ecore_l2_api.h | 4 ++++
 drivers/net/qede/qede_eth_if.c       | 1 +
 drivers/net/qede/qede_eth_if.h       | 1 +
 drivers/net/qede/qede_rxtx.c         | 2 ++
 5 files changed, 13 insertions(+)
drivers/net/qede/base/ecore_l2.c +5 -0
index 5a38ad2..83a62e0 100644
@@ -427,6 +427,11 @@ ecore_sp_vport_update(struct ecore_hwfn *p_hwfn,
 	ecore_sp_update_accept_mode(p_hwfn, p_ramrod, p_params->accept_flags);
 	ecore_sp_vport_update_sge_tpa(p_hwfn, p_ramrod,
 				      p_params->sge_tpa_params);
+	if (p_params->mtu) {
+		p_ramrod->common.update_mtu_flg = 1;
+		p_ramrod->common.mtu = OSAL_CPU_TO_LE16(p_params->mtu);
+	}
+
 	return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
 }
 
drivers/net/qede/base/ecore_l2_api.h +4 -0
index 09688eb..447d1fb 100644
@@ -322,6 +322,10 @@ struct ecore_sp_vport_update_params {
 	struct ecore_rss_params	*rss_params;
 	struct ecore_filter_accept_flags accept_flags;
 	struct ecore_sge_tpa_params *sge_tpa_params;
+	/* MTU change - notice this requires the vport to be disabled.
+	 * If non-zero, value would be used.
+	 */
+	u16 mtu;
 };
 
 /**
drivers/net/qede/qede_eth_if.c +1 -0
index e108af1..9855d0e 100644
@@ -92,6 +92,7 @@ qed_update_vport(struct ecore_dev *edev, struct qed_update_vport_params *params)
 	sp_params.accept_any_vlan = params->accept_any_vlan;
 	sp_params.update_accept_any_vlan_flg =
 	    params->update_accept_any_vlan_flg;
+	sp_params.mtu = params->mtu;
 
 	/* RSS - is a bit tricky, since upper-layer isn't familiar with hwfns.
 	 * We need to re-fix the rss values per engine for CMT.
drivers/net/qede/qede_eth_if.h +1 -0
index 299a2aa..7840a37 100644
@@ -75,6 +75,7 @@ struct qed_update_vport_params {
 	uint8_t accept_any_vlan;
 	uint8_t update_rss_flg;
 	struct qed_update_vport_rss_params rss_params;
+	uint16_t mtu;
 };
 
 struct qed_start_vport_params {
drivers/net/qede/qede_rxtx.c +2 -0
index e3409a9..6973d1c 100644
@@ -650,6 +650,8 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
 
 	/* Prepare and send the vport enable */
 	memset(&vport_update_params, 0, sizeof(vport_update_params));
+	/* Update MTU via vport update */
+	vport_update_params.mtu = qdev->mtu;
 	vport_update_params.vport_id = 0;
 	vport_update_params.update_vport_active_flg = 1;
 	vport_update_params.vport_active_flg = 1;
Signature · 1 line
1.8.3.1
#20 lore raw

PATCH v3 18/32 qede: add missing 100G link speed capability

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

This patch fixes the missing 100G link speed advertisement when the 100G support was initially added.

Fixes 2af14ca ("net/qede: support 100G")

---
 doc/guides/nics/features/qede.ini    | 1 +
 doc/guides/nics/features/qede_vf.ini | 1 +
 drivers/net/qede/qede_ethdev.c       | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)
doc/guides/nics/features/qede.ini +1 -0
index 7690773..1d28a23 100644
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 MTU update           = Y
doc/guides/nics/features/qede_vf.ini +1 -0
index aeb20d2..b4eba0c 100644
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 MTU update           = Y
drivers/net/qede/qede_ethdev.c +2 -1
index deb1a30..ffce2dd 100644
@@ -599,7 +599,8 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 				     DEV_TX_OFFLOAD_UDP_CKSUM |
 				     DEV_TX_OFFLOAD_TCP_CKSUM);
 
-	dev_info->speed_capa = ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G;
+	dev_info->speed_capa = ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G |
+			       ETH_LINK_SPEED_100G;
 }
 
 /* return 0 means link status changed, -1 means not changed */
Signature · 1 line
1.8.3.1
#21 lore raw

PATCH v3 19/32 qede: remove unused/dead code

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/base/ecore_iov_api.h | 312 ----------------------------------
 drivers/net/qede/qede_eth_if.c        |  10 --
 drivers/net/qede/qede_ethdev.c        |   3 -
 drivers/net/qede/qede_ethdev.h        |  12 --
 drivers/net/qede/qede_if.h            |   9 -
 5 files changed, 346 deletions(-)
drivers/net/qede/base/ecore_iov_api.h +0 -312
index 14f3f47..bb8df82 100644
@@ -680,318 +680,6 @@ int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid);
  */
 enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev,
 						     int vfid, u32 rate);
-#else
-static OSAL_INLINE void ecore_iov_set_vfs_to_disable(struct ecore_hwfn *p_hwfn,
-						     u8 to_disable)
-{
-}
-
-static OSAL_INLINE void ecore_iov_set_vf_to_disable(struct ecore_hwfn *p_hwfn,
-						    u16 rel_vf_id,
-						    u8 to_disable)
-{
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_init_hw_for_vf(struct
-								 ecore_hwfn
-								 * p_hwfn,
-								 struct
-								 ecore_ptt
-								 * p_ptt,
-								 u16 rel_vf_id,
-								 u16
-								 num_rx_queues)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE void ecore_iov_process_mbx_req(struct ecore_hwfn *p_hwfn,
-						  struct ecore_ptt *p_ptt,
-						  int vfid)
-{
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_release_hw_for_vf(struct
-								    ecore_hwfn
-								    * p_hwfn,
-								    struct
-								    ecore_ptt
-								    * p_ptt,
-								    u16
-								    rel_vf_id)
-{
-	return ECORE_SUCCESS;
-}
-
-#ifndef LINUX_REMOVE
-static OSAL_INLINE enum _ecore_status_t ecore_iov_set_vf_ctx(struct ecore_hwfn
-							     *p_hwfn, u16 vf_id,
-							     void *ctx)
-{
-	return ECORE_INVAL;
-}
-#endif
-static OSAL_INLINE enum _ecore_status_t ecore_iov_vf_flr_cleanup(struct
-								 ecore_hwfn
-								 * p_hwfn,
-								 struct
-								 ecore_ptt
-								 * p_ptt)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_single_vf_flr_cleanup(
-	struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, u16 rel_vf_id)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE void ecore_iov_set_link(struct ecore_hwfn *p_hwfn, u16 vfid,
-					   struct ecore_mcp_link_params *params,
-					   struct ecore_mcp_link_state *link,
-					   struct ecore_mcp_link_capabilities
-					   *p_caps)
-{
-}
-
-static OSAL_INLINE void ecore_iov_get_link(struct ecore_hwfn *p_hwfn, u16 vfid,
-					   struct ecore_mcp_link_params *params,
-					   struct ecore_mcp_link_state *link,
-					   struct ecore_mcp_link_capabilities
-					   *p_caps)
-{
-}
-
-static OSAL_INLINE bool ecore_iov_is_vf_pending_flr(struct ecore_hwfn *p_hwfn,
-						    u16 rel_vf_id)
-{
-	return false;
-}
-
-static OSAL_INLINE bool ecore_iov_is_valid_vfid(struct ecore_hwfn *p_hwfn,
-						int rel_vf_id,
-						bool b_enabled_only)
-{
-	return false;
-}
-
-static OSAL_INLINE struct ecore_public_vf_info *
-	ecore_iov_get_public_vf_info(struct ecore_hwfn *p_hwfn, u16 vfid,
-				  bool b_enabled_only)
-{
-	return OSAL_NULL;
-}
-
-static OSAL_INLINE void ecore_iov_pf_add_pending_events(struct ecore_hwfn
-							*p_hwfn, u8 vfid)
-{
-}
-
-static OSAL_INLINE void ecore_iov_pf_get_and_clear_pending_events(struct
-								  ecore_hwfn
-								  * p_hwfn,
-								  u64 *events)
-{
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_copy_vf_msg(struct ecore_hwfn
-							      *p_hwfn,
-							      struct ecore_ptt
-							      *ptt, int vfid)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE void ecore_iov_bulletin_set_forced_mac(struct ecore_hwfn
-							  *p_hwfn, u8 *mac,
-							  int vfid)
-{
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_bulletin_set_mac(struct
-								   ecore_hwfn
-								   * p_hwfn,
-								   u8 *mac,
-								   int vfid)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE void ecore_iov_bulletin_set_forced_vlan(struct ecore_hwfn
-							   p_hwfn, u16 pvid,
-							   int vfid)
-{
-}
-
-static OSAL_INLINE void ecore_iov_get_vfs_opaque_fid(struct ecore_hwfn *p_hwfn,
-						     int vfid, u16 *opaque_fid)
-{
-}
-
-static OSAL_INLINE void ecore_iov_get_vfs_vport_id(struct ecore_hwfn *p_hwfn,
-						   int vfid, u8 *p_vport_id)
-{
-}
-
-static OSAL_INLINE bool ecore_iov_vf_has_vport_instance(struct ecore_hwfn
-							*p_hwfn, int vfid)
-{
-	return false;
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_post_vf_bulletin(struct
-								   ecore_hwfn
-								   * p_hwfn,
-								   int vfid,
-								   struct
-								   ecore_ptt
-								   * p_ptt)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE bool ecore_iov_is_vf_stopped(struct ecore_hwfn *p_hwfn,
-						int vfid)
-{
-	return false;
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_spoofchk_set(struct ecore_hwfn
-							       *p_hwfn,
-							       int vfid,
-							       bool val)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE bool ecore_iov_spoofchk_get(struct ecore_hwfn *p_hwfn,
-					       int vfid)
-{
-	return false;
-}
-
-static OSAL_INLINE bool ecore_iov_pf_sanity_check(struct ecore_hwfn *p_hwfn,
-						  int vfid)
-{
-	return false;
-}
-
-static OSAL_INLINE u8 ecore_iov_vf_chains_per_pf(struct ecore_hwfn *p_hwfn)
-{
-	return 0;
-}
-
-static OSAL_INLINE void ecore_iov_get_vf_req_virt_mbx_params(struct ecore_hwfn
-							     *p_hwfn,
-							     u16 rel_vf_id,
-							     void
-							     **pp_req_virt_addr,
-							     u16 *
-							     p_req_virt_size)
-{
-}
-
-static OSAL_INLINE void ecore_iov_get_vf_reply_virt_mbx_params(struct ecore_hwfn
-							       *p_hwfn,
-							       u16 rel_vf_id,
-							       void
-						       **pp_reply_virt_addr,
-							       u16 *
-						       p_reply_virt_size)
-{
-}
-
-static OSAL_INLINE bool ecore_iov_is_valid_vfpf_msg_length(u32 length)
-{
-	return false;
-}
-
-static OSAL_INLINE u32 ecore_iov_pfvf_msg_length(void)
-{
-	return 0;
-}
-
-static OSAL_INLINE u8 *ecore_iov_bulletin_get_forced_mac(struct ecore_hwfn
-							 *p_hwfn, u16 rel_vf_id)
-{
-	return OSAL_NULL;
-}
-
-static OSAL_INLINE u16 ecore_iov_bulletin_get_forced_vlan(struct ecore_hwfn
-							  *p_hwfn,
-							  u16 rel_vf_id)
-{
-	return 0;
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_tx_rate(struct
-								    ecore_hwfn
-								    * p_hwfn,
-								    struct
-								    ecore_ptt
-								    * p_ptt,
-								    int vfid,
-								    int val)
-{
-	return ECORE_INVAL;
-}
-
-static OSAL_INLINE u8 ecore_iov_get_vf_num_rxqs(struct ecore_hwfn *p_hwfn,
-						u16 rel_vf_id)
-{
-	return 0;
-}
-
-static OSAL_INLINE u8 ecore_iov_get_vf_num_active_rxqs(struct ecore_hwfn
-						       *p_hwfn, u16 rel_vf_id)
-{
-	return 0;
-}
-
-static OSAL_INLINE void *ecore_iov_get_vf_ctx(struct ecore_hwfn *p_hwfn,
-					      u16 rel_vf_id)
-{
-	return OSAL_NULL;
-}
-
-static OSAL_INLINE u8 ecore_iov_get_vf_num_sbs(struct ecore_hwfn *p_hwfn,
-					       u16 rel_vf_id)
-{
-	return 0;
-}
-
-static OSAL_INLINE bool ecore_iov_is_vf_wait_for_acquire(struct ecore_hwfn
-							 *p_hwfn, u16 rel_vf_id)
-{
-	return false;
-}
-
-static OSAL_INLINE bool ecore_iov_is_vf_acquired_not_initialized(struct
-								 ecore_hwfn
-								 * p_hwfn,
-								 u16 rel_vf_id)
-{
-	return false;
-}
-
-static OSAL_INLINE bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn,
-						    u16 rel_vf_id)
-{
-	return false;
-}
-
-static OSAL_INLINE int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn,
-						 int vfid)
-{
-	return 0;
-}
-
-static OSAL_INLINE enum _ecore_status_t ecore_iov_configure_min_tx_rate(
-	struct ecore_dev *p_dev, int vfid, u32 rate)
-{
-	return ECORE_INVAL;
-}
 #endif
 
 /**
drivers/net/qede/qede_eth_if.c +0 -10
index 9855d0e..bf41390 100644
@@ -459,16 +459,6 @@ static const struct qed_eth_ops qed_eth_ops_pass = {
 	INIT_STRUCT_FIELD(filter_config, &qed_configure_filter),
 };
 
-uint32_t qed_get_protocol_version(enum qed_protocol protocol)
-{
-	switch (protocol) {
-	case QED_PROTOCOL_ETH:
-		return QED_ETH_INTERFACE_VERSION;
-	default:
-		return 0;
-	}
-}
-
 const struct qed_eth_ops *qed_get_eth_ops(void)
 {
 	return &qed_eth_ops_pass;
drivers/net/qede/qede_ethdev.c +0 -3
index ffce2dd..ebfc83e 100644
@@ -1217,7 +1217,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	struct ecore_dev *edev;
 	struct qed_dev_eth_info dev_info;
 	struct qed_slowpath_params params;
-	uint32_t qed_ver;
 	static bool do_once = true;
 	uint8_t bulletin_change;
 	uint8_t vf_mac[ETHER_ADDR_LEN];
@@ -1253,8 +1252,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
-	qed_ver = qed_get_protocol_version(QED_PROTOCOL_ETH);
-
 	qed_ops = qed_get_eth_ops();
 	if (!qed_ops) {
 		DP_ERR(edev, "Failed to get qed_eth_ops_pass\n");
drivers/net/qede/qede_ethdev.h +0 -12
index f0bb720..f2e908c 100644
@@ -116,18 +116,6 @@ enum qede_dev_state {
 	QEDE_DEV_STOP, /* Deactivate vport and stop traffic */
 };
 
-struct qed_int_param {
-	uint32_t int_mode;
-	uint8_t num_vectors;
-	uint8_t min_msix_cnt;
-};
-
-struct qed_int_params {
-	struct qed_int_param in;
-	struct qed_int_param out;
-	bool fp_initialized;
-};
-
 /*
  *  Structure to store private data for each port.
  */
drivers/net/qede/qede_if.h +0 -9
index 1b05ff8..935eed8 100644
@@ -152,13 +152,4 @@ struct qed_common_ops {
 			      uint32_t dp_module, uint8_t dp_level);
 };
 
-/**
- * @brief qed_get_protocol_version
- *
- * @param protocol
- *
- * @return version supported by qed for given protocol driver
- */
-uint32_t qed_get_protocol_version(enum qed_protocol protocol);
-
 #endif /* _QEDE_IF_H */
Signature · 1 line
1.8.3.1
#22 lore raw

PATCH v3 20/32 qede: fixes for VLAN filters

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

fix to prevent duplicate VLAN filters:

librte_ether does not keep track of VLAN filters configured, so it becomes driver's responsibility to keep track of it and prevent duplicate filter programming. The fix is to use a singly linked list for tracking the entries and there by prevent duplicates.

fix num vlan filters:

Fix num vlan filter when filling ethernet device infoformation.

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/qede_eth_if.h |  2 +-
 drivers/net/qede/qede_ethdev.c | 67 ++++++++++++++++++++++++++++++++++--------
 drivers/net/qede/qede_ethdev.h | 15 +++++-----
 drivers/net/qede/qede_main.c   | 10 +++++--
 4 files changed, 71 insertions(+), 23 deletions(-)
drivers/net/qede/qede_eth_if.h +1 -1
index 7840a37..5a7fdc9 100644
@@ -46,7 +46,7 @@ struct qed_dev_eth_info {
 	uint8_t num_tc;
 
 	struct ether_addr port_mac;
-	uint8_t num_vlan_filters;
+	uint16_t num_vlan_filters;
 	uint32_t num_mac_addrs;
 };
 
drivers/net/qede/qede_ethdev.c +54 -13

98 lines not on this page · raw message

drivers/net/qede/qede_ethdev.h +8 -7
index f2e908c..ed2d41c 100644
@@ -10,6 +10,8 @@
 #ifndef _QEDE_ETHDEV_H_
 #define _QEDE_ETHDEV_H_
 
+#include <sys/queue.h>
+
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_dev.h>
@@ -116,6 +118,11 @@ enum qede_dev_state {
 	QEDE_DEV_STOP, /* Deactivate vport and stop traffic */
 };
 
+struct qede_vlan_entry {
+	SLIST_ENTRY(qede_vlan_entry) list;
+	uint16_t vid;
+};
+
 /*
  *  Structure to store private data for each port.
  */
@@ -136,16 +143,10 @@ struct qede_dev {
 	uint16_t num_queues;
 	uint8_t fp_num_tx;
 	uint8_t fp_num_rx;
-
 	enum qede_dev_state state;
-
-	/* Vlans */
-	osal_list_t vlan_list;
+	SLIST_HEAD(vlan_list_head, qede_vlan_entry)vlan_list_head;
 	uint16_t configured_vlans;
-	uint16_t non_configured_vlans;
 	bool accept_any_vlan;
-	uint16_t vxlan_dst_port;
-
 	struct ether_addr primary_mac;
 	bool handle_hw_err;
 	char drv_ver[QED_DRV_VER_STR_SIZE];
drivers/net/qede/qede_main.c +8 -2
index 60655b7..c83893d 100644
@@ -391,12 +391,18 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 	info->num_tc = 1 /* @@@TBD aelior MULTI_COS */;
 
 	if (IS_PF(edev)) {
+		int max_vf_vlan_filters = 0;
+
 		info->num_queues = 0;
 		for_each_hwfn(edev, i)
 			info->num_queues +=
 			FEAT_NUM(&edev->hwfns[i], ECORE_PF_L2_QUE);
 
-		info->num_vlan_filters = RESC_NUM(&edev->hwfns[0], ECORE_VLAN);
+		if (edev->p_iov_info)
+			max_vf_vlan_filters = edev->p_iov_info->total_vfs *
+					      ECORE_ETH_VF_NUM_VLAN_FILTERS;
+		info->num_vlan_filters = RESC_NUM(&edev->hwfns[0], ECORE_VLAN) -
+					 max_vf_vlan_filters;
 
 		rte_memcpy(&info->port_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
 			   ETHER_ADDR_LEN);
@@ -404,7 +410,7 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 		ecore_vf_get_num_rxqs(&edev->hwfns[0], &info->num_queues);
 
 		ecore_vf_get_num_vlan_filters(&edev->hwfns[0],
-					      &info->num_vlan_filters);
+					      (u8 *)&info->num_vlan_filters);
 
 		ecore_vf_get_port_mac(&edev->hwfns[0],
 				      (uint8_t *)&info->port_mac);
Signature · 1 line
1.8.3.1
#23 lore raw

PATCH v3 21/32 qede: add enable/disable VLAN filtering

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

The device doesn't explicitly support enable/disable of VLAN filtering. However, VLAN filtering takes effect when a matching VLAN is configured. So in order to support enable/disable of VLAN filtering, VLAN 0 is added/removed respectively. A check is added to ensure that the user removes all the configured VLANs before disabling VLAN filtering.

Also VLAN offloads shall be enabled by default and vlan_tci_outer is to set to 0 for Q-in-Q packets.

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/qede_ethdev.c | 35 ++++++++++++++++++++++++++++++++---
 drivers/net/qede/qede_ethdev.h |  4 ++++
 drivers/net/qede/qede_rxtx.c   |  1 +
 3 files changed, 37 insertions(+), 3 deletions(-)
drivers/net/qede/qede_ethdev.c +32 -3
index c72d02f..a376f88 100644
@@ -372,16 +372,40 @@ static void qede_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+	struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
 
 	if (mask & ETH_VLAN_STRIP_MASK) {
-		if (eth_dev->data->dev_conf.rxmode.hw_vlan_strip)
+		if (rxmode->hw_vlan_strip)
 			(void)qede_vlan_stripping(eth_dev, 1);
 		else
 			(void)qede_vlan_stripping(eth_dev, 0);
 	}
 
-	DP_INFO(edev, "vlan offload mask %d vlan-strip %d\n",
-		mask, eth_dev->data->dev_conf.rxmode.hw_vlan_strip);
+	if (mask & ETH_VLAN_FILTER_MASK) {
+		/* VLAN filtering kicks in when a VLAN is added */
+		if (rxmode->hw_vlan_filter) {
+			qede_vlan_filter_set(eth_dev, 0, 1);
+		} else {
+			if (qdev->configured_vlans > 1) { /* Excluding VLAN0 */
+				DP_NOTICE(edev, false,
+				  " Please remove existing VLAN filters"
+				  " before disabling VLAN filtering\n");
+				/* Signal app that VLAN filtering is still
+				 * enabled
+				 */
+				rxmode->hw_vlan_filter = true;
+			} else {
+				qede_vlan_filter_set(eth_dev, 0, 0);
+			}
+		}
+	}
+
+	if (mask & ETH_VLAN_EXTEND_MASK)
+		DP_INFO(edev, "No offloads are supported with VLAN Q-in-Q"
+			" and classification is based on outer tag only\n");
+
+	DP_INFO(edev, "vlan offload mask %d vlan-strip %d vlan-filter %d\n",
+		mask, rxmode->hw_vlan_strip, rxmode->hw_vlan_filter);
 }
 
 static int qede_set_ucast_rx_vlan(struct qede_dev *qdev,
@@ -584,6 +608,11 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 	if (IS_PF(edev))
 		qede_mac_addr_set(eth_dev, &qdev->primary_mac);
 
+	/* Enable VLAN offloads by default */
+	qede_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK  |
+				       ETH_VLAN_FILTER_MASK |
+				       ETH_VLAN_EXTEND_MASK);
+
 	qdev->state = QEDE_DEV_CONFIG;
 
 	return 0;
drivers/net/qede/qede_ethdev.h +4 -0
index ed2d41c..526d3be 100644
@@ -152,6 +152,10 @@ struct qede_dev {
 	char drv_ver[QED_DRV_VER_STR_SIZE];
 };
 
+/* Static functions */
+static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
+				uint16_t vlan_id, int on);
+
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);
drivers/net/qede/qede_rxtx.c +1 -0
index 6973d1c..9df0d133 100644
@@ -945,6 +945,7 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 			 */
 			rx_mb->vlan_tci = rte_le_to_cpu_16(fp_cqe->vlan_tag);
 			rx_mb->ol_flags |= PKT_RX_QINQ_PKT;
+			rx_mb->vlan_tci_outer = 0;
 		}
 
 		rx_pkts[rx_pkt] = rx_mb;
Signature · 1 line
1.8.3.1
#24 lore raw

PATCH v3 22/32 qede: fix RSS related issues

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

This patch contains few RSS related changes as follows:

o Fix inadvarent initializing of rss_params outside of the if block in qed_update_vport() which could cause FW exception.

o Fix disabling of RSS when hash function is 0.

o Rename qede_config_rss() to qede_check_vport_rss_enable() for better clarity.

o Avoid code duplication using a helper function
qede_init_rss_caps().

Fixes 4c98f27 ("qede: support RSS hash configuration")
Fixes 2ea6f76 ("qede: add core driver")
---
 doc/guides/nics/qede.rst       |  2 +-
 drivers/net/qede/qede_eth_if.c |  2 +-
 drivers/net/qede/qede_ethdev.c | 77 +++++++++++++++++++++---------------
 drivers/net/qede/qede_ethdev.h | 23 ++++++-----
 drivers/net/qede/qede_rxtx.c   | 88 +++++++++++++++++-------------------------
 5 files changed, 97 insertions(+), 95 deletions(-)
doc/guides/nics/qede.rst +1 -1
index 5b921cc..5e31c11 100644
@@ -51,7 +51,7 @@ Supported Features
 - VLAN offload - Filtering and stripping
 - Stateless checksum offloads (IPv4/TCP/UDP)
 - Multiple Rx/Tx queues
-- RSS (with user configurable table/key)
+- RSS (with RETA/hash table/key)
 - TSS
 - Multiple MAC address
 - Default pause flow control
drivers/net/qede/qede_eth_if.c +1 -1
index bf41390..a19b22e 100644
@@ -143,8 +143,8 @@ qed_update_vport(struct ecore_dev *edev, struct qed_update_vport_params *params)
 		       ECORE_RSS_IND_TABLE_SIZE * sizeof(uint16_t));
 		rte_memcpy(sp_rss_params.rss_key, params->rss_params.rss_key,
 		       ECORE_RSS_KEY_SIZE * sizeof(uint32_t));
+		sp_params.rss_params = &sp_rss_params;
 	}
-	sp_params.rss_params = &sp_rss_params;
 
 	for_each_hwfn(edev, i) {
 		struct ecore_hwfn *p_hwfn = &edev->hwfns[i];
drivers/net/qede/qede_ethdev.c +45 -32

139 lines not on this page · raw message

drivers/net/qede/qede_ethdev.h +14 -9
index 526d3be..5838f33 100644
@@ -64,8 +64,10 @@
 #define QEDE_MAX_TSS_CNT(edev)  ((edev)->dev_info.num_queues * \
 					(edev)->dev_info.num_tc)
 
-#define QEDE_RSS_CNT(edev)	((edev)->fp_num_rx)
-#define QEDE_TSS_CNT(edev)	((edev)->fp_num_rx * (edev)->num_tc)
+#define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues)
+#define QEDE_RSS_COUNT(qdev) ((qdev)->num_queues - (qdev)->fp_num_tx)
+#define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
+					(qdev)->num_tc)
 
 #define QEDE_DUPLEX_FULL	1
 #define QEDE_DUPLEX_HALF	2
@@ -78,12 +80,6 @@
 
 #define QEDE_INIT_EDEV(adapter) (&((struct qede_dev *)adapter)->edev)
 
-#define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues)
-#define QEDE_RSS_COUNT(qdev) ((qdev)->num_queues - (qdev)->fp_num_tx)
-#define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
-		(qdev)->num_tc)
-#define QEDE_TC_IDX(qdev, txqidx) ((txqidx) / QEDE_TSS_COUNT(qdev))
-
 #define QEDE_INIT(eth_dev) {					\
 	struct qede_dev *qdev = eth_dev->data->dev_private;	\
 	struct ecore_dev *edev = &qdev->edev;			\
@@ -133,7 +129,6 @@ struct qede_dev {
 	struct qed_dev_eth_info dev_info;
 	struct ecore_sb_info *sb_array;
 	struct qede_fastpath *fp_array;
-	uint16_t num_rss;
 	uint8_t num_tc;
 	uint16_t mtu;
 	bool rss_enabled;
@@ -156,6 +151,16 @@ struct qede_dev {
 static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
 				uint16_t vlan_id, int on);
 
+static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
+				struct rte_eth_rss_conf *rss_conf);
+
+static int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
+				struct rte_eth_rss_reta_entry64 *reta_conf,
+				uint16_t reta_size);
+
+/* Non-static functions */
+void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf);
+
 int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);
drivers/net/qede/qede_rxtx.c +36 -52

179 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#25 lore raw

PATCH v3 23/32 qede: add scatter gather support

In reply to Rasesh Mody

From: Sony Chacko <[email protected]>

Add scatter gather support to enable transmit and receive of larger packets.

---
 doc/guides/nics/features/qede.ini    |   1 +
 doc/guides/nics/features/qede_vf.ini |   1 +
 doc/guides/nics/qede.rst             |   4 +-
 drivers/net/qede/qede_ethdev.c       |  19 ++--
 drivers/net/qede/qede_rxtx.c         | 204 ++++++++++++++++++++++++++++-------
 drivers/net/qede/qede_rxtx.h         |   3 -
 6 files changed, 177 insertions(+), 55 deletions(-)
doc/guides/nics/features/qede.ini +1 -0
index 1d28a23..7d75030 100644
@@ -9,6 +9,7 @@ Link status          = Y
 Link status event    = Y
 MTU update           = Y
 Jumbo frame          = Y
+Scattered Rx         = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
 Unicast MAC filter   = Y
doc/guides/nics/features/qede_vf.ini +1 -0
index b4eba0c..acb1b99 100644
@@ -9,6 +9,7 @@ Link status          = Y
 Link status event    = Y
 MTU update           = Y
 Jumbo frame          = Y
+Scattered Rx         = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
 Unicast MAC filter   = Y
doc/guides/nics/qede.rst +2 -2
index 5e31c11..2a585e7 100644
@@ -47,7 +47,7 @@ Supported Features
 - Promiscuous mode
 - Allmulti mode
 - Port hardware statistics
-- Jumbo frames (using single buffer)
+- Jumbo frames
 - VLAN offload - Filtering and stripping
 - Stateless checksum offloads (IPv4/TCP/UDP)
 - Multiple Rx/Tx queues
@@ -58,11 +58,11 @@ Supported Features
 - SR-IOV VF
 - MTU change
 - Multiprocess aware
+- Scatter-Gather
 
 Non-supported Features
 ----------------------
 
-- Scatter-Gather Rx/Tx frames
 - SR-IOV PF
 - Tunneling offloads
 - Reload of the PMD after a non-graceful termination
drivers/net/qede/qede_ethdev.c +7 -12
index c4e82d0..eb9b8aa 100644
@@ -434,14 +434,14 @@ static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
 	struct qede_vlan_entry *vlan;
 	int rc;
 
-	if (qdev->configured_vlans == dev_info->num_vlan_filters) {
-		DP_NOTICE(edev, false, "Reached max VLAN filter limit"
-				     " enabling accept_any_vlan\n");
-		qede_config_accept_any_vlan(qdev, true);
-		return 0;
-	}
-
 	if (on) {
+		if (qdev->configured_vlans == dev_info->num_vlan_filters) {
+			DP_INFO(edev, "Reached max VLAN filter limit"
+				      " enabling accept_any_vlan\n");
+			qede_config_accept_any_vlan(qdev, true);
+			return 0;
+		}
+
 		SLIST_FOREACH(tmp, &qdev->vlan_list_head, list) {
 			if (tmp->vid == vlan_id) {
 				DP_ERR(edev, "VLAN %u already configured\n",
@@ -559,11 +559,6 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 	}
 
 	/* Sanity checks and throw warnings */
-	if (rxmode->enable_scatter == 1) {
-		DP_ERR(edev, "RX scatter packets is not supported\n");
-		return -EINVAL;
-	}
-
 	if (rxmode->enable_lro == 1) {
 		DP_INFO(edev, "LRO is not supported\n");
 		return -EINVAL;
drivers/net/qede/qede_rxtx.c +166 -38

309 lines not on this page · raw message

drivers/net/qede/qede_rxtx.h +0 -3
index 9ee69ed..da47b21 100644
@@ -30,9 +30,6 @@
 #define TX_CONS(txq)            (txq->sw_tx_cons & NUM_TX_BDS(txq))
 #define TX_PROD(txq)            (txq->sw_tx_prod & NUM_TX_BDS(txq))
 
-/* Number of TX BDs per packet used currently */
-#define MAX_NUM_TX_BDS			1
-
 #define QEDE_DEFAULT_TX_FREE_THRESH	32
 
 #define QEDE_CSUM_ERROR			(1 << 0)
Signature · 1 line
1.8.3.1
#26 lore raw

PATCH v3 24/32 qede/base: change rx tx queue start APIs

In reply to Rasesh Mody

Changed q_{rx,tx}_start APIs to use common queue start parameters

---
 drivers/net/qede/base/ecore_l2.c     | 131 +++++++++++++++--------------------
 drivers/net/qede/base/ecore_l2.h     |  26 ++-----
 drivers/net/qede/base/ecore_l2_api.h |  69 +++++++++---------
 drivers/net/qede/base/ecore_sriov.c  |  28 +++++---
 drivers/net/qede/qede_eth_if.c       |  47 ++++++-------
 drivers/net/qede/qede_eth_if.h       |  11 ++-
 drivers/net/qede/qede_rxtx.c         |  27 +++++---
 7 files changed, 155 insertions(+), 184 deletions(-)
drivers/net/qede/base/ecore_l2.c +56 -75
index 83a62e0..74f61b0 100644
@@ -548,12 +548,7 @@ enum _ecore_status_t
 ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
 			      u16 opaque_fid,
 			      u32 cid,
-			      u16 rx_queue_id,
-			      u8 vf_rx_queue_id,
-			      u8 vport_id,
-			      u8 stats_id,
-			      u16 sb,
-			      u8 sb_index,
+			      struct ecore_queue_start_common_params *p_params,
 			      u16 bd_max_bytes,
 			      dma_addr_t bd_chain_phys_addr,
 			      dma_addr_t cqe_pbl_addr,
@@ -568,22 +563,23 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
 	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Store information for the stop */
-	p_rx_cid = &p_hwfn->p_rx_cids[rx_queue_id];
+	p_rx_cid = &p_hwfn->p_rx_cids[p_params->queue_id];
 	p_rx_cid->cid = cid;
 	p_rx_cid->opaque_fid = opaque_fid;
-	p_rx_cid->vport_id = vport_id;
+	p_rx_cid->vport_id = p_params->vport_id;
 
-	rc = ecore_fw_vport(p_hwfn, vport_id, &abs_vport_id);
+	rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
-	rc = ecore_fw_l2_queue(p_hwfn, rx_queue_id, &abs_rx_q_id);
+	rc = ecore_fw_l2_queue(p_hwfn, p_params->queue_id, &abs_rx_q_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
 		   "opaque_fid=0x%x, cid=0x%x, rx_qid=0x%x, vport_id=0x%x, sb_id=0x%x\n",
-		   opaque_fid, cid, rx_queue_id, vport_id, sb);
+		   opaque_fid, cid, p_params->queue_id,
+		   p_params->vport_id, p_params->sb);
 
 	/* Get SPQ entry */
 	OSAL_MEMSET(&init_data, 0, sizeof(init_data));
@@ -599,10 +595,10 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
 
 	p_ramrod = &p_ent->ramrod.rx_queue_start;
 
-	p_ramrod->sb_id = OSAL_CPU_TO_LE16(sb);
-	p_ramrod->sb_index = sb_index;
+	p_ramrod->sb_id = OSAL_CPU_TO_LE16(p_params->sb);
+	p_ramrod->sb_index = (u8)p_params->sb_idx;
 	p_ramrod->vport_id = abs_vport_id;
-	p_ramrod->stats_counter_id = stats_id;
+	p_ramrod->stats_counter_id = p_params->stats_id;
 	p_ramrod->rx_queue_id = OSAL_CPU_TO_LE16(abs_rx_q_id);
 	p_ramrod->complete_cqe_flg = 0;
 	p_ramrod->complete_event_flg = 1;
@@ -613,30 +609,27 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
 	p_ramrod->num_of_pbl_pages = OSAL_CPU_TO_LE16(cqe_pbl_size);
 	DMA_REGPAIR_LE(p_ramrod->cqe_pbl_addr, cqe_pbl_addr);
 
-	if (vf_rx_queue_id || b_use_zone_a_prod) {
-		p_ramrod->vf_rx_prod_index = vf_rx_queue_id;
+	if (p_params->vf_qid || b_use_zone_a_prod) {
+		p_ramrod->vf_rx_prod_index = (u8)p_params->vf_qid;
 		DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
 			   "Queue%s is meant for VF rxq[%02x]\n",
 			   b_use_zone_a_prod ? " [legacy]" : "",
-			   vf_rx_queue_id);
+			   p_params->vf_qid);
 		p_ramrod->vf_rx_prod_use_zone_a = b_use_zone_a_prod;
 	}
 
 	return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
 }
 
-enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
-						 u16 opaque_fid,
-						 u8 rx_queue_id,
-						 u8 vport_id,
-						 u8 stats_id,
-						 u16 sb,
-						 u8 sb_index,
-						 u16 bd_max_bytes,
-						 dma_addr_t bd_chain_phys_addr,
-						 dma_addr_t cqe_pbl_addr,
-						 u16 cqe_pbl_size,
-						 void OSAL_IOMEM **pp_prod)
+enum _ecore_status_t
+ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
+			    u16 opaque_fid,
+			    struct ecore_queue_start_common_params *p_params,
+			    u16 bd_max_bytes,
+			    dma_addr_t bd_chain_phys_addr,
+			    dma_addr_t cqe_pbl_addr,
+			    u16 cqe_pbl_size,
+			    void OSAL_IOMEM * *pp_prod)
 {
 	struct ecore_hw_cid_data *p_rx_cid;
 	u32 init_prod_val = 0;
@@ -646,20 +639,20 @@ enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
 
 	if (IS_VF(p_hwfn->p_dev)) {
 		return ecore_vf_pf_rxq_start(p_hwfn,
-					     rx_queue_id,
-					     sb,
-					     sb_index,
+					     p_params->queue_id,
+					     p_params->sb,
+					     (u8)p_params->sb_idx,
 					     bd_max_bytes,
 					     bd_chain_phys_addr,
 					     cqe_pbl_addr,
 					     cqe_pbl_size, pp_prod);
 	}
 
-	rc = ecore_fw_l2_queue(p_hwfn, rx_queue_id, &abs_l2_queue);
+	rc = ecore_fw_l2_queue(p_hwfn, p_params->queue_id, &abs_l2_queue);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
-	rc = ecore_fw_vport(p_hwfn, stats_id, &abs_stats_id);
+	rc = ecore_fw_vport(p_hwfn, p_params->stats_id, &abs_stats_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
@@ -672,7 +665,7 @@ enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
 			  (u32 *)(&init_prod_val));
 
 	/* Allocate a CID for the queue */
-	p_rx_cid = &p_hwfn->p_rx_cids[rx_queue_id];
+	p_rx_cid = &p_hwfn->p_rx_cids[p_params->queue_id];
 	rc = ecore_cxt_acquire_cid(p_hwfn, PROTOCOLID_ETH,
 				   &p_rx_cid->cid);
 	if (rc != ECORE_SUCCESS) {
@@ -680,16 +673,13 @@ enum _ecore_status_t ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn,
 		return rc;
 	}
 	p_rx_cid->b_cid_allocated = true;
+	p_params->stats_id = abs_stats_id;
+	p_params->vf_qid = 0;
 
 	rc = ecore_sp_eth_rxq_start_ramrod(p_hwfn,
 					   opaque_fid,
 					   p_rx_cid->cid,
-					   rx_queue_id,
-					   0,
-					   vport_id,
-					   abs_stats_id,
-					   sb,
-					   sb_index,
+					   p_params,
 					   bd_max_bytes,
 					   bd_chain_phys_addr,
 					   cqe_pbl_addr,
@@ -816,12 +806,8 @@ ecore_sp_eth_rx_queue_stop(struct ecore_hwfn *p_hwfn,
 enum _ecore_status_t
 ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
 			      u16 opaque_fid,
-			      u16 tx_queue_id,
 			      u32 cid,
-			      u8 vport_id,
-			      u8 stats_id,
-			      u16 sb,
-			      u8 sb_index,
+			      struct ecore_queue_start_common_params *p_params,
 			      dma_addr_t pbl_addr,
 			      u16 pbl_size,
 			      union ecore_qm_pq_params *p_pq_params)
@@ -835,15 +821,15 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
 	enum _ecore_status_t rc = ECORE_NOTIMPL;
 
 	/* Store information for the stop */
-	p_tx_cid = &p_hwfn->p_tx_cids[tx_queue_id];
+	p_tx_cid = &p_hwfn->p_tx_cids[p_params->queue_id];
 	p_tx_cid->cid = cid;
 	p_tx_cid->opaque_fid = opaque_fid;
 
-	rc = ecore_fw_vport(p_hwfn, vport_id, &abs_vport_id);
+	rc = ecore_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
-	rc = ecore_fw_l2_queue(p_hwfn, tx_queue_id, &abs_tx_q_id);
+	rc = ecore_fw_l2_queue(p_hwfn, p_params->queue_id, &abs_tx_q_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
@@ -862,9 +848,9 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
 	p_ramrod = &p_ent->ramrod.tx_queue_start;
 	p_ramrod->vport_id = abs_vport_id;
 
-	p_ramrod->sb_id = OSAL_CPU_TO_LE16(sb);
-	p_ramrod->sb_index = sb_index;
-	p_ramrod->stats_counter_id = stats_id;
+	p_ramrod->sb_id = OSAL_CPU_TO_LE16(p_params->sb);
+	p_ramrod->sb_index = (u8)p_params->sb_idx;
+	p_ramrod->stats_counter_id = p_params->stats_id;
 
 	p_ramrod->queue_zone_id = OSAL_CPU_TO_LE16(abs_tx_q_id);
 
@@ -877,17 +863,14 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
 	return ecore_spq_post(p_hwfn, p_ent, OSAL_NULL);
 }
 
-enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
-						 u16 opaque_fid,
-						 u16 tx_queue_id,
-						 u8 vport_id,
-						 u8 stats_id,
-						 u16 sb,
-						 u8 sb_index,
-						 u8 tc,
-						 dma_addr_t pbl_addr,
-						 u16 pbl_size,
-						 void OSAL_IOMEM **pp_doorbell)
+enum _ecore_status_t
+ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
+			    u16 opaque_fid,
+			    struct ecore_queue_start_common_params *p_params,
+			    u8 tc,
+			    dma_addr_t pbl_addr,
+			    u16 pbl_size,
+			    void OSAL_IOMEM * *pp_doorbell)
 {
 	struct ecore_hw_cid_data *p_tx_cid;
 	union ecore_qm_pq_params pq_params;
@@ -896,19 +879,19 @@ enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
 
 	if (IS_VF(p_hwfn->p_dev)) {
 		return ecore_vf_pf_txq_start(p_hwfn,
-					     tx_queue_id,
-					     sb,
-					     sb_index,
+					     p_params->queue_id,
+					     p_params->sb,
+					     (u8)p_params->sb_idx,
 					     pbl_addr,
 					     pbl_size,
 					     pp_doorbell);
 	}
 
-	rc = ecore_fw_vport(p_hwfn, stats_id, &abs_stats_id);
+	rc = ecore_fw_vport(p_hwfn, p_params->stats_id, &abs_stats_id);
 	if (rc != ECORE_SUCCESS)
 		return rc;
 
-	p_tx_cid = &p_hwfn->p_tx_cids[tx_queue_id];
+	p_tx_cid = &p_hwfn->p_tx_cids[p_params->queue_id];
 	OSAL_MEMSET(p_tx_cid, 0, sizeof(*p_tx_cid));
 	OSAL_MEMSET(&pq_params, 0, sizeof(pq_params));
 
@@ -924,18 +907,16 @@ enum _ecore_status_t ecore_sp_eth_tx_queue_start(struct ecore_hwfn *p_hwfn,
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_SP,
 		   "opaque_fid=0x%x, cid=0x%x, tx_qid=0x%x, vport_id=0x%x, sb_id=0x%x\n",
-		    opaque_fid, p_tx_cid->cid, tx_queue_id,
-		    vport_id, sb);
+		    opaque_fid, p_tx_cid->cid, p_params->queue_id,
+		    p_params->vport_id, p_params->sb);
+
+	p_params->stats_id = abs_stats_id;
 
 	/* TODO - set tc in the pq_params for multi-cos */
 	rc = ecore_sp_eth_txq_start_ramrod(p_hwfn,
 					   opaque_fid,
-					   tx_queue_id,
 					   p_tx_cid->cid,
-					   vport_id,
-					   abs_stats_id,
-					   sb,
-					   sb_index,
+					   p_params,
 					   pbl_addr,
 					   pbl_size,
 					   &pq_params);
drivers/net/qede/base/ecore_l2.h +5 -21
index c8419a3..9c1bd38 100644
@@ -40,11 +40,8 @@ ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
  * @param p_hwfn
  * @param opaque_fid
  * @param cid
- * @param rx_queue_id
- * @param vport_id
- * @param stats_id
- * @param sb
- * @param sb_index
+ * @param p_params [queue_id, vport_id, stats_id, sb, sb_idx, vf_qid]
+	  stats_id is absolute packed in p_params.
  * @param bd_max_bytes
  * @param bd_chain_phys_addr
  * @param cqe_pbl_addr
@@ -57,12 +54,7 @@ enum _ecore_status_t
 ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn	*p_hwfn,
 			      u16 opaque_fid,
 			      u32 cid,
-			      u16 rx_queue_id,
-			      u8 vf_rx_queue_id,
-			      u8 vport_id,
-			      u8 stats_id,
-			      u16 sb,
-			      u8 sb_index,
+			      struct ecore_queue_start_common_params *p_params,
 			      u16 bd_max_bytes,
 			      dma_addr_t bd_chain_phys_addr,
 			      dma_addr_t cqe_pbl_addr,
@@ -74,12 +66,8 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn	*p_hwfn,
  *
  * @param p_hwfn
  * @param opaque_fid
- * @param tx_queue_id
  * @param cid
- * @param vport_id
- * @param stats_id
- * @param sb
- * @param sb_index
+ * @param p_params [queue_id, vport_id,stats_id, sb, sb_idx, vf_qid]
  * @param pbl_addr
  * @param pbl_size
  * @param p_pq_params - parameters for choosing the PQ for this Tx queue
@@ -89,12 +77,8 @@ ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn	*p_hwfn,
 enum _ecore_status_t
 ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn	*p_hwfn,
 			      u16 opaque_fid,
-			      u16 tx_queue_id,
 			      u32 cid,
-			      u8 vport_id,
-			      u8 stats_id,
-			      u16 sb,
-			      u8 sb_index,
+			      struct ecore_queue_start_common_params *p_params,
 			      dma_addr_t pbl_addr,
 			      u16 pbl_size,
 			      union ecore_qm_pq_params *p_pq_params);
drivers/net/qede/base/ecore_l2_api.h +31 -38

99 lines not on this page · raw message

drivers/net/qede/base/ecore_sriov.c +17 -11
index eb3a1e2..b28d728 100644
@@ -1961,6 +1961,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,
 				       struct ecore_ptt *p_ptt,
 				       struct ecore_vf_info *vf)
 {
+	struct ecore_queue_start_common_params p_params;
 	struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
 	u8 status = PFVF_STATUS_NO_RESOURCE;
 	struct vfpf_start_rxq_tlv *req;
@@ -1968,6 +1969,13 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,
 	enum _ecore_status_t rc;
 
 	req = &mbx->req_virt->start_rxq;
+	OSAL_MEMSET(&p_params, 0, sizeof(p_params));
+	p_params.queue_id = (u8)vf->vf_queues[req->rx_qid].fw_rx_qid;
+	p_params.vf_qid = req->rx_qid;
+	p_params.vport_id = vf->vport_id;
+	p_params.stats_id = vf->abs_vf_id + 0x10,
+	p_params.sb = req->hw_sb;
+	p_params.sb_idx = req->sb_index;
 
 	if (!ecore_iov_validate_rxq(p_hwfn, vf, req->rx_qid) ||
 	    !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
@@ -1987,12 +1995,7 @@ static void ecore_iov_vf_mbx_start_rxq(struct ecore_hwfn *p_hwfn,
 
 	rc = ecore_sp_eth_rxq_start_ramrod(p_hwfn, vf->opaque_fid,
 					   vf->vf_queues[req->rx_qid].fw_cid,
-					   vf->vf_queues[req->rx_qid].fw_rx_qid,
-					   (u8)req->rx_qid,
-					   vf->vport_id,
-					   vf->abs_vf_id + 0x10,
-					   req->hw_sb,
-					   req->sb_index,
+					   &p_params,
 					   req->bd_max_bytes,
 					   req->rxq_addr,
 					   req->cqe_pbl_addr,
@@ -2057,6 +2060,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,
 				       struct ecore_ptt *p_ptt,
 				       struct ecore_vf_info *vf)
 {
+	struct ecore_queue_start_common_params p_params;
 	struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
 	u8 status = PFVF_STATUS_NO_RESOURCE;
 	union ecore_qm_pq_params pq_params;
@@ -2069,6 +2073,12 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,
 	pq_params.eth.vf_id = vf->relative_vf_id;
 
 	req = &mbx->req_virt->start_txq;
+	OSAL_MEMSET(&p_params, 0, sizeof(p_params));
+	p_params.queue_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid;
+	p_params.vport_id = vf->vport_id;
+	p_params.stats_id = vf->abs_vf_id + 0x10,
+	p_params.sb = req->hw_sb;
+	p_params.sb_idx = req->sb_index;
 
 	if (!ecore_iov_validate_txq(p_hwfn, vf, req->tx_qid) ||
 	    !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
@@ -2077,12 +2087,8 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,
 	rc = ecore_sp_eth_txq_start_ramrod(
 		p_hwfn,
 		vf->opaque_fid,
-		vf->vf_queues[req->tx_qid].fw_tx_qid,
 		vf->vf_queues[req->tx_qid].fw_cid,
-		vf->vport_id,
-		vf->abs_vf_id + 0x10,
-		req->hw_sb,
-		req->sb_index,
+		&p_params,
 		req->pbl_addr,
 		req->pbl_size,
 		&pq_params);
drivers/net/qede/qede_eth_if.c +23 -24

96 lines not on this page · raw message

drivers/net/qede/qede_eth_if.h +5 -6
index 5a7fdc9..33655c3 100644
@@ -133,9 +133,9 @@ struct qed_eth_ops {
 			    struct qed_update_vport_params *params);
 
 	int (*q_rx_start)(struct ecore_dev *cdev,
-			  uint8_t rss_id, uint8_t rx_queue_id,
-			  uint8_t vport_id, uint16_t sb,
-			  uint8_t sb_index, uint16_t bd_max_bytes,
+			  uint8_t rss_num,
+			  struct ecore_queue_start_common_params *p_params,
+			  uint16_t bd_max_bytes,
 			  dma_addr_t bd_chain_phys_addr,
 			  dma_addr_t cqe_pbl_addr,
 			  uint16_t cqe_pbl_size, void OSAL_IOMEM * *pp_prod);
@@ -144,9 +144,8 @@ struct qed_eth_ops {
 			 struct qed_stop_rxq_params *params);
 
 	int (*q_tx_start)(struct ecore_dev *edev,
-			  uint8_t rss_id, uint16_t tx_queue_id,
-			  uint8_t vport_id, uint16_t sb,
-			  uint8_t sb_index,
+			  uint8_t rss_num,
+			  struct ecore_queue_start_common_params *p_params,
 			  dma_addr_t pbl_addr,
 			  uint16_t pbl_size, void OSAL_IOMEM * *pp_doorbell);
 
drivers/net/qede/qede_rxtx.c +18 -9
index fce6f4f..d903a84 100644
@@ -561,6 +561,7 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
+	struct ecore_queue_start_common_params q_params;
 	struct qed_update_vport_rss_params *rss_params = &qdev->rss_params;
 	struct qed_dev_info *qed_info = &qdev->dev_info.common;
 	struct qed_update_vport_params vport_update_params;
@@ -580,12 +581,15 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
 			page_cnt = ecore_chain_get_page_cnt(&fp->rxq->
 								rx_comp_ring);
 
+			memset(&q_params, 0, sizeof(q_params));
+			q_params.queue_id = i;
+			q_params.vport_id = 0;
+			q_params.sb = fp->sb_info->igu_sb_id;
+			q_params.sb_idx = RX_PI;
+
 			ecore_sb_ack(fp->sb_info, IGU_INT_DISABLE, 0);
 
-			rc = qdev->ops->q_rx_start(edev, i, fp->rxq->queue_id,
-					   0,
-					   fp->sb_info->igu_sb_id,
-					   RX_PI,
+			rc = qdev->ops->q_rx_start(edev, i, &q_params,
 					   fp->rxq->rx_buf_size,
 					   fp->rxq->rx_bd_ring.p_phys_addr,
 					   p_phys_table,
@@ -611,11 +615,16 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
 
 			p_phys_table = ecore_chain_get_pbl_phys(&txq->tx_pbl);
 			page_cnt = ecore_chain_get_page_cnt(&txq->tx_pbl);
-			rc = qdev->ops->q_tx_start(edev, i, txq->queue_id,
-						   0,
-						   fp->sb_info->igu_sb_id,
-						   TX_PI(tc),
-						   p_phys_table, page_cnt,
+
+			memset(&q_params, 0, sizeof(q_params));
+			q_params.queue_id = txq->queue_id;
+			q_params.vport_id = 0;
+			q_params.sb = fp->sb_info->igu_sb_id;
+			q_params.sb_idx = TX_PI(tc);
+
+			rc = qdev->ops->q_tx_start(edev, i, &q_params,
+						   p_phys_table,
+						   page_cnt, /* **pp_doorbell */
 						   &txq->doorbell_addr);
 			if (rc) {
 				DP_ERR(edev, "Start txq %u failed %d\n",
Signature · 1 line
1.8.3.1
#27 lore raw

PATCH v3 25/32 qede/base: add support to initiate PF FLR

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

Add support to send PF FLR request to the management firmware to bringup the device in clean slate. This cleanup is necessary in some corner cases where the device would be left in a bad state from its previous operations. The driver will send PF FLR request before slowpath initialization.

---
 doc/guides/nics/qede.rst          |  1 -
 drivers/net/qede/base/ecore_dev.c | 15 +++++++++++----
 drivers/net/qede/base/ecore_mcp.c |  9 +++++++++
 drivers/net/qede/base/ecore_mcp.h | 11 +++++++++++
 4 files changed, 31 insertions(+), 5 deletions(-)
doc/guides/nics/qede.rst +0 -1
index 2a585e7..50e6f87 100644
@@ -65,7 +65,6 @@ Non-supported Features
 
 - SR-IOV PF
 - Tunneling offloads
-- Reload of the PMD after a non-graceful termination
 
 Supported QLogic Adapters
 -------------------------
drivers/net/qede/base/ecore_dev.c +11 -4
index b530173..6060f9e 100644
@@ -2952,13 +2952,14 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 			void OSAL_IOMEM *p_doorbells,
 			struct ecore_hw_prepare_params *p_params)
 {
+	struct ecore_dev *p_dev = p_hwfn->p_dev;
 	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	/* Split PCI bars evenly between hwfns */
 	p_hwfn->regview = p_regview;
 	p_hwfn->doorbells = p_doorbells;
 
-	if (IS_VF(p_hwfn->p_dev))
+	if (IS_VF(p_dev))
 		return ecore_vf_hw_prepare(p_hwfn);
 
 	/* Validate that chip access is feasible */
@@ -2982,7 +2983,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 
 	/* First hwfn learns basic information, e.g., number of hwfns */
 	if (!p_hwfn->my_id) {
-		rc = ecore_get_dev_info(p_hwfn->p_dev);
+		rc = ecore_get_dev_info(p_dev);
 		if (rc != ECORE_SUCCESS)
 			goto err1;
 	}
@@ -2996,6 +2997,12 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 		goto err1;
 	}
 
+	if (p_hwfn == ECORE_LEADING_HWFN(p_dev) && !p_dev->recov_in_prog) {
+		rc = ecore_mcp_initiate_pf_flr(p_hwfn, p_hwfn->p_main_ptt);
+		if (rc != ECORE_SUCCESS)
+			DP_NOTICE(p_hwfn, false, "Failed to initiate PF FLR\n");
+	}
+
 	/* Read the device configuration information from the HW and SHMEM */
 	rc = ecore_get_hw_info(p_hwfn, p_hwfn->p_main_ptt,
 			       p_params->personality, p_params->drv_resc_alloc);
@@ -3011,7 +3018,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 		goto err2;
 	}
 #ifndef ASIC_ONLY
-	if (CHIP_REV_IS_FPGA(p_hwfn->p_dev)) {
+	if (CHIP_REV_IS_FPGA(p_dev)) {
 		DP_NOTICE(p_hwfn, false,
 			  "FPGA: workaround; Prevent DMAE parities\n");
 		ecore_wr(p_hwfn, p_hwfn->p_main_ptt, PCIE_REG_PRTY_MASK, 7);
@@ -3026,7 +3033,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 	return rc;
  err2:
 	if (IS_LEAD_HWFN(p_hwfn))
-		ecore_iov_free_hw_info(p_hwfn->p_dev);
+		ecore_iov_free_hw_info(p_dev);
 	ecore_mcp_free(p_hwfn);
  err1:
 	ecore_hw_hwfn_free(p_hwfn);
drivers/net/qede/base/ecore_mcp.c +9 -0
index 500368e..2ff9715 100644
@@ -2442,3 +2442,12 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
 
 	return ECORE_SUCCESS;
 }
+
+enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn,
+					       struct ecore_ptt *p_ptt)
+{
+	u32 mcp_resp, mcp_param;
+
+	return ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_INITIATE_PF_FLR,
+			     0, &mcp_resp, &mcp_param);
+}
drivers/net/qede/base/ecore_mcp.h +11 -0
index d3103ff..831890c 100644
@@ -353,4 +353,15 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
 					     struct resource_info *p_resc_info,
 					     u32 *p_mcp_resp, u32 *p_mcp_param);
 
+/**
+ * @brief - Initiates PF FLR
+ *
+ * @param p_hwfn
+ * @param p_ptt
+ *
+ * @param return ECORE_SUCCESS upon success.
+ */
+enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn,
+					       struct ecore_ptt *p_ptt);
+
 #endif /* __ECORE_MCP_H__ */
Signature · 1 line
1.8.3.1
#28 lore raw

PATCH v3 26/32 qede: skip slowpath polling for 100G VF device

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

There is no need to poll for slowpath events for VF device since the ramrod responses are received over PF-VF backchannel synchronously. So the fix is to restrict the slowpath polling for PF device only.

Fixes 2af14ca ("net/qede: support 100G")

---
 drivers/net/qede/qede_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/qede/qede_ethdev.c +1 -1
index eb9b8aa..ae188ed 100644
@@ -1369,7 +1369,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	 * This is required since uio device uses only one MSI-x
 	 * interrupt vector but we need one for each engine.
 	 */
-	if (edev->num_hwfns > 1) {
+	if (edev->num_hwfns > 1 && IS_PF(edev)) {
 		rc = rte_eal_alarm_set(timer_period * US_PER_S,
 				       qede_poll_sp_sb_cb,
 				       (void *)eth_dev);
Signature · 1 line
1.8.3.1
#29 lore raw

PATCH v3 27/32 qede: fix driver version string

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

This patch fixes the base driver version display.
The driver version notation is:
<Base-Version_PMD-Version>

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/qede_ethdev.c | 43 +++++++++++++++++++++---------------------
 drivers/net/qede/qede_ethdev.h | 17 ++++++++---------
 drivers/net/qede/qede_if.h     |  3 +--
 drivers/net/qede/qede_main.c   |  4 ++--
 4 files changed, 32 insertions(+), 35 deletions(-)
drivers/net/qede/qede_ethdev.c +21 -22
index ae188ed..73b3b54 100644
@@ -8,6 +8,7 @@
 
 #include "qede_ethdev.h"
 #include <rte_alarm.h>
+#include <rte_version.h>
 
 /* Globals */
 static const struct qed_eth_ops *qed_ops;
@@ -188,31 +189,28 @@ static void qede_print_adapter_info(struct qede_dev *qdev)
 {
 	struct ecore_dev *edev = &qdev->edev;
 	struct qed_dev_info *info = &qdev->dev_info.common;
-	static char ver_str[QED_DRV_VER_STR_SIZE];
+	static char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
+	static char ver_str[QEDE_PMD_DRV_VER_STR_SIZE];
 
 	DP_INFO(edev, "*********************************\n");
+	DP_INFO(edev, " DPDK version:%s\n", rte_version());
 	DP_INFO(edev, " Chip details : %s%d\n",
-		ECORE_IS_BB(edev) ? "BB" : "AH",
-		CHIP_REV_IS_A0(edev) ? 0 : 1);
-
-	sprintf(ver_str, "%s %s_%d.%d.%d.%d", QEDE_PMD_VER_PREFIX,
-		edev->ver_str, QEDE_PMD_VERSION_MAJOR, QEDE_PMD_VERSION_MINOR,
-		QEDE_PMD_VERSION_REVISION, QEDE_PMD_VERSION_PATCH);
-	strcpy(qdev->drv_ver, ver_str);
-	DP_INFO(edev, " Driver version : %s\n", ver_str);
-
-	sprintf(ver_str, "%d.%d.%d.%d", info->fw_major, info->fw_minor,
-		info->fw_rev, info->fw_eng);
+		  ECORE_IS_BB(edev) ? "BB" : "AH",
+		  CHIP_REV_IS_A0(edev) ? 0 : 1);
+	snprintf(ver_str, QEDE_PMD_DRV_VER_STR_SIZE, "%d.%d.%d.%d",
+		 info->fw_major, info->fw_minor, info->fw_rev, info->fw_eng);
+	snprintf(drv_ver, QEDE_PMD_DRV_VER_STR_SIZE, "%s_%s",
+		 ver_str, QEDE_PMD_VERSION);
+	DP_INFO(edev, " Driver version : %s\n", drv_ver);
 	DP_INFO(edev, " Firmware version : %s\n", ver_str);
 
-	sprintf(ver_str, "%d.%d.%d.%d",
+	snprintf(ver_str, MCP_DRV_VER_STR_SIZE,
+		 "%d.%d.%d.%d",
 		(info->mfw_rev >> 24) & 0xff,
 		(info->mfw_rev >> 16) & 0xff,
 		(info->mfw_rev >> 8) & 0xff, (info->mfw_rev) & 0xff);
-	DP_INFO(edev, " Management firmware version : %s\n", ver_str);
-
+	DP_INFO(edev, " Management Firmware version : %s\n", ver_str);
 	DP_INFO(edev, " Firmware file : %s\n", fw_file);
-
 	DP_INFO(edev, "*********************************\n");
 }
 
@@ -1359,11 +1357,12 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	/* Start the Slowpath-process */
 	memset(&params, 0, sizeof(struct qed_slowpath_params));
 	params.int_mode = ECORE_INT_MODE_MSIX;
-	params.drv_major = QEDE_MAJOR_VERSION;
-	params.drv_minor = QEDE_MINOR_VERSION;
-	params.drv_rev = QEDE_REVISION_VERSION;
-	params.drv_eng = QEDE_ENGINEERING_VERSION;
-	strncpy((char *)params.name, "qede LAN", QED_DRV_VER_STR_SIZE);
+	params.drv_major = QEDE_PMD_VERSION_MAJOR;
+	params.drv_minor = QEDE_PMD_VERSION_MINOR;
+	params.drv_rev = QEDE_PMD_VERSION_REVISION;
+	params.drv_eng = QEDE_PMD_VERSION_PATCH;
+	strncpy((char *)params.name, QEDE_PMD_VER_PREFIX,
+		QEDE_PMD_DRV_VER_STR_SIZE);
 
 	/* For CMT mode device do periodic polling for slowpath events.
 	 * This is required since uio device uses only one MSI-x
@@ -1400,7 +1399,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	qede_alloc_etherdev(adapter, &dev_info);
 
-	adapter->ops->common->set_id(edev, edev->name, QEDE_DRV_MODULE_VERSION);
+	adapter->ops->common->set_id(edev, edev->name, QEDE_PMD_VERSION);
 
 	if (!is_vf)
 		adapter->dev_info.num_mac_addrs =
drivers/net/qede/qede_ethdev.h +8 -9
index 5838f33..c3b87e8 100644
@@ -46,15 +46,14 @@
 #define QEDE_PMD_VERSION_REVISION       0
 #define QEDE_PMD_VERSION_PATCH	        1
 
-#define QEDE_MAJOR_VERSION		8
-#define QEDE_MINOR_VERSION		7
-#define QEDE_REVISION_VERSION		9
-#define QEDE_ENGINEERING_VERSION	0
+#define QEDE_PMD_VERSION qede_stringify(QEDE_PMD_VERSION_MAJOR) "."     \
+			 qede_stringify(QEDE_PMD_VERSION_MINOR) "."     \
+			 qede_stringify(QEDE_PMD_VERSION_REVISION) "."  \
+			 qede_stringify(QEDE_PMD_VERSION_PATCH)
+
+#define QEDE_PMD_DRV_VER_STR_SIZE NAME_SIZE
+#define QEDE_PMD_VER_PREFIX "QEDE PMD"
 
-#define QEDE_DRV_MODULE_VERSION qede_stringify(QEDE_MAJOR_VERSION) "."	\
-		qede_stringify(QEDE_MINOR_VERSION) "."			\
-		qede_stringify(QEDE_REVISION_VERSION) "."		\
-		qede_stringify(QEDE_ENGINEERING_VERSION)
 
 #define QEDE_RSS_INDIR_INITED     (1 << 0)
 #define QEDE_RSS_KEY_INITED       (1 << 1)
@@ -144,7 +143,7 @@ struct qede_dev {
 	bool accept_any_vlan;
 	struct ether_addr primary_mac;
 	bool handle_hw_err;
-	char drv_ver[QED_DRV_VER_STR_SIZE];
+	char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
 };
 
 /* Static functions */
drivers/net/qede/qede_if.h +1 -2
index 935eed8..2d38b1b 100644
@@ -76,14 +76,13 @@ struct qed_link_output {
 	uint32_t pause_config;
 };
 
-#define QED_DRV_VER_STR_SIZE 80
 struct qed_slowpath_params {
 	uint32_t int_mode;
 	uint8_t drv_major;
 	uint8_t drv_minor;
 	uint8_t drv_rev;
 	uint8_t drv_eng;
-	uint8_t name[QED_DRV_VER_STR_SIZE];
+	uint8_t name[NAME_SIZE];
 };
 
 #define ILT_PAGE_SIZE_TCFC 0x8000	/* 32KB */
drivers/net/qede/qede_main.c +2 -2
index c83893d..0483116 100644
@@ -426,7 +426,7 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 
 static void
 qed_set_id(struct ecore_dev *edev, char name[NAME_SIZE],
-	   const char ver_str[VER_SIZE])
+	   const char ver_str[NAME_SIZE])
 {
 	int i;
 
@@ -434,7 +434,7 @@ qed_set_id(struct ecore_dev *edev, char name[NAME_SIZE],
 	for_each_hwfn(edev, i) {
 		snprintf(edev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
 	}
-	rte_memcpy(edev->ver_str, ver_str, VER_SIZE);
+	memcpy(edev->ver_str, ver_str, NAME_SIZE);
 	edev->drv_type = DRV_ID_DRV_TYPE_LINUX;
 }
 
Signature · 1 line
1.8.3.1
#30 lore raw

PATCH v3 28/32 qede: fix status_blk index for VF queues

In reply to Rasesh Mody

From: Harish Patil <[email protected]>

o Fix the fastpath status block index such that each queue pair shares the same index value.

o Add ecore_vf_get_num_sbs() API that returns the number of status blocks assigned by PF. Use that to decide how many VF queues can be advertised. Additionally, restrict maximum number of VF queues to 16 for 100G VF case.

Fixes 2ea6f76 ("qede: add core driver")
---
 drivers/net/qede/base/ecore_vf.c     | 11 ++++++++++-
 drivers/net/qede/base/ecore_vf_api.h |  3 +++
 drivers/net/qede/qede_ethdev.h       |  1 +
 drivers/net/qede/qede_main.c         | 13 ++++++++++++-
 drivers/net/qede/qede_rxtx.c         | 15 ++++++++++++++-
 5 files changed, 40 insertions(+), 3 deletions(-)
drivers/net/qede/base/ecore_vf.c +10 -1
index 634e2bb..be8b1ec 100644
@@ -336,7 +336,7 @@ static enum _ecore_status_t ecore_vf_pf_acquire(struct ecore_hwfn *p_hwfn)
 	/* Learn of the possibility of CMT */
 	if (IS_LEAD_HWFN(p_hwfn)) {
 		if (resp->pfdev_info.capabilities & PFVF_ACQUIRE_CAP_100G) {
-			DP_NOTICE(p_hwfn, false, "100g VF\n");
+			DP_INFO(p_hwfn, "100g VF\n");
 			p_hwfn->p_dev->num_hwfns = 2;
 		}
 	}
@@ -1382,6 +1382,15 @@ void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
 	*num_mac = p_vf->acquire_resp.resc.num_mac_filters;
 }
 
+void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
+			  u32 *num_sbs)
+{
+	struct ecore_vf_iov *p_vf;
+
+	p_vf = p_hwfn->vf_iov_info;
+	*num_sbs = (u32)p_vf->acquire_resp.resc.num_sbs;
+}
+
 bool ecore_vf_check_mac(struct ecore_hwfn *p_hwfn, u8 *mac)
 {
 	struct ecore_bulletin_content *bulletin;
drivers/net/qede/base/ecore_vf_api.h +3 -0
index c73244f..571fd37 100644
@@ -87,6 +87,9 @@ void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
 void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
 				  u32 *num_mac_filters);
 
+void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
+			  u32 *num_sbs);
+
 /**
  * @brief Check if VF can set a MAC address
  *
drivers/net/qede/qede_ethdev.h +1 -0
index c3b87e8..7b235b1 100644
@@ -29,6 +29,7 @@
 #include "base/ecore_hsi_eth.h"
 #include "base/ecore_dev_api.h"
 #include "base/ecore_iov_api.h"
+#include "base/ecore_cxt.h"
 
 #include "qede_logs.h"
 #include "qede_if.h"
drivers/net/qede/qede_main.c +12 -1
index 0483116..4f1e3b0 100644
@@ -384,6 +384,7 @@ int
 qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 {
 	struct qede_dev *qdev = (struct qede_dev *)edev;
+	uint8_t queues = 0;
 	int i;
 
 	memset(info, 0, sizeof(*info));
@@ -407,7 +408,17 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 		rte_memcpy(&info->port_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
 			   ETHER_ADDR_LEN);
 	} else {
-		ecore_vf_get_num_rxqs(&edev->hwfns[0], &info->num_queues);
+		ecore_vf_get_num_rxqs(ECORE_LEADING_HWFN(edev),
+				      &info->num_queues);
+		if (edev->num_hwfns > 1) {
+			ecore_vf_get_num_rxqs(&edev->hwfns[1], &queues);
+			info->num_queues += queues;
+			/* Restrict 100G VF to advertise 16 queues till the
+			 * required support is available to go beyond 16.
+			 */
+			info->num_queues = RTE_MIN(info->num_queues,
+						   ECORE_MAX_VF_CHAINS_PER_PF);
+		}
 
 		ecore_vf_get_num_vlan_filters(&edev->hwfns[0],
 					      (u8 *)&info->num_vlan_filters);
drivers/net/qede/qede_rxtx.c +14 -1
index d903a84..087a2bb 100644
@@ -424,9 +424,22 @@ qede_alloc_mem_sb(struct qede_dev *qdev, struct ecore_sb_info *sb_info,
 
 int qede_alloc_fp_resc(struct qede_dev *qdev)
 {
+	struct ecore_dev *edev = &qdev->edev;
 	struct qede_fastpath *fp;
+	uint32_t num_sbs;
 	int rc, i;
 
+	if (IS_VF(edev))
+		ecore_vf_get_num_sbs(ECORE_LEADING_HWFN(edev), &num_sbs);
+	else
+		num_sbs = (ecore_cxt_get_proto_cid_count
+			  (ECORE_LEADING_HWFN(edev), PROTOCOLID_ETH, NULL)) / 2;
+
+	if (num_sbs == 0) {
+		DP_ERR(edev, "No status blocks available\n");
+		return -EINVAL;
+	}
+
 	if (qdev->fp_array)
 		qede_free_fp_arrays(qdev);
 
@@ -438,7 +451,7 @@ int qede_alloc_fp_resc(struct qede_dev *qdev)
 
 	for (i = 0; i < QEDE_QUEUE_CNT(qdev); i++) {
 		fp = &qdev->fp_array[i];
-		if (qede_alloc_mem_sb(qdev, fp->sb_info, i)) {
+		if (qede_alloc_mem_sb(qdev, fp->sb_info, i % num_sbs)) {
 			qede_free_fp_arrays(qdev);
 			return -ENOMEM;
 		}
Signature · 1 line
1.8.3.1
#31 lore raw

PATCH v3 29/32 qede: add support for queue statistics

In reply to Rasesh Mody

This patch adds support for pulling per queue statistics.

---
 drivers/net/qede/qede_ethdev.c | 98 +++++++++++++++++++++++++++++++++++++-----
 drivers/net/qede/qede_ethdev.h |  3 ++
 drivers/net/qede/qede_rxtx.c   | 23 +++++-----
 drivers/net/qede/qede_rxtx.h   |  4 +-
 4 files changed, 107 insertions(+), 21 deletions(-)
drivers/net/qede/qede_ethdev.c +88 -10
index 73b3b54..d1b5edc 100644
@@ -160,6 +160,15 @@ static const struct rte_qede_xstats_name_off qede_xstats_strings[] = {
 		offsetof(struct ecore_eth_stats, tpa_coalesced_bytes)},
 };
 
+static const struct rte_qede_xstats_name_off qede_rxq_xstats_strings[] = {
+	{"rx_q_segments",
+		offsetof(struct qede_rx_queue, rx_segs)},
+	{"rx_q_hw_errors",
+		offsetof(struct qede_rx_queue, rx_hw_errors)},
+	{"rx_q_allocation_errors",
+		offsetof(struct qede_rx_queue, rx_alloc_errors)}
+};
+
 static void qede_interrupt_action(struct ecore_hwfn *p_hwfn)
 {
 	ecore_int_sp_dpc((osal_int_ptr_t)(p_hwfn));
@@ -825,6 +834,8 @@ qede_get_stats(struct rte_eth_dev *eth_dev, struct rte_eth_stats *eth_stats)
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	struct ecore_eth_stats stats;
+	unsigned int i = 0, j = 0, qid;
+	struct qede_tx_queue *txq;
 
 	qdev->ops->get_vport_stats(edev, &stats);
 
@@ -855,20 +866,73 @@ qede_get_stats(struct rte_eth_dev *eth_dev, struct rte_eth_stats *eth_stats)
 	    stats.tx_mcast_bytes + stats.tx_bcast_bytes;
 
 	eth_stats->oerrors = stats.tx_err_drop_pkts;
+
+	/* Queue stats */
+	for (qid = 0; qid < QEDE_QUEUE_CNT(qdev); qid++) {
+		if (qdev->fp_array[qid].type & QEDE_FASTPATH_RX) {
+			eth_stats->q_ipackets[i] =
+				*(uint64_t *)(
+					((char *)(qdev->fp_array[(qid)].rxq)) +
+					offsetof(struct qede_rx_queue,
+					rcv_pkts));
+			eth_stats->q_errors[i] =
+				*(uint64_t *)(
+					((char *)(qdev->fp_array[(qid)].rxq)) +
+					offsetof(struct qede_rx_queue,
+					rx_hw_errors)) +
+				*(uint64_t *)(
+					((char *)(qdev->fp_array[(qid)].rxq)) +
+					offsetof(struct qede_rx_queue,
+					rx_alloc_errors));
+			i++;
+		}
+
+		if (qdev->fp_array[qid].type & QEDE_FASTPATH_TX) {
+			txq = qdev->fp_array[(qid)].txqs[0];
+			eth_stats->q_opackets[j] =
+				*((uint64_t *)(uintptr_t)
+					(((uint64_t)(uintptr_t)(txq)) +
+					 offsetof(struct qede_tx_queue,
+						  xmit_pkts)));
+			j++;
+		}
+	}
+}
+
+static unsigned
+qede_get_xstats_count(struct qede_dev *qdev) {
+	return RTE_DIM(qede_xstats_strings) +
+		(RTE_DIM(qede_rxq_xstats_strings) * QEDE_RSS_COUNT(qdev));
 }
 
 static int
 qede_get_xstats_names(__rte_unused struct rte_eth_dev *dev,
 		      struct rte_eth_xstat_name *xstats_names, unsigned limit)
 {
-	unsigned int i, stat_cnt = RTE_DIM(qede_xstats_strings);
+	struct qede_dev *qdev = dev->data->dev_private;
+	const unsigned int stat_cnt = qede_get_xstats_count(qdev);
+	unsigned int i, qid, stat_idx = 0;
 
-	if (xstats_names != NULL)
-		for (i = 0; i < stat_cnt; i++)
-			snprintf(xstats_names[i].name,
-				sizeof(xstats_names[i].name),
+	if (xstats_names != NULL) {
+		for (i = 0; i < RTE_DIM(qede_xstats_strings); i++) {
+			snprintf(xstats_names[stat_idx].name,
+				sizeof(xstats_names[stat_idx].name),
 				"%s",
 				qede_xstats_strings[i].name);
+			stat_idx++;
+		}
+
+		for (qid = 0; qid < QEDE_RSS_COUNT(qdev); qid++) {
+			for (i = 0; i < RTE_DIM(qede_rxq_xstats_strings); i++) {
+				snprintf(xstats_names[stat_idx].name,
+					sizeof(xstats_names[stat_idx].name),
+					"%.4s%d%s",
+					qede_rxq_xstats_strings[i].name, qid,
+					qede_rxq_xstats_strings[i].name + 4);
+				stat_idx++;
+			}
+		}
+	}
 
 	return stat_cnt;
 }
@@ -880,18 +944,32 @@ qede_get_xstats(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 	struct qede_dev *qdev = dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	struct ecore_eth_stats stats;
-	unsigned int num = RTE_DIM(qede_xstats_strings);
+	const unsigned int num = qede_get_xstats_count(qdev);
+	unsigned int i, qid, stat_idx = 0;
 
 	if (n < num)
 		return num;
 
 	qdev->ops->get_vport_stats(edev, &stats);
 
-	for (num = 0; num < n; num++)
-		xstats[num].value = *(u64 *)(((char *)&stats) +
-					     qede_xstats_strings[num].offset);
+	for (i = 0; i < RTE_DIM(qede_xstats_strings); i++) {
+		xstats[stat_idx].value = *(uint64_t *)(((char *)&stats) +
+					     qede_xstats_strings[i].offset);
+		stat_idx++;
+	}
+
+	for (qid = 0; qid < QEDE_QUEUE_CNT(qdev); qid++) {
+		if (qdev->fp_array[qid].type & QEDE_FASTPATH_RX) {
+			for (i = 0; i < RTE_DIM(qede_rxq_xstats_strings); i++) {
+				xstats[stat_idx].value = *(uint64_t *)(
+					((char *)(qdev->fp_array[(qid)].rxq)) +
+					 qede_rxq_xstats_strings[i].offset);
+				stat_idx++;
+			}
+		}
+	}
 
-	return num;
+	return stat_idx;
 }
 
 static void
drivers/net/qede/qede_ethdev.h +3 -0
index 7b235b1..5ab36a5 100644
@@ -69,6 +69,9 @@
 #define QEDE_TSS_COUNT(qdev) (((qdev)->num_queues - (qdev)->fp_num_rx) * \
 					(qdev)->num_tc)
 
+#define QEDE_FASTPATH_TX        (1 << 0)
+#define QEDE_FASTPATH_RX        (1 << 1)
+
 #define QEDE_DUPLEX_FULL	1
 #define QEDE_DUPLEX_HALF	2
 #define QEDE_DUPLEX_UNKNOWN     0xff
drivers/net/qede/qede_rxtx.c +13 -10
index 087a2bb..5731833 100644
@@ -10,9 +10,6 @@
 
 static bool gro_disable = 1;	/* mod_param */
 
-#define QEDE_FASTPATH_TX        (1 << 0)
-#define QEDE_FASTPATH_RX        (1 << 1)
-
 static inline int qede_alloc_rx_buffer(struct qede_rx_queue *rxq)
 {
 	struct rte_mbuf *new_mb = NULL;
@@ -827,7 +824,7 @@ static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)
 }
 
 int qede_process_sg_pkts(void *p_rxq,  struct rte_mbuf *rx_mb,
-			 int num_frags, uint16_t pkt_len)
+			 int num_segs, uint16_t pkt_len)
 {
 	struct qede_rx_queue *rxq = p_rxq;
 	struct qede_dev *qdev = rxq->qdev;
@@ -838,13 +835,13 @@ int qede_process_sg_pkts(void *p_rxq,  struct rte_mbuf *rx_mb,
 	register struct rte_mbuf *seg2 = NULL;
 
 	seg1 = rx_mb;
-	while (num_frags) {
+	while (num_segs) {
 		cur_size = pkt_len > rxq->rx_buf_size ?
 				rxq->rx_buf_size : pkt_len;
 		if (!cur_size) {
 			PMD_RX_LOG(DEBUG, rxq,
 				   "SG packet, len and num BD mismatch\n");
-			qede_recycle_rx_bd_ring(rxq, qdev, num_frags);
+			qede_recycle_rx_bd_ring(rxq, qdev, num_segs);
 			return -EINVAL;
 		}
 
@@ -865,7 +862,8 @@ int qede_process_sg_pkts(void *p_rxq,  struct rte_mbuf *rx_mb,
 		seg2->data_len = cur_size;
 		seg1->next = seg2;
 		seg1 = seg1->next;
-		num_frags--;
+		num_segs--;
+		rxq->rx_segs++;
 		continue;
 	}
 	seg1 = NULL;
@@ -893,7 +891,7 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 	register struct rte_mbuf *seg1 = NULL;
 	enum eth_rx_cqe_type cqe_type;
 	uint16_t len, pad, preload_idx, pkt_len, parse_flag;
-	uint8_t csum_flag, num_frags;
+	uint8_t csum_flag, num_segs;
 	enum rss_hash_type htype;
 	int ret;
 
@@ -967,11 +965,13 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 		if (fp_cqe->bd_num > 1) {
 			pkt_len = rte_le_to_cpu_16(fp_cqe->pkt_len);
-			num_frags = fp_cqe->bd_num - 1;
+			num_segs = fp_cqe->bd_num - 1;
+
+			rxq->rx_segs++;
 
 			pkt_len -= len;
 			seg1 = rx_mb;
-			ret = qede_process_sg_pkts(p_rxq, seg1, num_frags,
+			ret = qede_process_sg_pkts(p_rxq, seg1, num_segs,
 						   pkt_len);
 			if (ret != ECORE_SUCCESS) {
 				qede_recycle_rx_bd_ring(rxq, qdev,
@@ -1034,6 +1034,8 @@ next_cqe:
 
 	qede_update_rx_prod(qdev, rxq);
 
+	rxq->rcv_pkts += rx_pkt;
+
 	PMD_RX_LOG(DEBUG, rxq, "rx_pkts=%u core=%d\n", rx_pkt, rte_lcore_id());
 
 	return rx_pkt;
@@ -1226,6 +1228,7 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		bd_prod =
 		    rte_cpu_to_le_16(ecore_chain_get_prod_idx(&txq->tx_pbl));
 		nb_pkt_sent++;
+		txq->xmit_pkts++;
 	}
 
 	/* Write value of prod idx into bd_prod */
drivers/net/qede/qede_rxtx.h +3 -1
index da47b21..ed9a529 100644
@@ -99,6 +99,8 @@ struct qede_rx_queue {
 	uint16_t queue_id;
 	uint16_t port_id;
 	uint16_t rx_buf_size;
+	uint64_t rcv_pkts;
+	uint64_t rx_segs;
 	uint64_t rx_hw_errors;
 	uint64_t rx_alloc_errors;
 	struct qede_dev *qdev;
@@ -130,7 +132,7 @@ struct qede_tx_queue {
 	void OSAL_IOMEM *doorbell_addr;
 	volatile union db_prod tx_db;
 	uint16_t port_id;
-	uint64_t txq_counter;
+	uint64_t xmit_pkts;
 	struct qede_dev *qdev;
 };
 
Signature · 1 line
1.8.3.1
#32 lore raw

PATCH v3 30/32 qede: remove zlib dependency and enable PMD by default

In reply to Rasesh Mody

The QEDE PMD now uses unzipped firmware file eliminating the dependency on zlib. Hence remove LDLIBS entry form the Makefile and enable qede PMD by default.

Fixes 6adac0bf ("qede: add missing external dependency and disable by default")
---
 config/common_base            | 2 +-
 doc/guides/nics/qede.rst      | 5 +----
 drivers/net/qede/Makefile     | 2 --
 drivers/net/qede/base/ecore.h | 2 +-
 drivers/net/qede/qede_main.c  | 2 +-
 mk/rte.app.mk                 | 2 +-
 6 files changed, 5 insertions(+), 10 deletions(-)
config/common_base +1 -1
index 7830535..2b03d61 100644
@@ -317,7 +317,7 @@ CONFIG_RTE_LIBRTE_BOND_DEBUG_ALB_L1=n
 
 # QLogic 25G/40G/100G PMD
 #
-CONFIG_RTE_LIBRTE_QEDE_PMD=n
+CONFIG_RTE_LIBRTE_QEDE_PMD=y
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_INIT=n
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO=n
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_DRIVER=n
doc/guides/nics/qede.rst +1 -4
index 50e6f87..d32fba2 100644
@@ -77,14 +77,11 @@ Prerequisites
 - Requires firmware version **8.10.x.** and management firmware
   version **8.10.x or higher**. Firmware may be available
   inbox in certain newer Linux distros under the standard directory
-  ``E.g. /lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin``
+  ``E.g. /lib/firmware/qed/qed_init_values-8.10.9.0.bin``
 
 - If the required firmware files are not available then visit
   `QLogic Driver Download Center <http://driverdownloads.qlogic.com>`_.
 
-- This driver relies on external zlib library (-lz) for uncompressing
-  the firmware file.
-
 Performance note
 ~~~~~~~~~~~~~~~~
 
drivers/net/qede/Makefile +0 -2
index 7965a83..39751e4 100644
@@ -14,8 +14,6 @@ LIB = librte_pmd_qede.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
-LDLIBS += -lz
-
 EXPORT_MAP := rte_pmd_qede_version.map
 
 LIBABIVER := 1
drivers/net/qede/base/ecore.h +1 -1
index 89e2bd0..907b35b 100644
@@ -15,7 +15,7 @@
 #include <unistd.h>
 
 #define CONFIG_ECORE_BINARY_FW
-#define CONFIG_ECORE_ZIPPED_FW
+#undef CONFIG_ECORE_ZIPPED_FW
 
 #ifdef CONFIG_ECORE_ZIPPED_FW
 #include <zlib.h>
drivers/net/qede/qede_main.c +1 -1
index 4f1e3b0..2d354e1 100644
@@ -21,7 +21,7 @@ static uint8_t npar_tx_switching = 1;
 char fw_file[PATH_MAX];
 
 const char *QEDE_DEFAULT_FIRMWARE =
-	"/lib/firmware/qed/qed_init_values_zipped-8.10.9.0.bin";
+	"/lib/firmware/qed/qed_init_values-8.10.9.0.bin";
 
 static void
 qed_update_pf_params(struct ecore_dev *edev, struct ecore_pf_params *params)
mk/rte.app.mk +1 -1
index 1a0095b..9b12da3 100644
@@ -120,7 +120,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)      += -lrte_pmd_mpipe -lgxio
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD)        += -lrte_pmd_nfp -lm
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL)       += -lrte_pmd_null
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP)       += -lrte_pmd_pcap -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD)       += -lrte_pmd_qede -lz
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD)       += -lrte_pmd_qede
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING)       += -lrte_pmd_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2)   += -lrte_pmd_szedata2 -lsze2
 _LDLIBS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += -lrte_pmd_thunderx_nicvf -lm
Signature · 1 line
1.8.3.1
#33 lore raw

PATCH v3 31/32 doc: update qede pmd documentation

In reply to Rasesh Mody
---
 doc/guides/nics/qede.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
doc/guides/nics/qede.rst +3 -1
index d32fba2..105ae37 100644
@@ -65,6 +65,8 @@ Non-supported Features
 
 - SR-IOV PF
 - Tunneling offloads
+- LRO/TSO
+- NPAR
 
 Supported QLogic Adapters
 -------------------------
@@ -239,7 +241,7 @@ SR-IOV: Prerequisites and Sample Application Notes
 
 This section provides instructions to configure SR-IOV with Linux OS.
 
-**Note**: librte_pmd_qede will be used to bind to SR-IOV VF device and Linux native kernel driver (QEDE) will function as SR-IOV PF driver.
+**Note**: librte_pmd_qede will be used to bind to SR-IOV VF device and Linux native kernel driver (QEDE) will function as SR-IOV PF driver. Requires PF driver to be 8.10.x.x or higher.
 
 #. Verify SR-IOV and ARI capability is enabled on the adapter using ``lspci``:
 
Signature · 1 line
1.8.3.1
#34 lore raw

PATCH v3 32/32 qede: update driver version

In reply to Rasesh Mody

This patch updates the qede pmd version to 1.2.0.1.

---
 drivers/net/qede/qede_ethdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/qede/qede_ethdev.h +1 -1
index 5ab36a5..5eb3f52 100644
@@ -43,7 +43,7 @@
 /* Driver versions */
 #define QEDE_PMD_VER_PREFIX		"QEDE PMD"
 #define QEDE_PMD_VERSION_MAJOR		1
-#define QEDE_PMD_VERSION_MINOR	        1
+#define QEDE_PMD_VERSION_MINOR	        2
 #define QEDE_PMD_VERSION_REVISION       0
 #define QEDE_PMD_VERSION_PATCH	        1
 
Signature · 1 line
1.8.3.1
#35 lore raw
In reply to Rasesh Mody
Quoted 53 lines · Rasesh Mody

Hi,

This patch set includes changes to update the base driver, work with newer FW 8.10.9.0, adds new features, includes enhancements and code cleanup, provides bug fixes and updates documentation for the QEDE poll mode driver.

It enables QEDE PMD in the dpdk config by default. The dependency on external library libz has been addressed.

The patch set updates the QEDE PMD to 1.2.0.1.

Review comments recived for v2 series have been addressed.

Please apply to DPDK tree for v16.11 release.

Thanks!
Rasesh

Harish Patil (14):
qede: change the API signature of ecore_mcp_cmd_and_union()
qede: serialize access to MFW mbox
qede: add APIs to support NIC selftests and query sensor info.
qede: fix port (re)configuration issue
qede/base: allow MTU change via vport-update
qede: add missing 100G link speed capability
qede: remove unused/dead code
qede: fixes for VLAN filters
qede: add enable/disable VLAN filtering
qede: fix RSS related issues
qede/base: add support to initiate PF FLR
qede: skip slowpath polling for 100G VF device
qede: fix driver version string
qede: fix status_blk index for VF queues

Rasesh Mody (16):
qede/base: add new init files and rearrange the code qede/base: formatting changes
qede: use FW CONFIG defines as needed qede/base: add HSI changes and register defines qede/base: fix the attention formating string qede/base: additional formatting/comment changes
qede: fix 32 bit compilation
qede/base: update base driver
qede/base: rename structure and defines qede/base: comment enhancements
qede/base: add MFW crash dump support qede/base: change rx tx queue start APIs
qede: add support for queue statistics
qede: remove zlib dependency and enable PMD by default
doc: update qede pmd documentation
qede: update driver version

Quoted 4 lines

Sony Chacko (2):
qede: enable support for unequal number of RX/TX queues
qede: add scatter gather support

Hi Rasesh,

This version of the patchset received after RC1, and to be in this release only remaining chance is to be merged in RC2.

And I would like to remind you that after RC2 you will have little time to test your new driver, would you like to push the driver to next release or stick with this one?

If you stick to release, can you please send new version -because of patch by patch compile error- timely so that it gives some time to reviewers before RC2?

Thanks,
ferruh

#36 lore raw
Quoted 67 lines

From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, October 17, 2016 10:06 AM

Quoted 53 lines · Rasesh Mody

Hi,

This patch set includes changes to update the base driver, work with newer FW 8.10.9.0, adds new features, includes enhancements and code cleanup, provides bug fixes and updates documentation for the QEDE poll mode driver.

It enables QEDE PMD in the dpdk config by default. The dependency on external library libz has been addressed.

The patch set updates the QEDE PMD to 1.2.0.1.

Review comments recived for v2 series have been addressed.

Please apply to DPDK tree for v16.11 release.

Thanks!
Rasesh

Harish Patil (14):
qede: change the API signature of ecore_mcp_cmd_and_union()
qede: serialize access to MFW mbox
qede: add APIs to support NIC selftests and query sensor info.
qede: fix port (re)configuration issue
qede/base: allow MTU change via vport-update
qede: add missing 100G link speed capability
qede: remove unused/dead code
qede: fixes for VLAN filters
qede: add enable/disable VLAN filtering
qede: fix RSS related issues
qede/base: add support to initiate PF FLR
qede: skip slowpath polling for 100G VF device
qede: fix driver version string
qede: fix status_blk index for VF queues

Rasesh Mody (16):
qede/base: add new init files and rearrange the code qede/base: formatting changes
qede: use FW CONFIG defines as needed qede/base: add HSI changes and register defines qede/base: fix the attention formating string qede/base: additional formatting/comment changes
qede: fix 32 bit compilation
qede/base: update base driver
qede/base: rename structure and defines qede/base: comment enhancements
qede/base: add MFW crash dump support qede/base: change rx tx queue start APIs
qede: add support for queue statistics
qede: remove zlib dependency and enable PMD by default
doc: update qede pmd documentation
qede: update driver version

Quoted 4 lines

Sony Chacko (2):
qede: enable support for unequal number of RX/TX queues
qede: add scatter gather support

Hi Rasesh,

This version of the patchset received after RC1, and to be in this release only remaining chance is to be merged in RC2.

Quoted 7 lines

And I would like to remind you that after RC2 you will have little time to test your new driver, would you like to push the driver to next release or stick with this one?

If you stick to release, can you please send new version -because of patch by patch compile error- timely so that it gives some time to reviewers before RC2?

Hi Ferruh,

We would like to include the driver changes in DPDK 16.11 release.

Please note that even though the driver patches are out for quite some time, we have thoroughly tested these changes.

Thanks!
-Rasesh

Quoted 5 lines

Thanks,
ferruh