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 299FCA034D; Tue, 11 Jan 2022 06:33:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBFEB41170; Tue, 11 Jan 2022 06:33:32 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2060.outbound.protection.outlook.com [40.107.94.60]) by mails.dpdk.org (Postfix) with ESMTP id A3C3D40041 for ; Tue, 11 Jan 2022 06:33:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PsEfkaGUdylA1+FdoxU4WMctPwSRXoZq4bCEqD5PzP48t7GgUdvtOBBGp/U7E0WmNEgLPskgzCmfjHVi2oA+LrLtsqUbxK+TOnn4KYrfeI7gZdy1IFRTlvBhGnaVOMlKZN0KcDd/82gijNdfPi/+VGQ7QSA/0pwY39BDwVRUJ4V4L1DFWlYBTUGxq9E6CbU58Rt0TT6kaHqxAtsS/ZSVy5YGrzdAh4ehBp7KoZrz2jvd7MMObAVo/KZzlfDpeF0HxUONpOBoK5Wn1hamxn/Q3FOl6DIw10VMUgtEfX5WyvU9PnoV6w2VsD5y74Zj+p54dawupm6LPFzN1eySgXRvdQ== 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=LR+5i44szoIUsQkqat/SSiyJLN6aYNegR1yFHbpn9ydtzlZ3rw0qQHYTGEeKhaJkAPRLSDXu9nkcWduVJO0VDD2cGy3YvwlWGaiFVXIrvku3x129QnOZz0s5aNHU9OLke0KqL1B2swJS1L3Ij+CvH6NvN7pZSfF1NxNxi9y8wVufmqbf9f20p6xlfxuaVQTOvpi0u6Gc5dfLJsuslRZOkEDVWPDaFnll6X+Z+PX7Co02LJnqvBKdJ0qzFffaAdf/5zqd2ymaFXIEvNxHLJoziwc0kcZe5LWGp1Bl6bPJ1tmjZKTb0sr7fOn9BFVg5XM0yVeehVjzXrrVPxjDVSNpjA== 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=YTa9q9ul9blQpBpSXh2sSNbgSc/VuAVWz78nNzseqe6u07rY6oUfuOFpYCFkBtenxdUoPZJRBNKedfDc4+I5bStbVMvbN4nK+qcwlYr7AuOmmE6/2PNiFafBFDHhxgLgbwzd7/geEFig8i6rWo9o1pZM0ZWQkzORnPvknqJmWJ0= Received: from DM5PR13CA0057.namprd13.prod.outlook.com (2603:10b6:3:117::19) by CH0PR02MB8226.namprd02.prod.outlook.com (2603:10b6:610:eb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Tue, 11 Jan 2022 05:33:28 +0000 Received: from DM3NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:3:117:cafe::4c) by DM5PR13CA0057.outlook.office365.com (2603:10b6:3:117::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.4 via Frontend Transport; Tue, 11 Jan 2022 05:33:28 +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 DM3NAM02FT004.mail.protection.outlook.com (10.13.5.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4867.9 via Frontend Transport; Tue, 11 Jan 2022 05:33:28 +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, 10 Jan 2022 21:33:24 -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, 10 Jan 2022 21:33:24 -0800 Envelope-to: dev@dpdk.org, chenbo.xia@intel.com, maxime.coquelin@redhat.com, andrew.rybchenko@oktetlabs.ru Received: from [10.170.66.118] (port=39580 helo=xndengvm004118.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1n79me-000ACe-1H; Mon, 10 Jan 2022 21:33:24 -0800 From: To: CC: , , , Abhimanyu Saini Subject: [PATCH] vdpa/sfc: make MCDI memzone name unique Date: Tue, 11 Jan 2022 11:03:03 +0530 Message-ID: <20220111053303.18162-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: 0ea95233-13fa-4dd4-5148-08d9d4c3e580 X-MS-TrafficTypeDiagnostic: CH0PR02MB8226: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: mGltUd9nnYFo+v+SvCFsbKplixjNRZtYStOY9ewqHgyeB6xPoZKH9Ny/wFq6vLTwFtU+zKar9fZF+IQ6IFR+4Z1Rh5sbS57+a3yZnfiWR4qRjv0W7IJUrPjKE1X42xTgQGqzSnOnhnxXoajyd6JA9o4YdaX8w4P0u5Q8YoVsCvPg/IWyCWCsQzMfP7mGMGvOGmgY7qDi5f/nsrG+6DI6eIqNAu9UhGq1PEZ/WPcWLC0IDo+hZiB9CGmWKpqKZvLRRxFNOgZxrlcqY6ZZstn+pCqIQ4a/+hw13QtOXpdnooaDonNMRN6pegT7UCj6qM4yVm4/qs2LJ8butE1IdefOoeykKZZ4jEP0SYKJEGXG+4ULvPdFsSxA++++w9Y5xoGifY8UUKEh/rOHaUyF05oRw9Q8qlSaTqu7aRh/KtU7GMAqnHMwdwxgBwBpn6A9LDFwdq3twxGmJOJC/X8fRFpTVhSaIb6x1dhq8D5JKkPZVx+19c3OFeRCvL71Tg5QRw2AYdXCC4HAdmiPWT1Rv/J8drf3J/y7z11tGfuuU8pINwRW24pN3nMHyhEGIr434ANV0JWX1EH2aKGFblANoKM274DNXAD1wa1l3sXxnD9UGPkUs/Ptngf26cLJ9seqTHCS9xWZQsy2hfljBplOmHfZiN0hoMszR7czRKXjXJ6z45MNFXhUzi1vGAUn1M4clgs/CaeXy7tFyZ/tpGvj6mv6anFhWMUSjfKzCgntcWJtt/I= 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)(46966006)(36840700001)(2876002)(54906003)(83380400001)(356005)(36756003)(5660300002)(47076005)(4326008)(2906002)(6916009)(7636003)(36860700001)(316002)(70586007)(2616005)(508600001)(8676002)(107886003)(336012)(186003)(426003)(9786002)(7696005)(70206006)(1076003)(8936002)(26005)(6666004)(82310400004)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2022 05:33:28.2801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ea95233-13fa-4dd4-5148-08d9d4c3e580 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: DM3NAM02FT004.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR02MB8226 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.