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 BE520A00C5; Tue, 4 Jan 2022 10:19:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49F3740040; Tue, 4 Jan 2022 10:19:27 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by mails.dpdk.org (Postfix) with ESMTP id 00B954003C for ; Tue, 4 Jan 2022 04:54:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aoZNR5/shVWBe7XQlt2r68CGGoLYdAPRvtlD0eRtEd/HA1/KJDahyZ4lhRL7jivTYyZ8CDTXeZ5tQm33bbgDKb7ed8uko0hGAxYUenQH5F8nUiqMSBFfv20WJhdpeQqLCbgbN4GSSRW+AWlpUTL4Raj7wwq0ffTrtsQNWgn8XAq4zBDoVREJR9BxnweFJro+s4vOCzunzjxCAfNel7otmTwx8XZBmC9mcGuwTyLO25ju+zM94ZCk218nLB+zC/OoF9SKd6zH71f1n49Zj/FQkP5hgVsHA8y2DLxRezD8dKeMdZzSTRyKzJ1cjHQBSJ2gQ1NzO0L16+jmIYX/RkpWYg== 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=mncclEBSJRUTi2HazwjozRQD+dVOQYQjZ97hlADTcUA=; b=EDEk4zis7KhEF6rWKyEQG1+bvzip0hObnSypvCVoa4fthnM7mwmknDk0NJUIs4FoEvLUAoeKw/mYLTHzbIQon3/g5YqzvIQLbZGp39Ua1RPtw38JR7JQDTkUQDgVnVvETxz2uaEMoH8/G9iKNGkGt+detEIxH4EWqh2FJXkN19WR5DuMch9+Q6Nl+YbdzSwv7TsAOA8WWKhQvWUyzk22PcuzGNegPowNqDQcncXYjAD++dAT/OHhfyOwQ7AysVBK9AGWEPt/PaE046Ygws6I0fsTmiNMTwd05k6HvBo+06hEos3lknReGPaagYYCxSknT/wPbLWaw++jMK3SGEIc4w== 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=mncclEBSJRUTi2HazwjozRQD+dVOQYQjZ97hlADTcUA=; b=O0/BGzTb97EKaNGoiVxC0qqeQmecIfEI9yRhag5C8kcGabYdDaJtScP8BgYwu9iP+P53p2+3b/AJDnkI00yzA5ladOWqwO/HqUSVzQhV1K8O3YqQR836cXyHlrsHHbl+dOZs2pH7axzOHfuOAoRLlxbmyH5yZghaVYBHgsjOFIM= Received: from DM5PR07CA0118.namprd07.prod.outlook.com (2603:10b6:4:ae::47) by BY5PR02MB6018.namprd02.prod.outlook.com (2603:10b6:a03:1b1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.13; Tue, 4 Jan 2022 03:54:45 +0000 Received: from DM3NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:4:ae:cafe::15) by DM5PR07CA0118.outlook.office365.com (2603:10b6:4:ae::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14 via Frontend Transport; Tue, 4 Jan 2022 03:54:45 +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-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT021.mail.protection.outlook.com (10.13.4.249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4844.14 via Frontend Transport; Tue, 4 Jan 2022 03:54:44 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 3 Jan 2022 19:54:44 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 3 Jan 2022 19:54:44 -0800 Envelope-to: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.c@intel.com, andrew.rybchenko@oktetlabs.ru Received: from [10.170.66.118] (port=35840 helo=xndengvm004118.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1n4auJ-000BfU-Rw; Mon, 03 Jan 2022 19:54:44 -0800 From: To: CC: , , , Abhimanyu Saini Subject: [PATCH] vdpa/sfc: make MCDI memzone name unique Date: Tue, 4 Jan 2022 09:24:23 +0530 Message-ID: <20220104035423.28758-1-asaini@xilinx.com> X-Mailer: git-send-email 2.25.0 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: e0bb9407-763c-4ba6-7c5b-08d9cf35f20a X-MS-TrafficTypeDiagnostic: BY5PR02MB6018: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: 7Lj0R0GA+LuNofkaU4E82HgKeu+xLWwtnLk0InVZZM7UgKbCITkU0yPXMWmYglUbwXvDkmpQgAU3/f7H43SM9lgxuwo/Y9ssoLBZ0fHeMNlaa1KMX590DvSkh5ui1EcgE9rXMpna+uujp4FrOoyY9SKncWzD2GOOZWHxn2iWTfX9yGCwQIYEVwrPK27CxjPc5/7uKDsdUw2lBpRyWh2bq72CSzZXjZyOhyYSF0ragasnfmBH2KTGe7YyB9C1s3J7xzRA0MXJg5m21Pqt67w0rEXgAzr5z3T5z9FfXOGM1ZRP6Tbs/ew7hTSig1M/8VdtEN12sZ+Yijcshgo7Qqnze4XL1ShaFY0POkFdGMqrfEhpjmUvvHM9bS6SA4s7RQ4J1Vwise1E2mxJgHd6YQqtrTx3L/yrgnlWfwkQEEyFwsRcHhi5ngxhYgAjs17UbzEjP9wMJrJNG81WRqKL91AIjoxZVeAPMEqXbW1yxSZ44idXDEz9UkK4xUX2QsvVYNKq9b2JarEqO+sNwK2ur6uakcHZKZjcL3a6aynZ2qlzMTr1pzrmA98H5/BFoLkQZDWyW1BNQf9AaoTsNwPXr79R1M2n5CQPADF4Rj2O7/n7vxYABOSu8Hp8vKRoJkIzisAGWn3dQnjZ9ueiOgvZIhVuVcyq8Oxfe90mdJxGlKTfU0DYinCox7HZEqWiMOd/Fjb9wHQJiMOjrA8eEj6I8c3LdKeOQHUVmd1U9GVfw4J+BJo= X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(107886003)(508600001)(6666004)(9786002)(186003)(82310400004)(8676002)(36756003)(4326008)(70586007)(54906003)(70206006)(1076003)(356005)(83380400001)(7636003)(5660300002)(426003)(47076005)(336012)(2616005)(2876002)(6916009)(2906002)(26005)(8936002)(316002)(36860700001)(7696005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2022 03:54:44.9688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0bb9407-763c-4ba6-7c5b-08d9cf35f20a 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6018 X-Mailman-Approved-At: Tue, 04 Jan 2022 10:19:25 +0100 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 --- 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.