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 37F61A04DB; Mon, 28 Sep 2020 20:49:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6D8E1D57E; Mon, 28 Sep 2020 20:49:57 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2063.outbound.protection.outlook.com [40.107.22.63]) by dpdk.org (Postfix) with ESMTP id 065751D551 for ; Mon, 28 Sep 2020 20:49:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SnKvY8gAgkfNWG+WEwQExJ5xWtxxzEnbqcFwMmnju4moTb7BYvP4Q6PBtlIfltIF5G53r0G19K/ktd7xy+peKEghThOAja+D84xCrkqZ+IaB0J0zYm1vnmpBlftJT+z+bo9UJRIzwpq13ofHgTHGT43EHvdRV6kL21ll81Ns/PiJ2O67aLeY4zvHok9S+iYcK0y80PQ40xLRyzzQDz6OwxoEavoJ4Xyhr+UQHByW8mSnOfKLHnwaQroRAetcC0WmbnUReLO5MyIq4p6zKbL++4S5R5l2MlaVbrHG+Dct0adh8qA+I9r1cG66xLSZNsA20eSR1lLnRuV5wT/zbmsV+w== 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=THAavYnsQFfF1s3ZAPHSMBZy/LOn6MAUMUmxmvto24g=; b=DkT3s+rA0tvJKlH6CMHRmv3QEFmlDnteqzA6+SPIl+q0BySdffBlpMmifeT9foEdhzeFhZ3zK9xww2j0py/DGVnZC39o8oI4kL9dViamkHINqtFsM8Qm/ZSYwiB9tZgRaOkty/RIwQrR8tl8+lWvR1DtH5QEBtnrIx5U4nka2R0JVh0f+0sratCu3DTtEvv+WEjRmpsfBY1nPONaL01Ut6X9jSLlBPqPR3QW7vvF8m+Jj30OZzQkwV89JRBZJqr671q2w/GcR2IuhUJRxAhUtPCVSdm7POvcI1bE/1VxL0hcHGGjibWStBflok8EUZNi9J5WaXA23LbjgsjN3JOifw== 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=THAavYnsQFfF1s3ZAPHSMBZy/LOn6MAUMUmxmvto24g=; b=M2hwwKUTya9xOxPSIkAiuqMtsd+YQkafC2+zsQMohwwE5DHvip/bXf2tGyOly3NeMsHBAiymY0qLi9ywLzk2m0a/+Msw6z3+wX0lZ6+0czLq6pOaDZAmTvhIlrr6HFXCr9mubTnoSaBofrcc8mDwpxXQL+av7OT2ba6+mwzqIj8= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR04MB4367.eurprd04.prod.outlook.com (2603:10a6:803:4e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Mon, 28 Sep 2020 18:49:53 +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 18:49:53 +0000 From: Akhil Goyal To: Vikas Gupta , "dev@dpdk.org" CC: "vikram.prakash@broadcom.com" , Raveendra Padasalagi Thread-Topic: [PATCH v2 1/8] crypto/bcmfs: add BCMFS driver Thread-Index: AQHWcZaKgYwt/Qowp0W8pb+iVr0TJ6l+qQpQ Date: Mon, 28 Sep 2020 18:49:53 +0000 Message-ID: References: <20200812063127.8687-1-vikas.gupta@broadcom.com> <20200813172344.3228-1-vikas.gupta@broadcom.com> <20200813172344.3228-2-vikas.gupta@broadcom.com> In-Reply-To: <20200813172344.3228-2-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: 89313d28-18eb-488e-9506-08d863df4963 x-ms-traffictypediagnostic: VI1PR04MB4367: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ckAMyYHO8Q6P4iLPQRRjOhxEfOCIIw84Vjo04OkK5oX/NKmRchBj31EyBjKjt3xe0KmmSRZy4BAZlRpH1ZbrvVEI5gpd61pzp6f7whO5n6pD1tRoY6Ma8BeSoH+vnbz3NZUZlrp96QIle4hm66NrVjwtG/kxw2zy2kk4Py0ZevceL7FV4MNlS1fI1ov9nUGEq1Vn3q3d88zkXbO46Mpev4AJM0aZFJWUsnQJnLHtVx0G8OGhQUf9ZOiJGbXlr/3KjIJuDcZtCtEWFafOS7OH8LtEVOWwbqoaUk2n1q9Ktx1hwhEJ6T3fA6hk5ze+JnxOHdY0cw68LysdrkJkAbxsim53MUuTN8EIbyhmF8xl+BFPB+ua9Qk1I8wI/XqhnM7x 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)(366004)(376002)(346002)(396003)(136003)(39850400004)(54906003)(83380400001)(44832011)(33656002)(110136005)(316002)(4326008)(2906002)(8936002)(8676002)(86362001)(52536014)(64756008)(5660300002)(478600001)(66946007)(76116006)(66446008)(66556008)(66476007)(7696005)(6506007)(9686003)(71200400001)(26005)(55016002)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: FWV4z5elw3atoSoHbuViH+YGvTsYnv4FniARmTYz/3I5jVNoz+MQKP+e2HFymX2LmY6KxPBQvdAWG4i1uTNUx9vq+h1QuDdQXAILnNrd87J8t90JiykJ9MaKBHImegGINx5IA/GxOoIAPqs+VsvdD8OjPlSvHDsuOfC0IK6qGeJ0iv1itZ1io3IDp6/DkPszCWIvWnJ/2TNC28xBJr9scZaBcZV6OGKXy/f4wBfjcXVGL0jtzX8fQeW/yDp/Z2lJiL6BbLnG23jDgnIIhesoGWQ9yOnuy42BodsiY2YR+834fP8GdHrIUczXSO1sX77i2akgCQvnLboBAf9Cpldun2bBa6oz870F17jZIKwzIUjCooalT6oW1bZorLU7MsBkPkckvBU+LxBG94zqYZ+gEIXg18cJWdmXZtiWzGbj6r+qXzo8IS7IYsbHot1z4W9pCmva3i9VXOtr3qn22gx9U6ao0Y5VWrSlDZ+eLegtp1EPuF/LdCLYAJB+sWvSMZ5BoxRfykjYQ+fI8T2tVRXImstnhynnzqF8ML9NcKidpBR+5MyUQp+Vzit37AcxPxECxn2IE/r+VNjXBCG3vYHtTB39mguxHaiUA+Dxyh8JXf2TtrPePELm+AYWItjjINayhBnOqaaJa+a/NLZ+jjvBiw== 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: 89313d28-18eb-488e-9506-08d863df4963 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2020 18:49:53.1865 (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: NGdyN31IWNjbFmncndPwNU0HbOKJ72m4YSGr0xNX0SOfOVIAmJPkgOft/HrkKvfh4X9W7YpAf5A3pXEs4AnK9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4367 Subject: Re: [dpdk-dev] [PATCH v2 1/8] crypto/bcmfs: add BCMFS driver 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, > +BCMFS crypto PMD depend upon the devices present in the path > +/sys/bus/platform/devices/fs/ on the platform. > +Each cryptodev PMD instance can be attached to the nodes present > +in the mentioned path. It would be good, if you can mention the details about the SDKs which need To be installed, any kernel dependencies if any. The device path mentioned is from which rootfs? This looks incomplete docum= entation. > diff --git a/doc/guides/cryptodevs/index.rst b/doc/guides/cryptodevs/inde= x.rst > index a67ed5a28..5d7e028bd 100644 > --- a/doc/guides/cryptodevs/index.rst > +++ b/doc/guides/cryptodevs/index.rst > @@ -29,3 +29,4 @@ Crypto Device Drivers > qat > virtio > zuc > + bcmfs It is better to maintain an alphabetical order. > diff --git a/drivers/crypto/bcmfs/bcmfs_device.c > b/drivers/crypto/bcmfs/bcmfs_device.c > new file mode 100644 > index 000000000..47c776de6 > --- /dev/null > +++ b/drivers/crypto/bcmfs/bcmfs_device.c > @@ -0,0 +1,256 @@ > +/* 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" > + > +struct bcmfs_device_attr { > + const char name[BCMFS_MAX_PATH_LEN]; > + const char suffix[BCMFS_DEV_NAME_LEN]; > + const enum bcmfs_device_type type; > + const uint32_t offset; > + const uint32_t version; > +}; > + > +/* BCMFS supported devices */ > +static struct bcmfs_device_attr dev_table[] =3D { > + { > + .name =3D "fs4", > + .suffix =3D "crypto_mbox", > + .type =3D BCMFS_SYM_FS4, > + .offset =3D 0, > + .version =3D 0x76303031 > + }, > + { > + .name =3D "fs5", > + .suffix =3D "mbox", > + .type =3D BCMFS_SYM_FS5, > + .offset =3D 0, > + .version =3D 0x76303032 > + }, > + { > + /* sentinel */ > + } > +}; > + > +TAILQ_HEAD(fsdev_list, bcmfs_device); > +static struct fsdev_list fsdev_list =3D TAILQ_HEAD_INITIALIZER(fsdev_lis= t); > + > +static struct bcmfs_device * > +fsdev_allocate_one_dev(struct rte_vdev_device *vdev, > + char *dirpath, > + char *devname, > + enum bcmfs_device_type dev_type __rte_unused) > +{ > + struct bcmfs_device *fsdev; > + > + fsdev =3D calloc(1, sizeof(*fsdev)); Can we use rte_calloc > + if (!fsdev) > + return NULL; > + > + if (strlen(dirpath) > sizeof(fsdev->dirname)) { > + BCMFS_LOG(ERR, "dir path name is too long"); > + goto cleanup; > + } > + > + if (strlen(devname) > sizeof(fsdev->name)) { > + BCMFS_LOG(ERR, "devname is too long"); > + goto cleanup; > + } > + > + strcpy(fsdev->dirname, dirpath); > + strcpy(fsdev->name, devname); > + > + fsdev->vdev =3D vdev; > + > + TAILQ_INSERT_TAIL(&fsdev_list, fsdev, next); > + > + return fsdev; > + > +cleanup: > + free(fsdev); > + > + return NULL; > +} > + > diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build > index a2423507a..8e06d0533 100644 > --- a/drivers/crypto/meson.build > +++ b/drivers/crypto/meson.build > @@ -23,7 +23,8 @@ drivers =3D ['aesni_gcm', > 'scheduler', > 'snow3g', > 'virtio', > - 'zuc'] > + 'zuc', > + 'bcmfs'] Please maintain an alphabetical order.