DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: <dev@dpdk.org>, <ferruh.yigit@intel.com>
Cc: Rasesh Mody <rasesh.mody@cavium.com>, <stable@dpdk.org>,
	<Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH v2 10/21] net/qede/base: add attention bits for AH chip
Date: Fri, 17 Mar 2017 23:53:25 -0700	[thread overview]
Message-ID: <1489820014-13279-1-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <2152c44b-3013-b709-16c0-cdef9c20fce2@intel.com>

add attention bits for CHIP_NUM_AH_xxx

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_int.c |   77 +++++++++++++++++++++++++++++++------
 1 file changed, 65 insertions(+), 12 deletions(-)

diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index 3d6c2f1..cb719a3 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -59,6 +59,11 @@ struct aeu_invert_reg_bit {
 #define ATTENTION_OFFSET_MASK		(0x000ff000)
 #define ATTENTION_OFFSET_SHIFT		(12)
 
+#define ATTENTION_BB_MASK		(0x00700000)
+#define ATTENTION_BB_SHIFT		(20)
+#define ATTENTION_BB(value)		((value) << ATTENTION_BB_SHIFT)
+#define ATTENTION_BB_DIFFERENT		(1 << 23)
+
 #define	ATTENTION_CLEAR_ENABLE		(1 << 28)
 	unsigned int flags;
 
@@ -468,7 +473,26 @@ static enum _ecore_status_t ecore_tm_attn_cb(struct ecore_hwfn *p_hwfn)
 	return ECORE_INVAL;
 }
 
-/* Notice aeu_invert_reg must be defined in the same order of bits as HW;  */
+/* Instead of major changes to the data-structure, we have a some 'special'
+ * identifiers for sources that changed meaning between adapters.
+ */
+enum aeu_invert_reg_special_type {
+	AEU_INVERT_REG_SPECIAL_CNIG_0,
+	AEU_INVERT_REG_SPECIAL_CNIG_1,
+	AEU_INVERT_REG_SPECIAL_CNIG_2,
+	AEU_INVERT_REG_SPECIAL_CNIG_3,
+	AEU_INVERT_REG_SPECIAL_MAX,
+};
+
+static struct aeu_invert_reg_bit
+aeu_descs_special[AEU_INVERT_REG_SPECIAL_MAX] = {
+	{"CNIG port 0", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+	{"CNIG port 1", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+	{"CNIG port 2", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+	{"CNIG port 3", ATTENTION_SINGLE, OSAL_NULL, BLOCK_CNIG},
+};
+
+/* Notice aeu_invert_reg must be defined in the same order of bits as HW; */
 static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
 	{
 	 {			/* After Invert 1 */
@@ -511,8 +535,18 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
 	   OSAL_NULL, MAX_BLOCK_ID},
 	  {"General Attention 35", ATTENTION_SINGLE | ATTENTION_CLEAR_ENABLE,
 	   ecore_general_attention_35, MAX_BLOCK_ID},
-	  {"CNIG port %d", (4 << ATTENTION_LENGTH_SHIFT), OSAL_NULL,
-	   BLOCK_CNIG},
+	  {"NWS Parity", ATTENTION_PAR | ATTENTION_BB_DIFFERENT |
+			 ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_0),
+			 OSAL_NULL, BLOCK_NWS},
+	  {"NWS Interrupt", ATTENTION_SINGLE | ATTENTION_BB_DIFFERENT |
+			    ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_1),
+			    OSAL_NULL, BLOCK_NWS},
+	  {"NWM Parity", ATTENTION_PAR | ATTENTION_BB_DIFFERENT |
+			 ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_2),
+			 OSAL_NULL, BLOCK_NWM},
+	  {"NWM Interrupt", ATTENTION_SINGLE | ATTENTION_BB_DIFFERENT |
+			    ATTENTION_BB(AEU_INVERT_REG_SPECIAL_CNIG_3),
+			    OSAL_NULL, BLOCK_NWM},
 	  {"MCP CPU", ATTENTION_SINGLE, ecore_mcp_attn_cb, MAX_BLOCK_ID},
 	  {"MCP Watchdog timer", ATTENTION_SINGLE, OSAL_NULL, MAX_BLOCK_ID},
 	  {"MCP M2P", ATTENTION_SINGLE, OSAL_NULL, MAX_BLOCK_ID},
@@ -634,6 +668,27 @@ static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
 
 };
 
+static struct aeu_invert_reg_bit *
+ecore_int_aeu_translate(struct ecore_hwfn *p_hwfn,
+			struct aeu_invert_reg_bit *p_bit)
+{
+	if (!ECORE_IS_BB(p_hwfn->p_dev))
+		return p_bit;
+
+	if (!(p_bit->flags & ATTENTION_BB_DIFFERENT))
+		return p_bit;
+
+	return &aeu_descs_special[(p_bit->flags & ATTENTION_BB_MASK) >>
+				  ATTENTION_BB_SHIFT];
+}
+
+static bool ecore_int_is_parity_flag(struct ecore_hwfn *p_hwfn,
+				     struct aeu_invert_reg_bit *p_bit)
+{
+	return !!(ecore_int_aeu_translate(p_hwfn, p_bit)->flags &
+		  ATTENTION_PARITY);
+}
+
 #define ATTN_STATE_BITS		(0xfff)
 #define ATTN_BITS_MASKABLE	(0x3ff)
 struct ecore_sb_attn_info {
@@ -868,7 +923,7 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
 		for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
 			struct aeu_invert_reg_bit *p_bit = &p_aeu->bits[j];
 
-			if ((p_bit->flags & ATTENTION_PARITY) &&
+			if (ecore_int_is_parity_flag(p_hwfn, p_bit) &&
 			    !!(parities & (1 << bit_idx))) {
 				ecore_int_deassertion_parity(p_hwfn, p_bit,
 							     bit_idx);
@@ -905,15 +960,12 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
 				unsigned long int bitmask;
 				u8 bit, bit_len;
 
+				/* Need to account bits with changed meaning */
 				p_aeu = &sb_attn_sw->p_aeu_desc[i].bits[j];
 
-				/* No need to handle attention-only bits */
-				if (p_aeu->flags == ATTENTION_PAR)
-					continue;
-
 				bit = bit_idx;
 				bit_len = ATTENTION_LENGTH(p_aeu->flags);
-				if (p_aeu->flags & ATTENTION_PAR) {
+				if (ecore_int_is_parity_flag(p_hwfn, p_aeu)) {
 					/* Skip Parity */
 					bit++;
 					bit_len--;
@@ -1215,12 +1267,13 @@ static void ecore_int_sb_attn_init(struct ecore_hwfn *p_hwfn,
 	for (i = 0; i < NUM_ATTN_REGS; i++) {
 		/* j is array index, k is bit index */
 		for (j = 0, k = 0; k < 32; j++) {
-			unsigned int flags = aeu_descs[i].bits[j].flags;
+			struct aeu_invert_reg_bit *p_aeu;
 
-			if (flags & ATTENTION_PARITY)
+			p_aeu = &aeu_descs[i].bits[j];
+			if (ecore_int_is_parity_flag(p_hwfn, p_aeu))
 				sb_info->parity_mask[i] |= 1 << k;
 
-			k += ATTENTION_LENGTH(flags);
+			k += ATTENTION_LENGTH(p_aeu->flags);
 		}
 		DP_VERBOSE(p_hwfn, ECORE_MSG_INTR,
 			   "Attn Mask [Reg %d]: 0x%08x\n",
-- 
1.7.10.3

  parent reply	other threads:[~2017-03-18  6:54 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  7:51 [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 02/21] net/qede/base: fix to set pointers to NULL after freeing Rasesh Mody
2017-03-02 13:05   ` Ferruh Yigit
2017-03-18  7:02     ` Mody, Rasesh
2017-02-27  7:51 ` [dpdk-dev] [PATCH 03/21] net/qede/base: fix forcing driver default resc allocation Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 04/21] net/qede/base: fix TM block ILT initialization Rasesh Mody
2017-03-02 13:05   ` Ferruh Yigit
2017-02-27  7:51 ` [dpdk-dev] [PATCH 05/21] net/qede/base: fix printout Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 06/21] net/qede/base: fix VF init after malicious VF FLR Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 07/21] net/qede/base: fix numbering l2 VF queues Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 08/21] net/qede/base: fix printing incorrect index for multi-bit attentions Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 09/21] dev/qede/base: fix to prevent VF promisc Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 10/21] net/qede/base: add attention bits for CHIP_NUM_AH_xxx Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 11/21] net/qede/base: fix printout Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 12/21] net/qede/base: fix DORQ attention mask Rasesh Mody
2017-03-02 13:06   ` Ferruh Yigit
2017-02-27  7:51 ` [dpdk-dev] [PATCH 13/21] net/qede/base: fix out-of-bound memory access Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 14/21] net/qede/base: fix to remove redundant memset Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 15/21] net/qede/base: fix remove the unneeded convertion to LE Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 16/21] net/qede/base: fix first VF index calculation Rasesh Mody
2017-02-27  7:51 ` [dpdk-dev] [PATCH 17/21] net/qede/base: fix typo Rasesh Mody
2017-02-27  7:52 ` [dpdk-dev] [PATCH 18/21] net/qede/base: semantic fix Rasesh Mody
2017-03-02 13:06   ` Ferruh Yigit
2017-02-27  7:52 ` [dpdk-dev] [PATCH 19/21] net/qede/base: fix sriov typo Rasesh Mody
2017-02-27  7:52 ` [dpdk-dev] [PATCH 20/21] net/qede/base: fix the value of RESOURCE_DUMP to 0 Rasesh Mody
2017-03-02 13:07   ` Ferruh Yigit
2017-02-27  7:52 ` [dpdk-dev] [PATCH 21/21] net/qede/base: fix to use NULL pointer Rasesh Mody
2017-03-02 13:04 ` [dpdk-dev] [PATCH 01/21] net/qede/base: fix incorrect typecasting of flag Ferruh Yigit
2017-03-06 20:02   ` Mody, Rasesh
2017-03-18  6:48   ` [dpdk-dev] [PATCH v2 " Rasesh Mody
2017-03-20 17:15     ` Ferruh Yigit
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 02/21] net/qede/base: fix to set pointers to NULL after freeing Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 03/21] net/qede/base: fix forcing driver default resc allocation Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 04/21] net/qede/base: fix TM block ILT initialization Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 05/21] net/qede/base: fix printout Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 06/21] net/qede/base: fix VF init after malicious VF FLR Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 07/21] net/qede/base: fix numbering L2 VF queues Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 08/21] net/qede/base: fix index printing of multi-bit attentions Rasesh Mody
2017-03-18  6:50   ` [dpdk-dev] [PATCH v2 09/21] net/qede/base: fix to prevent VF promisc config Rasesh Mody
2017-03-18  6:53   ` Rasesh Mody [this message]
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 11/21] net/qede/base: fix printout Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 12/21] net/qede/base: fix DORQ attention mask Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 13/21] net/qede/base: fix out-of-bound memory access Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 14/21] net/qede/base: fix to remove redundant memset Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 15/21] net/qede/base: fix remove the unneeded conversion to LE Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 16/21] net/qede/base: fix first VF index calculation Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 17/21] net/qede/base: fix typo Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 18/21] net/qede/base: refactor return path Rasesh Mody
2017-03-18  6:53   ` [dpdk-dev] [PATCH v2 19/21] net/qede/base: fix sriov typo Rasesh Mody
2017-03-18  6:57   ` [dpdk-dev] [PATCH v2 20/21] net/qede/base: fix resource lock minimum value Rasesh Mody
2017-03-18  6:57   ` [dpdk-dev] [PATCH v2 21/21] net/qede/base: fix to use NULL pointer Rasesh Mody

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=1489820014-13279-1-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /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).