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 0DA2AA04C0; Tue, 29 Sep 2020 12:52:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E77E81D90B; Tue, 29 Sep 2020 12:52:14 +0200 (CEST) Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by dpdk.org (Postfix) with ESMTP id C2B121D72D for ; Tue, 29 Sep 2020 12:52:13 +0200 (CEST) Received: by mail-ej1-f67.google.com with SMTP id lo4so14323831ejb.8 for ; Tue, 29 Sep 2020 03:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9PltlaZHLUs4HHJW8e/xYzx4ZF4dbwHpscLLo/6oOmU=; b=XRZjANoXmuaWIfA2cDZ7C3lTJYU7ArP9QEp08+/VZV2JyeKZ6UvWrXWbywLPJLDiwj ZglUw42Vb0+jpmoYqMNE4H/LsAAgRUNBQiN/x5mbLI0+5Ct4B4BjqK0fztcUUdKkMfxs K6xqw6eU1c171zRjXNhE4Roc76fJcObIRkm/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9PltlaZHLUs4HHJW8e/xYzx4ZF4dbwHpscLLo/6oOmU=; b=ke1J6grkLghJdZ9w8lxdFOQ+VHCdHsl1xtla4d2sRcoWmf07UPaZUl5yyk9iHo2G3e sSaqpW9Nd5P5wsnhZorpi9WMSWRkLjR1WDbHU1bJaqSHP0qwxC56lTenZQ1jnzZ6lYkX WpdaCT/EAfT35Ji3TPUjrHZQDKs6MnldD3nDZKj+zVPxQgx6W/L8UclQGbbMiSHA7NOV sEPQPNVyLQQWUThyg5KcDlF8GL1r18KSZqtVk3e3pnLQ4PaxDxc4C5h+LPwLU6C8nLB8 Mtq+PbSyIcN5+JaZn2RYxJ7JWkWRu9yOlEFlqvSE/2apxnfkaiX6Ly+wLmI27bfhBibA dkLg== X-Gm-Message-State: AOAM530tMZYzr8ec1NjNZ6jcMtyzeLmwbLl7Ady0XHUugob/L5OApMX3 k0ilmsbeBFpvWGBk8f7OLV4ULzC1SY0XJIQgmWb8mk67Js8= X-Google-Smtp-Source: ABdhPJz+9tsWJAFMVdPW3Nuf7x57bNLaUVji+t1PCpd0lIfwPT25ixMH/fAacT1w3jm8cm+y8Kw1aHloyzWrIJp55vM= X-Received: by 2002:a17:906:4956:: with SMTP id f22mr3049945ejt.62.1601376732340; Tue, 29 Sep 2020 03:52:12 -0700 (PDT) MIME-Version: 1.0 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: From: Vikas Gupta Date: Tue, 29 Sep 2020 16:22:01 +0530 Message-ID: To: Akhil Goyal Cc: "dev@dpdk.org" , "vikram.prakash@broadcom.com" , Raveendra Padasalagi Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 Akhil, On Tue, Sep 29, 2020 at 12:19 AM Akhil Goyal wrote: > > 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 documentation. Ok sure I`ll add missing items in next patch set. > > > diff --git a/doc/guides/cryptodevs/index.rst b/doc/guides/cryptodevs/index.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. Sure. > > > 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[] = { > > + { > > + .name = "fs4", > > + .suffix = "crypto_mbox", > > + .type = BCMFS_SYM_FS4, > > + .offset = 0, > > + .version = 0x76303031 > > + }, > > + { > > + .name = "fs5", > > + .suffix = "mbox", > > + .type = BCMFS_SYM_FS5, > > + .offset = 0, > > + .version = 0x76303032 > > + }, > > + { > > + /* sentinel */ > > + } > > +}; > > + > > +TAILQ_HEAD(fsdev_list, bcmfs_device); > > +static struct fsdev_list fsdev_list = TAILQ_HEAD_INITIALIZER(fsdev_list); > > + > > +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 = calloc(1, sizeof(*fsdev)); > > Can we use rte_calloc will fix it in next patch set. > > > + 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 = 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 = ['aesni_gcm', > > 'scheduler', > > 'snow3g', > > 'virtio', > > - 'zuc'] > > + 'zuc', > > + 'bcmfs'] > > Please maintain an alphabetical order. Sure.