[v3,1/8] common/cnxk: use unique name for DPI memzone

Message ID 20230818090159.2597468-1-amitprakashs@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v3,1/8] common/cnxk: use unique name for DPI memzone |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Amit Prakash Shukla Aug. 18, 2023, 9:01 a.m. UTC
  roc_dpi was using vfid as part of name for memzone allocation.
This led to memzone allocation failure in case of multiple
physical functions. vfid is not unique by itself since multiple
physical functions can have the same virtual function indices.
So use complete DBDF as part of memzone name to make it unique.

Fixes: b6e395692b6d ("common/cnxk: add DPI DMA support")
Cc: stable@dpdk.org

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
---
v2:
- Fix for bugs observed in v1.
- Squashed few commits.

v3:
- Resolved review suggestions.
- Code improvement.

 drivers/common/cnxk/roc_dpi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Jerin Jacob Aug. 21, 2023, 1:27 p.m. UTC | #1
On Fri, Aug 18, 2023 at 2:32 PM Amit Prakash Shukla
<amitprakashs@marvell.com> wrote:
>
> roc_dpi was using vfid as part of name for memzone allocation.
> This led to memzone allocation failure in case of multiple
> physical functions. vfid is not unique by itself since multiple
> physical functions can have the same virtual function indices.
> So use complete DBDF as part of memzone name to make it unique.
>
> Fixes: b6e395692b6d ("common/cnxk: add DPI DMA support")
> Cc: stable@dpdk.org
>
> Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>

> ---
> v2:
> - Fix for bugs observed in v1.
> - Squashed few commits.
>
> v3:
> - Resolved review suggestions.
> - Code improvement.


Please fix below issues

Missing 'Fixes' tag:
        dma/cnxk: fix last index return value

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

### [PATCH] common/cnxk: use unique name for DPI memzone

ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch
author 'Amit Prakash Shukla <amitprakashs@marvell.com>'

total: 1 errors, 0 warnings, 13 lines checked

### [PATCH] dma/cnxk: add DMA devops for all models of cn10xxx

ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch
author 'Amit Prakash Shukla <amitprakashs@marvell.com>'

total: 1 errors, 0 warnings, 9 lines checked

6/8 valid patches
  

Patch

diff --git a/drivers/common/cnxk/roc_dpi.c b/drivers/common/cnxk/roc_dpi.c
index 93c8318a3d..0e2f803077 100644
--- a/drivers/common/cnxk/roc_dpi.c
+++ b/drivers/common/cnxk/roc_dpi.c
@@ -81,10 +81,10 @@  roc_dpi_configure(struct roc_dpi *roc_dpi)
 		return rc;
 	}
 
-	snprintf(name, sizeof(name), "dpimem%d", roc_dpi->vfid);
+	snprintf(name, sizeof(name), "dpimem%d:%d:%d:%d", pci_dev->addr.domain, pci_dev->addr.bus,
+		 pci_dev->addr.devid, pci_dev->addr.function);
 	buflen = DPI_CMD_QUEUE_SIZE * DPI_CMD_QUEUE_BUFS;
-	dpi_mz = plt_memzone_reserve_aligned(name, buflen, 0,
-					     DPI_CMD_QUEUE_SIZE);
+	dpi_mz = plt_memzone_reserve_aligned(name, buflen, 0, DPI_CMD_QUEUE_SIZE);
 	if (dpi_mz == NULL) {
 		plt_err("dpi memzone reserve failed");
 		rc = -ENOMEM;