Skip to contentSkip to conversation

common/cnxk: fix aura offset

PATCH In review Nawal Kishor 2 participants 5 messages Mar 4, 2025 – Mar 27, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: fix aura offset

Fix aura offset in NPA_LF_POOL_OP_INT.

Fixes 620fc02bf7eb ("common/cnxk: accommodate change in aura field width")
---
 drivers/common/cnxk/roc_npa_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_npa_irq.c +4 -3
index 0a19319ebf..9505194207 100644
@@ -104,14 +104,15 @@ static inline uint8_t
 npa_q_irq_get_and_clear(struct npa_lf *lf, uint32_t q, uint32_t off,
 			uint64_t mask)
 {
-	uint64_t reg, wdata;
+	uint64_t reg, wdata, shift;
 	uint8_t qint;
 
-	wdata = (uint64_t)q << 44;
+	shift = roc_model_is_cn20k() ? 47 : 44;
+	wdata = (uint64_t)q << shift;
 	reg = roc_atomic64_add_nosync(wdata, (int64_t *)(lf->base + off));
 
 	if (reg & BIT_ULL(42) /* OP_ERR */) {
-		plt_err("Failed execute irq get off=0x%x", off);
+		plt_err("Failed execute irq get off=0x%x reg=0x%lx", off, reg);
 		return 0;
 	}
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Nawal Kishor <[email protected]>
Sent: Tuesday, March 4, 2025 10:52 AM
To: [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>; Ashwin Sekhar T K <[email protected]>
Cc: Jerin Jacob <[email protected]>; Nawal Kishor <[email protected]>
Subject: [PATCH] common/cnxk: fix aura offset

Quoted 1 line

Fix aura offset in NPA_LF_POOL_OP_INT.

Please add more description.

Quoted 3 lines
Fixes 620fc02bf7eb ("common/cnxk: accommodate change in aura field

width")

Fix the following

Is it candidate for Cc: [email protected] backport?
common/cnxk: fix aura offset

Invalid patch(es) found - checked 1 patch
check-git-log failed

### [PATCH] common/cnxk: fix aura offset

Warning in drivers/common/cnxk/roc_npa_irq.c:
Using %l format, prefer %PRI*64 if type is [u]int64_t

Quoted 32 lines
---
 drivers/common/cnxk/roc_npa_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_npa_irq.c +4 -4
index 0a19319ebf..9505194207 100644
@@ -104,14 +104,15 @@ static inline uint8_t  npa_q_irq_get_and_clear(struct
 npa_lf *lf, uint32_t q, uint32_t off,
 			uint64_t mask)
 {
-	uint64_t reg, wdata;
+	uint64_t reg, wdata, shift;
 	uint8_t qint;
 
-	wdata = (uint64_t)q << 44;
+	shift = roc_model_is_cn20k() ? 47 : 44;
+	wdata = (uint64_t)q << shift;
 	reg = roc_atomic64_add_nosync(wdata, (int64_t *)(lf->base + off));
 
 	if (reg & BIT_ULL(42) /* OP_ERR */) {
-		plt_err("Failed execute irq get off=0x%x", off);
+		plt_err("Failed execute irq get off=0x%x reg=0x%lx", off, reg);
 		return 0;
 	}
 
--

2.34.1

#2 lore raw

PATCH 1/1 common/cnxk: fix aura offset

In reply to Nawal Kishor

Aura field width has reduced from 20 bits in cn10k/cn9k to 17 bits in cn20k. Adjust the setting of aura offset in NPA_LF_POOL_OP_INT register accordingly based on the platform.

Fixes 620fc02bf7eb ("common/cnxk: accommodate change in aura field width")
---
 drivers/common/cnxk/roc_npa_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_npa_irq.c +4 -3
index 0a19319ebf..3142a40c8c 100644
@@ -104,14 +104,15 @@ static inline uint8_t
 npa_q_irq_get_and_clear(struct npa_lf *lf, uint32_t q, uint32_t off,
 			uint64_t mask)
 {
-	uint64_t reg, wdata;
+	uint64_t reg, wdata, shift;
 	uint8_t qint;
 
-	wdata = (uint64_t)q << 44;
+	shift = roc_model_is_cn20k() ? 47 : 44;
+	wdata = (uint64_t)q << shift;
 	reg = roc_atomic64_add_nosync(wdata, (int64_t *)(lf->base + off));
 
 	if (reg & BIT_ULL(42) /* OP_ERR */) {
-		plt_err("Failed execute irq get off=0x%x", off);
+		plt_err("Failed execute irq get off=0x%x reg=0x%" PRIu64, off, reg);
 		return 0;
 	}
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 1/1 common/cnxk: fix aura offset

In reply to Nawal Kishor

Aura field width has reduced from 20 bits in cn10k/cn9k to 17 bits in cn20k. Adjust the setting of aura offset in NPA_LF_POOL_OP_INT register accordingly based on the platform.

Fixes 620fc02bf7eb ("common/cnxk: accommodate change in aura field width")

---
Changes in v3: Fixed checkpatch warnings.

 drivers/common/cnxk/roc_npa_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/common/cnxk/roc_npa_irq.c +4 -3
index 0a19319ebf..3142a40c8c 100644
@@ -104,14 +104,15 @@ static inline uint8_t
 npa_q_irq_get_and_clear(struct npa_lf *lf, uint32_t q, uint32_t off,
 			uint64_t mask)
 {
-	uint64_t reg, wdata;
+	uint64_t reg, wdata, shift;
 	uint8_t qint;
 
-	wdata = (uint64_t)q << 44;
+	shift = roc_model_is_cn20k() ? 47 : 44;
+	wdata = (uint64_t)q << shift;
 	reg = roc_atomic64_add_nosync(wdata, (int64_t *)(lf->base + off));
 
 	if (reg & BIT_ULL(42) /* OP_ERR */) {
-		plt_err("Failed execute irq get off=0x%x", off);
+		plt_err("Failed execute irq get off=0x%x reg=0x%" PRIu64, off, reg);
 		return 0;
 	}
 
Signature · 1 line
2.34.1
#4 lore raw
Quoted 13 lines

-----Original Message-----
From: Nawal Kishor <[email protected]>
Sent: Monday, March 24, 2025 12:05 PM
To: [email protected]; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Harman Kalra <[email protected]>; Ashwin Sekhar T K <[email protected]>
Cc: Jerin Jacob <[email protected]>; Nawal Kishor <[email protected]>
Subject: [PATCH v3] common/cnxk: fix aura offset

Quoted 8 lines

Aura field width has reduced from 20 bits in cn10k/cn9k to 17 bits in cn20k. Adjust the setting of aura offset in NPA_LF_POOL_OP_INT register accordingly based on the platform.

Fixes 620fc02bf7eb ("common/cnxk: accommodate change in aura field

width")

Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-main. Thanks