From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DC790A04DB; Mon, 28 Sep 2020 21:00:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98E561D590; Mon, 28 Sep 2020 21:00:27 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20085.outbound.protection.outlook.com [40.107.2.85]) by dpdk.org (Postfix) with ESMTP id 8FF391D553 for ; Mon, 28 Sep 2020 21:00:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmeWdHVMIWAhsVxvP21XL0dXUOLjHi+ocrsUyXE6ItcRhsLGhzeYmo4BIBvfGkXE29ffP4rHbuk2ioy7EKm02+WHB+SVVxR24jwvMvlbsiK+vb/Ks3sG4Qv3OwsoDu6f6teHrXPJkKox39u+esevgNzzwlJcs1i+d+8XaOVbmx81MbBhITFitZZRYoYH5VdO8NosSDBzAD34ENETXSas3hsD4CYZSYCw+A/EGPANYdCZpLlJaloqMwprYm1B3f2sAmD1IDNFJQcoNCTaKzKusxTk7JQ4DYUFPD/JSLrQo0Bt8U8y5CXbKnu0o7cbmI5e+nolD5YjTX43/M0ssJwY7g== 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-SenderADCheck; bh=eP+mDU5NII1fvREoT9tBuTbVIUfxS5E9Zt0ev83C4GM=; b=T0wEcelStgCoprcUiYbfw99ajEw1ReRt+ZPY/N3oIy3OuOM1zD2/gKVJ93NkFxNWtwNoFDRsKNFm5VVrYCh97V2h6o82ZGuV5/NcvuXsYABgXW1+ZRc83cJToLTAAOTd+PMbDad32XlKlxXtijEioVxQ9kQqLjK8zJETIDR154iEpLmobuYlyucUjyCSfhliuLUhrHafXRAvpUUyLTwN06sRx9gp9OXOc4yjociFMnMkQBSg1sew3KvzDjgBfg8xNoLG+sW5PTj2B+vA4VUj0s0muU6L/BXDot1eSJuFYQnJidnAYjLicbshU/siXQepLajsbUsULs1OA1+/5MZviQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eP+mDU5NII1fvREoT9tBuTbVIUfxS5E9Zt0ev83C4GM=; b=NtKDHnRCHboqT3xEfAkBPVFHrs/c66vxGmPb9ePaXO9XX7vKtL56zi2C3dCetKrbI4MWgnDfjNPpIq4l6ppUBYusRC+RFR5GzhIW69GqysgaE7M6jshNFZpHvhNO+MBGebnLdr83vLzZf3iDS1BWH4AFZneJVKrrKXx31lF3Gkw= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR04MB7134.eurprd04.prod.outlook.com (2603:10a6:800:12e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Mon, 28 Sep 2020 19:00:23 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::9513:3b55:931f:216e%4]) with mapi id 15.20.3412.029; Mon, 28 Sep 2020 19:00:23 +0000 From: Akhil Goyal To: Vikas Gupta , "dev@dpdk.org" CC: "vikram.prakash@broadcom.com" , Raveendra Padasalagi Thread-Topic: [PATCH v2 2/8] crypto/bcmfs: add vfio support Thread-Index: AQHWcZaM+jho+BiDNUylElC3QscTbal+rjCA Date: Mon, 28 Sep 2020 19:00:23 +0000 Message-ID: References: <20200812063127.8687-1-vikas.gupta@broadcom.com> <20200813172344.3228-1-vikas.gupta@broadcom.com> <20200813172344.3228-3-vikas.gupta@broadcom.com> In-Reply-To: <20200813172344.3228-3-vikas.gupta@broadcom.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: broadcom.com; dkim=none (message not signed) header.d=none;broadcom.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [122.162.67.38] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 894a9437-b00b-4158-0697-08d863e0c128 x-ms-traffictypediagnostic: VI1PR04MB7134: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K85hVCYk+9p5xsjndXnJ+MGmUrfIqGZl7pbAIHy34nUBSimKPu6Ptm7XxWIqW4xZh+9O9HxIVcgk5xHsxtyqhDZGkiNhcITgYzpwwG99P+tHPRDi2oB0N4jnm/LK/MKDbm4RCVZYXRUr1wOYParR24trsGatBrWj5gPtFAf7uLro04P3e5kPX4qFLbVAPEzMb1JBZJn4PqIlFu9ID7pBi/e+19T3L3UiQn0/1w1ukMiGwc8Cq5D4WM38BzzEbA1G7uRpxYEu9SC1MtfNMzeJ/j42IJrERtgtOHibQwxlk0Hbk040ZZUuh8ccV2zoYhjhmGlx0ZTp68Tc5m0FK4fyvtUw1NheDPIPIN/jihRTQfUc+eGesmr3KG5jsGlhqUwm x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(376002)(39850400004)(346002)(7696005)(83380400001)(54906003)(71200400001)(6506007)(8676002)(4326008)(8936002)(33656002)(76116006)(66476007)(66946007)(66556008)(2906002)(64756008)(66446008)(110136005)(478600001)(86362001)(44832011)(9686003)(316002)(52536014)(55016002)(26005)(186003)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: mQV7BzQgxS1zYclmo2IzdnIq2/RlgLeXox7uOkPW6+N4RhIAYoQNrH5vVhKXkW8O57TsnVyxM8vH3/GzBYmM72wPpwMF67/ATtTcXxIyn/2AcahVMKctzcypIHcZBQiiNRHxHVLtrbxu7TtqahY30jpU8Z3E99SwqFOeuUz8c3SfB84GLPtLKP/4hpALEyEiXCAB+n+jNZPMPrQFOhXdN1njCJhlLOGz8k/atN9AWtFw63kQqQ4YbBHlLfKx0z55gMM7pq+HApykNn8or7PJxLSw0RAN1lk7x/tQqgguMnttAcmecxWbAYS0ViFKUhqCDWNvYbpQ5CHsbVVxbeQIV4ljl79R5u2AHw+KKYfZGDjniS5X6mqsaESLqwHvBLBrLdJ/o6rCRPDK/ALDnbC6vglYN0Vyxjkl+YLih+tpSOaCadYBmEAg6pmSEBu1SLf8sOypHB299E39v9VamS4thadUsefy4LjLg4T5/NwOUUnoTIp9gw5MVDSW0AhQNmwJBk/tC85CgvUJWfiQbnbdo9cMC9A3N/63Ba8rx0OM+SynEn9gk7VBirgry6/r359g8NUdB7AW9P58szWGosWiF+nwKnEhgj4uMC4ykf3hS2EogQl3k55vIZzii2zpohQkwylAXTXucY+FZXGbGxIEFA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3168.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 894a9437-b00b-4158-0697-08d863e0c128 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2020 19:00:23.4446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XiL3L7aQFTvUkkeWPBOxJsjCGs2cUrfUH7/TEiy3Up34fpzY30aRm8Rs3XncysVfnVKjw0WNt8BbNs0K12SCyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7134 Subject: Re: [dpdk-dev] [PATCH v2 2/8] crypto/bcmfs: add vfio support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Vikas, > Subject: [PATCH v2 2/8] crypto/bcmfs: add vfio support >=20 > Add vfio support for device. >=20 > Signed-off-by: Vikas Gupta > Signed-off-by: Raveendra Padasalagi > Reviewed-by: Ajit Khaparde > --- > drivers/crypto/bcmfs/bcmfs_device.c | 5 ++ > drivers/crypto/bcmfs/bcmfs_device.h | 6 ++ > drivers/crypto/bcmfs/bcmfs_vfio.c | 107 ++++++++++++++++++++++++++++ > drivers/crypto/bcmfs/bcmfs_vfio.h | 17 +++++ > drivers/crypto/bcmfs/meson.build | 3 +- > 5 files changed, 137 insertions(+), 1 deletion(-) > create mode 100644 drivers/crypto/bcmfs/bcmfs_vfio.c > create mode 100644 drivers/crypto/bcmfs/bcmfs_vfio.h >=20 > diff --git a/drivers/crypto/bcmfs/bcmfs_device.c > b/drivers/crypto/bcmfs/bcmfs_device.c > index 47c776de6..3b5cc9e98 100644 > --- a/drivers/crypto/bcmfs/bcmfs_device.c > +++ b/drivers/crypto/bcmfs/bcmfs_device.c > @@ -11,6 +11,7 @@ >=20 > #include "bcmfs_device.h" > #include "bcmfs_logs.h" > +#include "bcmfs_vfio.h" >=20 > struct bcmfs_device_attr { > const char name[BCMFS_MAX_PATH_LEN]; > @@ -71,6 +72,10 @@ fsdev_allocate_one_dev(struct rte_vdev_device *vdev, >=20 > fsdev->vdev =3D vdev; >=20 > + /* attach to VFIO */ > + if (bcmfs_attach_vfio(fsdev)) > + goto cleanup; > + > TAILQ_INSERT_TAIL(&fsdev_list, fsdev, next); >=20 > return fsdev; > diff --git a/drivers/crypto/bcmfs/bcmfs_device.h > b/drivers/crypto/bcmfs/bcmfs_device.h > index cc64a8df2..c41cc0031 100644 > --- a/drivers/crypto/bcmfs/bcmfs_device.h > +++ b/drivers/crypto/bcmfs/bcmfs_device.h > @@ -35,6 +35,12 @@ struct bcmfs_device { > char name[BCMFS_DEV_NAME_LEN]; > /* Parent vdev */ > struct rte_vdev_device *vdev; > + /* vfio handle */ > + int vfio_dev_fd; > + /* mapped address */ > + uint8_t *mmap_addr; > + /* mapped size */ > + uint32_t mmap_size; > }; >=20 > #endif /* _BCMFS_DEV_H_ */ > diff --git a/drivers/crypto/bcmfs/bcmfs_vfio.c > b/drivers/crypto/bcmfs/bcmfs_vfio.c > new file mode 100644 > index 000000000..dc2def580 > --- /dev/null > +++ b/drivers/crypto/bcmfs/bcmfs_vfio.c > @@ -0,0 +1,107 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2020 Broadcom. > + * All rights reserved. > + */ > + > +#include > +#include > +#include > + > +#include > + > +#include "bcmfs_device.h" > +#include "bcmfs_logs.h" > +#include "bcmfs_vfio.h" > + > +#ifdef VFIO_PRESENT I cannot see VFIO_PRESENT flag defined in this patch. Hence the below code is a dead code and the patch Title is not justified as it says adding support for VFIO. > +static int > +vfio_map_dev_obj(const char *path, const char *dev_obj, > + uint32_t *size, void **addr, int *dev_fd) Regards, Akhil