From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3AC94430DF; Wed, 23 Aug 2023 13:15:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10378410FB; Wed, 23 Aug 2023 13:15:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 90BE4410F1; Wed, 23 Aug 2023 13:15:42 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37N7AMpP012902; Wed, 23 Aug 2023 04:15:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=CkZmp6R54RWsq+YGGdK2ynHyavscanJmo38w+pMRaAE=; b=eHKV1tny2E1FzeNnFl/c6KtVxlTLL8wP+962wDvcU55iLYeNWHEMtt31GkpGBrYX02jo 06opuNUJT0P44Awj5or8wV9OGtbzlZweiiIUSJkDexoBH6lm8SYWJGj01DjyXfpgQ7Og o/xvf7LtqQoXTLKGWzxqPmd4bAdSp3MTOjrUIYdVRMduSZDbk2ODlgPae1V81pDIxPs8 JI1s73YXU/20PsxFc/I/8E43ypLD4FtMrXvmtKjXQHAeCd6xa12OwyP9uUgDeRKqjWSG QGRlAw4b7SSNEaGnPtTmXWCN9Iv0yR2BkC7/+gFWswqt6YQIanWBQMc3WpW67+aEkthY +g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3sn20ctmcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 23 Aug 2023 04:15:41 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 23 Aug 2023 04:15:39 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 23 Aug 2023 04:15:39 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id 8F4DB3F708A; Wed, 23 Aug 2023 04:15:36 -0700 (PDT) From: Amit Prakash Shukla To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Amit Prakash Shukla , , Radha Mohan Chintakuntla Subject: [PATCH v5 01/12] common/cnxk: use unique name for DPI memzone Date: Wed, 23 Aug 2023 16:45:14 +0530 Message-ID: <20230823111525.3975662-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230821174942.3165191-1-amitprakashs@marvell.com> References: <20230821174942.3165191-1-amitprakashs@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: ETDxJzFbYd_bIiOW0RiPDAEc8M5mTjm0 X-Proofpoint-ORIG-GUID: ETDxJzFbYd_bIiOW0RiPDAEc8M5mTjm0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-23_06,2023-08-22_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Signed-off-by: Amit Prakash Shukla --- 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