Skip to content

Commit 97d7446

Browse files
Geetha sowjanyagregkh
authored andcommitted
octeontx2-pf: cn10k: Ensure valid pointers are freed to aura
[ Upstream commit c5d731c ] While freeing SQB pointers to aura, driver first memcpy to target address and then triggers lmtst operation to free pointer to the aura. We need to ensure(by adding dmb barrier)that memcpy is finished before pointers are freed to the aura. This patch also adds the missing sq context structure entry in debugfs. Fixes: ef6c8da ("octeontx2-pf: cn10K: Reserve LMTST lines per core") Signed-off-by: Geetha sowjanya <gakula@marvell.com> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 59a3393 commit 97d7446

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,8 @@ static void print_nix_cn10k_sq_ctx(struct seq_file *m,
12241224
seq_printf(m, "W3: head_offset\t\t\t%d\nW3: smenq_next_sqb_vld\t\t%d\n\n",
12251225
sq_ctx->head_offset, sq_ctx->smenq_next_sqb_vld);
12261226

1227+
seq_printf(m, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d\n",
1228+
sq_ctx->smq_next_sq_vld, sq_ctx->smq_pend);
12271229
seq_printf(m, "W4: next_sqb \t\t\t%llx\n\n", sq_ctx->next_sqb);
12281230
seq_printf(m, "W5: tail_sqb \t\t\t%llx\n\n", sq_ctx->tail_sqb);
12291231
seq_printf(m, "W6: smenq_sqb \t\t\t%llx\n\n", sq_ctx->smenq_sqb);

‎drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ static inline void __cn10k_aura_freeptr(struct otx2_nic *pfvf, u64 aura,
603603
size++;
604604
tar_addr |= ((size - 1) & 0x7) << 4;
605605
}
606+
dma_wmb();
606607
memcpy((u64 *)lmt_info->lmt_addr, ptrs, sizeof(u64) * num_ptrs);
607608
/* Perform LMTST flush */
608609
cn10k_lmt_flush(val, tar_addr);

0 commit comments

Comments
 (0)