Skip to content

Commit

Permalink
common/cnxk: fix DPI memzone name
Browse files Browse the repository at this point in the history
[ upstream commit 7ca20b053cb739d021d2ff33a5ba75651048c322 ]

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: b6e3956 ("common/cnxk: add DPI DMA support")

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
  • Loading branch information
Amit Prakash Shukla authored and kevintraynor committed Oct 31, 2023
1 parent a2e1ba5 commit 7c35f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/common/cnxk/roc_dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c35f7b

Please sign in to comment.