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 BFDE5A034C; Mon, 17 Jan 2022 12:30:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 466524014E; Mon, 17 Jan 2022 12:30:51 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id 9BB4540141 for ; Mon, 17 Jan 2022 12:30:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moIsA2Y8KjD1m78phELJRCm3rvv/P/wi++T1I7m44kHIxLzuWlmFXxmrjavo7oCrdrn65l0wUK9r1meqcfB0YOjUhvaz8KzN+bmUxnFmYvepLQ/nLCbzFXpN6D3HgimG3PX495M3Vk8ewZyrO43BhaCWOifhtLYQSOfX2LWRNI8W5LGgR6G2O2Nc87kUqDVD5QHH9Fb6iMAUvYWbMyL3VPeAYguaBFrvlMag9wE8Azy9kmVBFCDRq9+W4cdEFY9tXZchsVDl1ECgHYapIce3NdfPIlv8Snjq/N4BhFeAH41UavGK7jhRCL9OM+hFFlj8Ibjl+27ocdv5acx0Wm4Mag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A7U/tbK4FbRKlh/n9YvitEWt+pWYb4apw2mztMm0MGA=; b=VGZ2Kq8dj+6Px5NChpTHtvK1l0xxkVM5fxm1ZpCwi6DTIexZYGlRklKA3QKXV7PYvu6DCJLWIImaLxpXSswLDoVbM40Eid1dc5NxnrJq/Y9cJvRYYNRI1YkaXN2H58D7Lv5GI/ydZVzTuvpI7DQS7SHK32YFKlssOmtnSYPzaut5p1rGKGbAPr8SRYOp3mPGZSep66Y63DTpjLOdBdtyWl1cbGW3SBP3EyYulhAKUQWpzKd3opCeafpQjQJgNTY8vlcH/HsZUWA9Wz7sd1xCd12YuQ9WFEotXappZbtaHirh+vMpmfnOcIgxro+TRkmsC8wS9cQlDzSnLNuaohOgTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=dpdk.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A7U/tbK4FbRKlh/n9YvitEWt+pWYb4apw2mztMm0MGA=; b=Z6hKAfeUolrwTGhs75CQEi+GLbzX5dgZ9LtUF1BheyM7UY0Yg/u+r5d1CRt5X+wdkG4zruYmRG8kkMez/WrUO5tF+Y4TVzPbszNqRegpJ4p/zN1jrBGhUScwA5FPdBuNGVppesWBUPtLUkRcBgibGpkpIpIUiNtm4PeDOqW5/DU= Received: from DM5PR1101CA0002.namprd11.prod.outlook.com (2603:10b6:4:4c::12) by MW4PR02MB7411.namprd02.prod.outlook.com (2603:10b6:303:7c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Mon, 17 Jan 2022 11:30:48 +0000 Received: from DM3NAM02FT035.eop-nam02.prod.protection.outlook.com (2603:10b6:4:4c:cafe::78) by DM5PR1101CA0002.outlook.office365.com (2603:10b6:4:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend Transport; Mon, 17 Jan 2022 11:30:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT035.mail.protection.outlook.com (10.13.4.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4888.9 via Frontend Transport; Mon, 17 Jan 2022 11:30:47 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 17 Jan 2022 03:30:46 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 17 Jan 2022 03:30:46 -0800 Envelope-to: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com, andrew.rybchenko@oktetlabs.ru Received: from [10.170.66.108] (port=35202 helo=xndengvm004108.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1n9QDl-000DxH-Ga; Mon, 17 Jan 2022 03:30:46 -0800 From: To: CC: , , , , Abhimanyu Saini Subject: [PATCH v2] vdpa/sfc: make MCDI memzone name unique Date: Mon, 17 Jan 2022 16:59:06 +0530 Message-ID: <20220117112906.23823-1-asaini@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20220111053303.18162-1-asaini@xilinx.com> References: <20220111053303.18162-1-asaini@xilinx.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3722950-f2d6-4658-c54b-08d9d9accef1 X-MS-TrafficTypeDiagnostic: MW4PR02MB7411:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:265; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E3BTeIb/eqqCuLo6tvpw87J8tOm7/VKf+61f07MSOoRlR3rBo5WJwMSbaZ3RTDSt7BxH/drKmK4gi2vwm/eGaQpLAtDV5WhO3vTQglRjG1uxJVHpYWgsL009rrh6Xj+w7DmdQ63TZidMrddhbIJVvAL2IwzNx40PRQfHNScJoFqPZb3H4MyRcDgUSgqGj63NVAck1i0IzBlCRANNmrSo9ZfGMFH/V3lHsgSVlWmBiZftPeYrbiAxKdte6cbUxSD6AuLoyJewvB3X8IgIX+W5uCg1ZqL31IM1uX3nsLjJ9CdrXOeXLxtIrVjiKwG/8myMF+RVtmIP0NIqFQPmFteifT1gthef3sfjJ+GRGkx3aTrZFg08PAl6ca0w/sa1llDYnaTO8p3AnzCwb/r536WoerCNuhUx+OrS0Iy8kI6t8Wc8X0SVWNeME3XrwRCueZdiQFjxcwKRunWfLCSjgp+oLeFQwhiRkrF0lc1SedKOkaDWzNjiczR9f7jDPqEoqNDo4vETUy2HReYUodpHpPAyhGrB2cMbWyy8R36eF34dmFAKort5lQSBsj8wcl7i5K5nk1ujmjfh4e7D7//89g7m7P18i3RipBavKZkpScsz1DBeLcCOM2kYdrrWHVtvbqPrHt0q4d/OZMV4pMO1mHI7HWISzA5QW0+nV6f1XA70SR0DpQDKRc7zx0hwxiISmwxRVpmz9ccFCkzyEwaql/nZGMXuB+ZkSXrOSHn5FnrSWbE= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(508600001)(107886003)(4326008)(6666004)(186003)(336012)(7696005)(26005)(8676002)(356005)(83380400001)(426003)(2616005)(70206006)(8936002)(70586007)(1076003)(5660300002)(54906003)(82310400004)(6916009)(36860700001)(2876002)(47076005)(2906002)(316002)(36756003)(9786002)(7636003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2022 11:30:47.8251 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3722950-f2d6-4658-c54b-08d9d9accef1 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT035.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7411 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 From: Abhimanyu Saini Buffer for MCDI channel is allocated using rte_memzone_reserve_aligned with zone name 'mcdi'. Since multiple MCDI channels are needed to support multiple VF(s) and rte_memzone_reserve_aligned expects unique zone names, append PCI address to zone name to make it unique. Signed-off-by: Abhimanyu Saini --- v2: * Formatting changes drivers/vdpa/sfc/sfc_vdpa_hw.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/sfc/sfc_vdpa_hw.c b/drivers/vdpa/sfc/sfc_vdpa_hw.= c index fd1fee7..a7018b1 100644 --- a/drivers/vdpa/sfc/sfc_vdpa_hw.c +++ b/drivers/vdpa/sfc/sfc_vdpa_hw.c @@ -25,21 +25,30 @@ { uint64_t mcdi_iova; size_t mcdi_buff_size; + char mz_name[RTE_MEMZONE_NAMESIZE]; const struct rte_memzone *mz =3D NULL; int numa_node =3D sva->pdev->device.numa_node; int ret; mcdi_buff_size =3D RTE_ALIGN_CEIL(len, PAGE_SIZE); + ret =3D snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "%s_%s", + sva->pdev->name, name); + if (ret < 0 || ret >=3D RTE_MEMZONE_NAMESIZE) { + sfc_vdpa_err(sva, "%s_%s too long to fit in mz_name", + sva->pdev->name, name); + return -EINVAL; + } - sfc_vdpa_log_init(sva, "name=3D%s, len=3D%zu", name, len); + sfc_vdpa_log_init(sva, "name=3D%s, len=3D%zu", mz_name, len); - mz =3D rte_memzone_reserve_aligned(name, mcdi_buff_size, + mz =3D rte_memzone_reserve_aligned(mz_name, mcdi_buff_size, numa_node, RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE); if (mz =3D=3D NULL) { sfc_vdpa_err(sva, "cannot reserve memory for %s: len=3D%#x:= %s", - name, (unsigned int)len, rte_strerror(rte_errn= o)); + mz_name, (unsigned int)len, + rte_strerror(rte_errno)); return -ENOMEM; } -- 1.8.3.1 This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.