Skip to contentSkip to conversation

common/cnxk: fix duplicate mbox alloc in NPA aura pool init

PATCH Applied Amiya Ranjan Mohakud 3 participants 5 messages Sep 4 – Sep 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cnxk: fix duplicate mbox alloc in NPA aura pool init

npa_aura_pool_init() allocates the pool init mbox message twice on non-CN20K platforms. The if/else block at line 106-111 allocates via the model-specific branch, but the original unconditional allocation at line 112 was not removed when the CN20K branch was added. This overwrites pool_init_req, and the orphaned first message is sent to the AF with uninitialized aura_id, ctype, and op fields, which can trigger any undesired behavior on CN10K.

Remove the duplicate allocation.

Fixes 143a419edf35 ("common/cnxk: use new NPA aq enq mbox for CN20K")
---
 drivers/common/cnxk/roc_npa.c | 1 -
 1 file changed, 1 deletion(-)
drivers/common/cnxk/roc_npa.c +0 -1
index 4a3e96a97a..87f7637e9f 100644
@@ -110,7 +110,6 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t aura_id, struct npa_aura_s *aura
 	} else {
 		pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
 	}
-	pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
 	if (pool_init_req == NULL)
 		goto exit;
 	pool_init_req->aura_id = aura_id;
Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw

Recheck-request: iol-intel-Performance

Thanks
Amiya

Quoted 36 lines · Amiya Ranjan Mohakud

npa_aura_pool_init() allocates the pool init mbox message twice on non-CN20K platforms. The if/else block at line 106-111 allocates via the model-specific branch, but the original unconditional allocation at line 112 was not removed when the CN20K branch was added. This overwrites pool_init_req, and the orphaned first message is sent to the AF with uninitialized aura_id, ctype, and op fields, which can trigger any undesired behavior on CN10K.

Remove the duplicate allocation.

Fixes 143a419edf35 ("common/cnxk: use new NPA aq enq mbox for CN20K")
---
 drivers/common/cnxk/roc_npa.c | 1 -
 1 file changed, 1 deletion(-)
drivers/common/cnxk/roc_npa.c +0 -0
index 4a3e96a97a..87f7637e9f 100644
@@ -110,7 +110,6 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t

aura_id, struct npa_aura_s *aura

        } else {
                pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
        }
-       pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
        if (pool_init_req == NULL)
                goto exit;
        pool_init_req->aura_id = aura_id;

--
2.39.5 (Apple Git-154)

#2 lore raw

Hi Team

The change-set has no relation to the intel performance test which is failing. Could someone pls guide on how to get rid of this, get it reviewed and merged?

Thanks
Amiya

Quoted 45 lines · Amiya Ranjan Mohakud

Recheck-request: iol-intel-Performance

Thanks
Amiya

Quoted 36 lines · Amiya Ranjan Mohakud

npa_aura_pool_init() allocates the pool init mbox message twice on non-CN20K platforms. The if/else block at line 106-111 allocates via the model-specific branch, but the original unconditional allocation at line 112 was not removed when the CN20K branch was added. This overwrites pool_init_req, and the orphaned first message is sent to the AF with uninitialized aura_id, ctype, and op fields, which can trigger any undesired behavior on CN10K.

Remove the duplicate allocation.

Fixes 143a419edf35 ("common/cnxk: use new NPA aq enq mbox for CN20K")
---
 drivers/common/cnxk/roc_npa.c | 1 -
 1 file changed, 1 deletion(-)
drivers/common/cnxk/roc_npa.c +0 -0
index 4a3e96a97a..87f7637e9f 100644
@@ -110,7 +110,6 @@ npa_aura_pool_init(struct mbox *m_box, uint32_t

aura_id, struct npa_aura_s *aura

        } else {
                pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
        }
-       pool_init_req = mbox_alloc_msg_npa_aq_enq(mbox);
        if (pool_init_req == NULL)
                goto exit;
        pool_init_req->aura_id = aura_id;

--
2.39.5 (Apple Git-154)