Skip to contentSkip to conversation

common/cnxk: handle increased count eot width for cn20k

PATCH Applied Nawal Kishor 2 participants 2 messages Oct 30 – Nov 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: handle increased count eot width for cn20k

The COUNT_EOT field of NPA_LF_AURA_BATCH_FREE0 is 1 bit wide on CN10K and 2 bits wide on CN20K. Extend roc_npa_aura_batch_free() and roc_npa_aura_batch_free_burst() to write the 2-bit field.

Bit 33 is reserved on CN10K and is ignored by the hardware, so the same value can be used on both models.

---
 drivers/common/cnxk/roc_npa.h | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/common/cnxk/roc_npa.h +17 -6
index df68e13ec6..a31f908955 100644
@@ -509,14 +509,20 @@ roc_npa_aura_batch_free(uint64_t aura_handle, uint64_t const *buf,
 	/*
 	 * NPA_LF_AURA_BATCH_FREE0
 	 *
-	 * 63   63 62  33 32       32 31  20 19    0
+	 * 63   63 62  34 33       32 31  20 19    0
 	 * -----------------------------------------
 	 * | FABS | Rsvd | COUNT_EOT | Rsvd | AURA |
 	 * -----------------------------------------
 	 */
 	free0 = roc_npa_aura_handle_to_aura(aura_handle);
-	free0 |= ((uint64_t)!!fabs << 63);
-	free0 |= ((uint64_t)(num & 0x1) << 32);
+	free0 |= ((uint64_t) !!fabs << 63);
+
+	/*
+	 * COUNT_EOT field is 1-bit wide in cn10k and is 2-bit wide in
+	 * cn20k. However we can consider it as 2-bit wide for all cases
+	 * as the upper bit is going to get ignored in cn10k.
+	 */
+	free0 |= ((uint64_t)(num & 0x3) << 32);
 
 	/* tar_addr[4:6] is LMTST size-1 in units of 128b */
 	tar_addr = addr | ((num >> 1) << 4);
@@ -546,14 +552,19 @@ roc_npa_aura_batch_free_burst(uint64_t aura_handle, uint64_t const *buf,
 	       NPA_LF_AURA_BATCH_FREE0;
 	tar_addr = addr | (0x7 << 4);
 
-	/* 63   63 62  33 32       32 31  20 19    0
+	/* 63   63 62  34 33       32 31  20 19    0
 	 * -----------------------------------------
 	 * | FABS | Rsvd | COUNT_EOT | Rsvd | AURA |
 	 * -----------------------------------------
 	 */
 	free0 = roc_npa_aura_handle_to_aura(aura_handle);
-	free0 |= ((uint64_t)!!fabs << 63);
-	free0 |= (0x1UL << 32);
+	free0 |= ((uint64_t) !!fabs << 63);
+	/*
+	 * COUNT_EOT field is 1-bit wide in cn10k and is 2-bit wide in
+	 * cn20k. However we can consider it as 2-bit wide for all cases
+	 * as the upper bit is going to get ignored in cn10k.
+	 */
+	free0 |= (0x3UL << 32);
 
 	/* Fill the lmt lines */
 	lmt_data = (uint64_t *)lmt_addr;
Signature · 1 line
2.48.1
Applied
#1 lore raw
Quoted 9 lines · Nawal Kishor

The COUNT_EOT field of NPA_LF_AURA_BATCH_FREE0 is 1 bit wide on CN10K and 2 bits wide on CN20K. Extend roc_npa_aura_batch_free() and roc_npa_aura_batch_free_burst() to write the 2-bit field.

Bit 33 is reserved on CN10K and is ignored by the hardware, so the same value can be used on both models.

Applied to dpdk-next-net-mrvl/for-main. Thanks

Quoted 58 lines
---
 drivers/common/cnxk/roc_npa.h | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/common/cnxk/roc_npa.h +17 -7
index df68e13ec6..a31f908955 100644
@@ -509,14 +509,20 @@ roc_npa_aura_batch_free(uint64_t aura_handle, uint64_t const *buf,
        /*
         * NPA_LF_AURA_BATCH_FREE0
         *
-        * 63   63 62  33 32       32 31  20 19    0
+        * 63   63 62  34 33       32 31  20 19    0
         * -----------------------------------------
         * | FABS | Rsvd | COUNT_EOT | Rsvd | AURA |
         * -----------------------------------------
         */
        free0 = roc_npa_aura_handle_to_aura(aura_handle);
-       free0 |= ((uint64_t)!!fabs << 63);
-       free0 |= ((uint64_t)(num & 0x1) << 32);
+       free0 |= ((uint64_t) !!fabs << 63);
+
+       /*
+        * COUNT_EOT field is 1-bit wide in cn10k and is 2-bit wide in
+        * cn20k. However we can consider it as 2-bit wide for all cases
+        * as the upper bit is going to get ignored in cn10k.
+        */
+       free0 |= ((uint64_t)(num & 0x3) << 32);
 
        /* tar_addr[4:6] is LMTST size-1 in units of 128b */
        tar_addr = addr | ((num >> 1) << 4);
@@ -546,14 +552,19 @@ roc_npa_aura_batch_free_burst(uint64_t aura_handle, uint64_t const *buf,
               NPA_LF_AURA_BATCH_FREE0;
        tar_addr = addr | (0x7 << 4);
 
-       /* 63   63 62  33 32       32 31  20 19    0
+       /* 63   63 62  34 33       32 31  20 19    0
         * -----------------------------------------
         * | FABS | Rsvd | COUNT_EOT | Rsvd | AURA |
         * -----------------------------------------
         */
        free0 = roc_npa_aura_handle_to_aura(aura_handle);
-       free0 |= ((uint64_t)!!fabs << 63);
-       free0 |= (0x1UL << 32);
+       free0 |= ((uint64_t) !!fabs << 63);
+       /*
+        * COUNT_EOT field is 1-bit wide in cn10k and is 2-bit wide in
+        * cn20k. However we can consider it as 2-bit wide for all cases
+        * as the upper bit is going to get ignored in cn10k.
+        */
+       free0 |= (0x3UL << 32);
 
        /* Fill the lmt lines */
        lmt_data = (uint64_t *)lmt_addr;
--

2.48.1