DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenjing Qiao <wenjing.qiao@intel.com>
To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, mingxia.liu@intel.com, wenjing.qiao@intel.com,
	Simei Su <simei.su@intel.com>,
	Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Subject: [PATCH 12/14] common/idpf/base: refine comments and alignment
Date: Wed,  9 Aug 2023 01:33:06 +0000	[thread overview]
Message-ID: <20230809013308.1449103-13-wenjing.qiao@intel.com> (raw)
In-Reply-To: <20230809013308.1449103-1-wenjing.qiao@intel.com>

From: Simei Su <simei.su@intel.com>

Refine the macros and definitions by using 'tab' spaces and new
lines whereever necessary. Also refine the comment in
'idpf_ctlq_setup_regs'.

Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/common/idpf/base/idpf_controlq.c     |  2 +-
 drivers/common/idpf/base/idpf_controlq_api.h | 10 +----
 drivers/common/idpf/base/idpf_lan_pf_regs.h  |  7 ++--
 drivers/common/idpf/base/idpf_lan_txrx.h     | 43 ++++++++++----------
 drivers/common/idpf/base/idpf_lan_vf_regs.h  | 25 ++++++++----
 5 files changed, 46 insertions(+), 41 deletions(-)

diff --git a/drivers/common/idpf/base/idpf_controlq.c b/drivers/common/idpf/base/idpf_controlq.c
index da5c930578..c24bfd23ef 100644
--- a/drivers/common/idpf/base/idpf_controlq.c
+++ b/drivers/common/idpf/base/idpf_controlq.c
@@ -13,7 +13,7 @@ static void
 idpf_ctlq_setup_regs(struct idpf_ctlq_info *cq,
 		     struct idpf_ctlq_create_info *q_create_info)
 {
-	/* set head and tail registers in our local struct */
+	/* set control queue registers in our local struct */
 	cq->reg.head = q_create_info->reg.head;
 	cq->reg.tail = q_create_info->reg.tail;
 	cq->reg.len = q_create_info->reg.len;
diff --git a/drivers/common/idpf/base/idpf_controlq_api.h b/drivers/common/idpf/base/idpf_controlq_api.h
index 78a54f6b4c..38f5d2df3c 100644
--- a/drivers/common/idpf/base/idpf_controlq_api.h
+++ b/drivers/common/idpf/base/idpf_controlq_api.h
@@ -21,10 +21,7 @@ enum idpf_ctlq_type {
 	IDPF_CTLQ_TYPE_RDMA_COMPL	= 7
 };
 
-/*
- * Generic Control Queue Structures
- */
-
+/* Generic Control Queue Structures */
 struct idpf_ctlq_reg {
 	/* used for queue tracking */
 	u32 head;
@@ -157,10 +154,7 @@ enum idpf_mbx_opc {
 	idpf_mbq_opc_send_msg_to_peer_drv	= 0x0804,
 };
 
-/*
- * API supported for control queue management
- */
-
+/* API supported for control queue management */
 /* Will init all required q including default mb.  "q_info" is an array of
  * create_info structs equal to the number of control queues to be created.
  */
diff --git a/drivers/common/idpf/base/idpf_lan_pf_regs.h b/drivers/common/idpf/base/idpf_lan_pf_regs.h
index 8542620e01..e47afad6e9 100644
--- a/drivers/common/idpf/base/idpf_lan_pf_regs.h
+++ b/drivers/common/idpf/base/idpf_lan_pf_regs.h
@@ -80,10 +80,11 @@
 /* _ITR is ITR index, _INT is interrupt index, _itrn_indx_spacing is
  * spacing b/w itrn registers of the same vector.
  */
-#define PF_GLINT_ITR_ADDR(_ITR, _reg_start, _itrn_indx_spacing) \
-		((_reg_start) + (((_ITR)) * (_itrn_indx_spacing)))
+#define PF_GLINT_ITR_ADDR(_ITR, _reg_start, _itrn_indx_spacing)		\
+	((_reg_start) + ((_ITR) * (_itrn_indx_spacing)))
 /* For PF, itrn_indx_spacing is 4 and itrn_reg_spacing is 0x1000 */
-#define PF_GLINT_ITR(_ITR, _INT) (PF_GLINT_BASE + (((_ITR) + 1) * 4) + ((_INT) * 0x1000))
+#define PF_GLINT_ITR(_ITR, _INT)	\
+	(PF_GLINT_BASE + (((_ITR) + 1) * 4) + ((_INT) * 0x1000))
 #define PF_GLINT_ITR_MAX_INDEX		2
 #define PF_GLINT_ITR_INTERVAL_S		0
 #define PF_GLINT_ITR_INTERVAL_M		IDPF_M(0xFFF, PF_GLINT_ITR_INTERVAL_S)
diff --git a/drivers/common/idpf/base/idpf_lan_txrx.h b/drivers/common/idpf/base/idpf_lan_txrx.h
index 7b03693eb1..cc8f1cd2a5 100644
--- a/drivers/common/idpf/base/idpf_lan_txrx.h
+++ b/drivers/common/idpf/base/idpf_lan_txrx.h
@@ -8,9 +8,9 @@
 #include "idpf_osdep.h"
 
 enum idpf_rss_hash {
-	/* Values 0 - 28 are reserved for future use */
-	IDPF_HASH_INVALID		= 0,
-	IDPF_HASH_NONF_UNICAST_IPV4_UDP	= 29,
+	IDPF_HASH_INVALID			= 0,
+	/* Values 1 - 28 are reserved for future use */
+	IDPF_HASH_NONF_UNICAST_IPV4_UDP		= 29,
 	IDPF_HASH_NONF_MULTICAST_IPV4_UDP,
 	IDPF_HASH_NONF_IPV4_UDP,
 	IDPF_HASH_NONF_IPV4_TCP_SYN_NO_ACK,
@@ -19,7 +19,7 @@ enum idpf_rss_hash {
 	IDPF_HASH_NONF_IPV4_OTHER,
 	IDPF_HASH_FRAG_IPV4,
 	/* Values 37-38 are reserved */
-	IDPF_HASH_NONF_UNICAST_IPV6_UDP	= 39,
+	IDPF_HASH_NONF_UNICAST_IPV6_UDP		= 39,
 	IDPF_HASH_NONF_MULTICAST_IPV6_UDP,
 	IDPF_HASH_NONF_IPV6_UDP,
 	IDPF_HASH_NONF_IPV6_TCP_SYN_NO_ACK,
@@ -32,22 +32,23 @@ enum idpf_rss_hash {
 	IDPF_HASH_NONF_FCOE_RX,
 	IDPF_HASH_NONF_FCOE_OTHER,
 	/* Values 51-62 are reserved */
-	IDPF_HASH_L2_PAYLOAD		= 63,
+	IDPF_HASH_L2_PAYLOAD			= 63,
+
 	IDPF_HASH_MAX
 };
 
 /* Supported RSS offloads */
-#define IDPF_DEFAULT_RSS_HASH ( \
-	BIT_ULL(IDPF_HASH_NONF_IPV4_UDP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV4_SCTP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV4_TCP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV4_OTHER) | \
-	BIT_ULL(IDPF_HASH_FRAG_IPV4) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV6_UDP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV6_TCP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV6_SCTP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV6_OTHER) | \
-	BIT_ULL(IDPF_HASH_FRAG_IPV6) | \
+#define IDPF_DEFAULT_RSS_HASH			\
+	(BIT_ULL(IDPF_HASH_NONF_IPV4_UDP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV4_SCTP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV4_TCP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV4_OTHER) |	\
+	BIT_ULL(IDPF_HASH_FRAG_IPV4) |		\
+	BIT_ULL(IDPF_HASH_NONF_IPV6_UDP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV6_TCP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV6_SCTP) |	\
+	BIT_ULL(IDPF_HASH_NONF_IPV6_OTHER) |	\
+	BIT_ULL(IDPF_HASH_FRAG_IPV6) |		\
 	BIT_ULL(IDPF_HASH_L2_PAYLOAD))
 
 	/* TODO: Wrap below comment under internal flag
@@ -55,11 +56,11 @@ enum idpf_rss_hash {
 	 * They are supported by FPK and future products
 	 */
 #define IDPF_DEFAULT_RSS_HASH_EXPANDED (IDPF_DEFAULT_RSS_HASH | \
-	BIT_ULL(IDPF_HASH_NONF_IPV4_TCP_SYN_NO_ACK) | \
-	BIT_ULL(IDPF_HASH_NONF_UNICAST_IPV4_UDP) | \
-	BIT_ULL(IDPF_HASH_NONF_MULTICAST_IPV4_UDP) | \
-	BIT_ULL(IDPF_HASH_NONF_IPV6_TCP_SYN_NO_ACK) | \
-	BIT_ULL(IDPF_HASH_NONF_UNICAST_IPV6_UDP) | \
+	BIT_ULL(IDPF_HASH_NONF_IPV4_TCP_SYN_NO_ACK) |		\
+	BIT_ULL(IDPF_HASH_NONF_UNICAST_IPV4_UDP) |		\
+	BIT_ULL(IDPF_HASH_NONF_MULTICAST_IPV4_UDP) |		\
+	BIT_ULL(IDPF_HASH_NONF_IPV6_TCP_SYN_NO_ACK) |		\
+	BIT_ULL(IDPF_HASH_NONF_UNICAST_IPV6_UDP) |		\
 	BIT_ULL(IDPF_HASH_NONF_MULTICAST_IPV6_UDP))
 
 /* For idpf_splitq_base_tx_compl_desc */
diff --git a/drivers/common/idpf/base/idpf_lan_vf_regs.h b/drivers/common/idpf/base/idpf_lan_vf_regs.h
index b5ff9b2cc9..4c5249129e 100644
--- a/drivers/common/idpf/base/idpf_lan_vf_regs.h
+++ b/drivers/common/idpf/base/idpf_lan_vf_regs.h
@@ -94,14 +94,23 @@
  * b/w itrn registers of the same vector
  */
 #define VF_INT_ITR0(_ITR)		(0x00004C00 + ((_ITR) * 4))
-#define VF_INT_ITRN_ADDR(_ITR, _reg_start, _itrn_indx_spacing) \
-		 ((_reg_start) + (((_ITR)) * (_itrn_indx_spacing)))
-/* For VF with 16 vector support, itrn_reg_spacing is 0x4 and itrn_indx_spacing is 0x40 */
-#define VF_INT_ITRN(_INT, _ITR)	(0x00002800 + ((_INT) * 4) + ((_ITR) * 0x40))
-/* For VF with 64 vector support, itrn_reg_spacing is 0x4 and itrn_indx_spacing is 0x100 */
-#define VF_INT_ITRN_64(_INT, _ITR) (0x00002C00 + ((_INT) * 4) + ((_ITR) * 0x100))
-/* For VF with 2k vector support, itrn_reg_spacing is 0x4 and itrn_indx_spacing is 0x2000 */
-#define VF_INT_ITRN_2K(_INT, _ITR) (0x00072000 + ((_INT) * 4) + ((_ITR) * 0x2000))
+#define VF_INT_ITRN_ADDR(_ITR, _reg_start, _itrn_indx_spacing)  \
+	((_reg_start) + ((_ITR) * (_itrn_indx_spacing)))
+/* For VF with 16 vector support, itrn_reg_spacing is 0x4, itrn_indx_spacing
+ * is 0x40 and base register offset is 0x00002800
+ */
+#define VF_INT_ITRN(_INT, _ITR)			\
+	(0x00002800 + ((_INT) * 4) + ((_ITR) * 0x40))
+/* For VF with 64 vector support, itrn_reg_spacing is 0x4, itrn_indx_spacing
+ * is 0x100 and base register offset is 0x00002C00
+ */
+#define VF_INT_ITRN_64(_INT, _ITR)	\
+	(0x00002C00 + ((_INT) * 4) + ((_ITR) * 0x100))
+/* For VF with 2k vector support, itrn_reg_spacing is 0x4, itrn_indx_spacing
+ * is 0x2000 and base register offset is 0x00072000
+ */
+#define VF_INT_ITRN_2K(_INT, _ITR)	\
+	(0x00072000 + ((_INT) * 4) + ((_ITR) * 0x2000))
 #define VF_INT_ITRN_MAX_INDEX		2
 #define VF_INT_ITRN_INTERVAL_S		0
 #define VF_INT_ITRN_INTERVAL_M		IDPF_M(0xFFF, VF_INT_ITRN_INTERVAL_S)
-- 
2.34.1


  parent reply	other threads:[~2023-08-09  1:34 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  1:32 [PATCH 00/14] update idpf base code Wenjing Qiao
2023-08-09  1:32 ` [PATCH 01/14] common/idpf/base: enable support for physical port stats Wenjing Qiao
2023-08-09  1:32 ` [PATCH 02/14] common/idpf/base: add miss completion capabilities Wenjing Qiao
2023-08-09  1:32 ` [PATCH 03/14] common/idpf/base: initial PTP support Wenjing Qiao
2023-08-09  2:22   ` Liu, Mingxia
2023-08-09  1:32 ` [PATCH 04/14] common/idpf/base: remove mailbox registers Wenjing Qiao
2023-08-09  1:32 ` [PATCH 05/14] common/idpf/base: add some adi specific fields Wenjing Qiao
2023-08-09  1:33 ` [PATCH 06/14] common/idpf/base: add necessary check Wenjing Qiao
2023-08-09  1:33 ` [PATCH 07/14] common/idpf/base: add union for SW cookie fields in ctlq msg Wenjing Qiao
2023-08-09  1:33 ` [PATCH 08/14] common/idpf/base: define non-flexible size structure for ADI Wenjing Qiao
2023-08-09  1:33 ` [PATCH 09/14] common/idpf/base: use local pointer before updating 'CQ out' Wenjing Qiao
2023-08-09  1:33 ` [PATCH 10/14] common/idpf/base: use 'void' return type Wenjing Qiao
2023-08-09  1:33 ` [PATCH 11/14] common/idpf/base: refactor descriptor 'ret val' stripping Wenjing Qiao
2023-08-09  1:33 ` Wenjing Qiao [this message]
2023-08-09  1:33 ` [PATCH 13/14] common/idpf/base: use GENMASK macro Wenjing Qiao
2023-08-09  1:33 ` [PATCH 14/14] common/idpf/base: use 'type functionname(args)' style Wenjing Qiao
2023-08-25 10:13 ` [PATCH v2 00/17] update idpf base code Simei Su
2023-08-25 10:13   ` [PATCH v2 01/17] common/idpf/base: enable support for physical port stats Simei Su
2023-08-25 10:13   ` [PATCH v2 02/17] common/idpf/base: add miss completion capabilities Simei Su
2023-08-25 10:13   ` [PATCH v2 03/17] common/idpf/base: initial PTP support Simei Su
2023-08-25 10:13   ` [PATCH v2 04/17] common/idpf/base: remove mailbox registers Simei Su
2023-08-25 10:13   ` [PATCH v2 05/17] common/idpf/base: add some adi specific fields Simei Su
2023-08-25 10:13   ` [PATCH v2 06/17] common/idpf/base: add necessary check Simei Su
2023-08-25 10:13   ` [PATCH v2 07/17] common/idpf/base: add union for SW cookie fields in ctlq msg Simei Su
2023-08-25 10:13   ` [PATCH v2 08/17] common/idpf/base: define non-flexible size structure for ADI Simei Su
2023-08-25 10:13   ` [PATCH v2 09/17] common/idpf/base: use local pointer before updating 'CQ out' Simei Su
2023-08-25 10:13   ` [PATCH v2 10/17] common/idpf/base: use 'void' return type Simei Su
2023-08-25 10:13   ` [PATCH v2 11/17] common/idpf/base: refactor descriptor 'ret val' stripping Simei Su
2023-08-25 10:13   ` [PATCH v2 12/17] common/idpf/base: refine comments and alignment Simei Su
2023-08-25 10:13   ` [PATCH v2 13/17] common/idpf/base: use GENMASK macro Simei Su
2023-08-25 10:13   ` [PATCH v2 14/17] common/idpf/base: use 'type functionname(args)' style Simei Su
2023-08-25 10:13   ` [PATCH v2 15/17] common/idpf/base: dont declare union with 'flex' Simei Su
2023-08-25 10:13   ` [PATCH v2 16/17] common/idpf/base: remove unused Tx descriptor types Simei Su
2023-08-25 10:13   ` [PATCH v2 17/17] common/idpf/base: update version Simei Su
2023-09-15  2:17   ` [PATCH v3 00/17] update idpf base code Simei Su
2023-09-15  2:17     ` [PATCH v3 01/17] common/idpf/base: enable support for physical port stats Simei Su
2023-09-15  2:17     ` [PATCH v3 02/17] common/idpf/base: add miss completion capabilities Simei Su
2023-09-15  2:17     ` [PATCH v3 03/17] common/idpf/base: initial PTP support Simei Su
2023-09-15  2:17     ` [PATCH v3 04/17] common/idpf/base: remove mailbox registers Simei Su
2023-09-15  2:17     ` [PATCH v3 05/17] common/idpf/base: add some adi specific fields Simei Su
2023-09-15  2:17     ` [PATCH v3 06/17] common/idpf/base: add necessary check Simei Su
2023-09-15  2:17     ` [PATCH v3 07/17] common/idpf/base: add union for SW cookie fields in ctlq msg Simei Su
2023-09-15  2:17     ` [PATCH v3 08/17] common/idpf/base: define non-flexible size structure for ADI Simei Su
2023-09-15  2:17     ` [PATCH v3 09/17] common/idpf/base: use local pointer before updating 'CQ out' Simei Su
2023-09-15  2:17     ` [PATCH v3 10/17] common/idpf/base: use 'void' return type Simei Su
2023-09-15  2:17     ` [PATCH v3 11/17] common/idpf/base: refactor descriptor 'ret val' stripping Simei Su
2023-09-15  2:17     ` [PATCH v3 12/17] common/idpf/base: refine comments and alignment Simei Su
2023-09-15  2:17     ` [PATCH v3 13/17] common/idpf/base: use GENMASK macro Simei Su
2023-09-15  2:17     ` [PATCH v3 14/17] common/idpf/base: use 'type functionname(args)' style Simei Su
2023-09-15  2:17     ` [PATCH v3 15/17] common/idpf/base: don't declare union with 'flex' Simei Su
2023-09-15  2:17     ` [PATCH v3 16/17] common/idpf/base: remove unused Tx descriptor types Simei Su
2023-09-15  2:17     ` [PATCH v3 17/17] common/idpf/base: update version Simei Su
2023-09-15  5:44     ` [PATCH v3 00/17] update idpf base code Xing, Beilei
2023-09-18  2:11     ` [PATCH v4 00/18] " Simei Su
2023-09-18  2:11       ` [PATCH v4 01/18] common/idpf: refactor single queue Tx data path Simei Su
2023-09-18  2:11       ` [PATCH v4 02/18] common/idpf/base: enable support for physical port stats Simei Su
2023-09-18  2:11       ` [PATCH v4 03/18] common/idpf/base: add miss completion capabilities Simei Su
2023-09-18  2:11       ` [PATCH v4 04/18] common/idpf/base: initial PTP support Simei Su
2023-09-18  2:11       ` [PATCH v4 05/18] common/idpf/base: remove mailbox registers Simei Su
2023-09-18  2:11       ` [PATCH v4 06/18] common/idpf/base: add some adi specific fields Simei Su
2023-09-18  2:11       ` [PATCH v4 07/18] common/idpf/base: add necessary check Simei Su
2023-09-18  2:11       ` [PATCH v4 08/18] common/idpf/base: add union for SW cookie fields in ctlq msg Simei Su
2023-09-18  2:11       ` [PATCH v4 09/18] common/idpf/base: define non-flexible size structure for ADI Simei Su
2023-09-18  2:11       ` [PATCH v4 10/18] common/idpf/base: use local pointer before updating 'CQ out' Simei Su
2023-09-18  2:11       ` [PATCH v4 11/18] common/idpf/base: use 'void' return type Simei Su
2023-09-18  2:11       ` [PATCH v4 12/18] common/idpf/base: refactor descriptor 'ret val' stripping Simei Su
2023-09-18  2:11       ` [PATCH v4 13/18] common/idpf/base: refine comments and alignment Simei Su
2023-09-18  2:11       ` [PATCH v4 14/18] common/idpf/base: use GENMASK macro Simei Su
2023-09-18  2:11       ` [PATCH v4 15/18] common/idpf/base: use 'type functionname(args)' style Simei Su
2023-09-18  2:11       ` [PATCH v4 16/18] common/idpf/base: don't declare union with 'flex' Simei Su
2023-09-18  2:11       ` [PATCH v4 17/18] common/idpf/base: remove unused Tx descriptor types Simei Su
2023-09-18  2:11       ` [PATCH v4 18/18] common/idpf/base: update version Simei Su
2023-09-20  6:22       ` [PATCH v5 00/11] update idpf base code Simei Su
2023-09-20  6:22         ` [PATCH v5 01/11] common/idpf: refactor single queue Tx data path Simei Su
2023-09-20  6:22         ` [PATCH v5 02/11] common/idpf/base: enable support for physical port stats Simei Su
2023-09-20  6:22         ` [PATCH v5 03/11] common/idpf/base: add miss completion capabilities Simei Su
2023-09-20  6:22         ` [PATCH v5 04/11] common/idpf/base: initialize PTP support Simei Su
2023-09-20  6:22         ` [PATCH v5 05/11] common/idpf/base: remove mailbox registers Simei Su
2023-09-20  6:22         ` [PATCH v5 06/11] common/idpf/base: refine structure and necessary check Simei Su
2023-09-20  6:22         ` [PATCH v5 07/11] common/idpf/base: add union for SW cookie fields Simei Su
2023-09-20  6:22         ` [PATCH v5 08/11] common/idpf/base: refine code and alignments Simei Su
2023-09-20  6:22         ` [PATCH v5 09/11] common/idpf/base: use GENMASK macro Simei Su
2023-09-20  6:22         ` [PATCH v5 10/11] common/idpf/base: remove unused Tx descriptor types Simei Su
2023-09-20  6:22         ` [PATCH v5 11/11] common/idpf/base: update version Simei Su
2023-09-21  1:21         ` [PATCH v5 00/11] update idpf base code Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230809013308.1449103-13-wenjing.qiao@intel.com \
    --to=wenjing.qiao@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=mingxia.liu@intel.com \
    --cc=pavan.kumar.linga@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=simei.su@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).