patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>,
	Amit Prakash Shukla <amitprakashs@marvell.com>, <stable@dpdk.org>,
	Radha Mohan Chintakuntla <radhac@marvell.com>
Subject: [PATCH v5 01/12] common/cnxk: use unique name for DPI memzone
Date: Wed, 23 Aug 2023 16:45:14 +0530	[thread overview]
Message-ID: <20230823111525.3975662-1-amitprakashs@marvell.com> (raw)
In-Reply-To: <20230821174942.3165191-1-amitprakashs@marvell.com>

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>
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
v2:
- Fix for bugs observed in v1.
- Squashed few commits.

v3:
- Resolved review suggestions.
- Code improvement.

v4:
- Resolved checkpatch warnings.

v5:
- Updated commit message.
- Split the commits.

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

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;
-- 
2.25.1


  parent reply	other threads:[~2023-08-23 11:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230731121225.1545318-1-amitprakashs@marvell.com>
2023-08-18  9:01 ` [PATCH v3 1/8] " Amit Prakash Shukla
2023-08-18  9:01   ` [PATCH v3 2/8] dma/cnxk: changes for dmadev driver Amit Prakash Shukla
2023-08-21 13:27   ` [PATCH v3 1/8] common/cnxk: use unique name for DPI memzone Jerin Jacob
2023-08-21 17:49   ` [PATCH v4 " Amit Prakash Shukla
2023-08-21 17:49     ` [PATCH v4 2/8] dma/cnxk: changes for dmadev driver Amit Prakash Shukla
2023-08-23 11:15     ` Amit Prakash Shukla [this message]
2023-08-23 11:15       ` [PATCH v5 03/12] dma/cnxk: set dmadev to ready state Amit Prakash Shukla
2023-08-23 11:15       ` [PATCH v5 04/12] dma/cnxk: flag support for dma device Amit Prakash Shukla
2023-08-23 11:15       ` [PATCH v5 05/12] dma/cnxk: allocate completion ring buffer Amit Prakash Shukla
2023-08-23 11:15       ` [PATCH v5 06/12] dma/cnxk: chunk buffer failure return code Amit Prakash Shukla
2023-08-23 11:15       ` [PATCH v5 11/12] dma/cnxk: add completion ring tail wrap check Amit Prakash Shukla
2023-08-23 15:30       ` [PATCH v5 01/12] common/cnxk: use unique name for DPI memzone Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230823111525.3975662-1-amitprakashs@marvell.com \
    --to=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=radhac@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).