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 146CBA04C0; Tue, 29 Sep 2020 13:01:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 623511D8DB; Tue, 29 Sep 2020 13:01:16 +0200 (CEST) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by dpdk.org (Postfix) with ESMTP id 98E901D56B for ; Tue, 29 Sep 2020 13:01:13 +0200 (CEST) Received: by mail-ej1-f66.google.com with SMTP id lo4so14358688ejb.8 for ; Tue, 29 Sep 2020 04:01: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=nG1FA2PmMz/ior2PigfoaxTTZywZ1NbMcmNYwBVDryQ=; b=fXVJUEUJDFzja1Tk+8bufYaka00kpMWmAGUc4xpAq3Feu1cItJz1grnr8KWmBJ/Cx2 7dE8lo94jJhmaLZCEHQm1XCJRbQNypGvnqEdBZ0MT9ZIECPqF4PG/+UietBVP1TH6NOb h0Rsb+FI+0jbkvI9yS23/mKdtv4yr43xCegaM= 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=nG1FA2PmMz/ior2PigfoaxTTZywZ1NbMcmNYwBVDryQ=; b=l9TSdJLGw5HoBN1B/Ky+zHE93U4ZQEHZ9VHXbvBQmVEYfLJL4ameKJOX0CkhpW+m/9 c3TYDTRVZ9f9RlRCz0lg5Sd/HzDhMBm78b8fdoBeTsFFMY8gga42sVYjRo5AV9VqqEfk w3tQ5++mUr3WXvzWi202nDL0eexZFPG5iW+Rg8no+em1Vxmbp6Sy5mTz8pm4lIoqdRRq ZkoCYts9ePCSX2SFmxlw4X6jMdNaGdD6DbGWu3bCbxqPLSyePnzIxeyN/8II8XvTEgMC ESrsfJmwkUQHaUaDuv6D9ufwI7BtsQXzPc8QGEs9Y1W857cTTl3LYF+Bzi6HP3Tj6VTF 1TAQ== X-Gm-Message-State: AOAM532gBnqFOnHUnvP7aU/TGfKhQVfEC+0OkETPyIZJOiNNweR897Ks lCx3BIh3RtEnAh3AMg7fjQFHxj9CyF8LO/RDO1LK/g== X-Google-Smtp-Source: ABdhPJzzY2uzbnG0UB1dzlRcDVU1Af4gAvJJpvtGpDt94+mVtAaz1fmZhgAedQGn5juVQxKIz2t71iFgq1j83FPSfw8= X-Received: by 2002:a17:906:fa8a:: with SMTP id lt10mr3186511ejb.307.1601377272141; Tue, 29 Sep 2020 04:01:12 -0700 (PDT) MIME-Version: 1.0 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: From: Vikas Gupta Date: Tue, 29 Sep 2020 16:31:00 +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 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 Akhil, On Tue, Sep 29, 2020 at 12:30 AM Akhil Goyal wrote: > > Hi Vikas, > > > Subject: [PATCH v2 2/8] crypto/bcmfs: add vfio support > > > > Add vfio support for device. > > > > 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 > > > > 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 @@ > > > > #include "bcmfs_device.h" > > #include "bcmfs_logs.h" > > +#include "bcmfs_vfio.h" > > > > struct bcmfs_device_attr { > > const char name[BCMFS_MAX_PATH_LEN]; > > @@ -71,6 +72,10 @@ fsdev_allocate_one_dev(struct rte_vdev_device *vdev, > > > > fsdev->vdev = vdev; > > > > + /* attach to VFIO */ > > + if (bcmfs_attach_vfio(fsdev)) > > + goto cleanup; > > + > > TAILQ_INSERT_TAIL(&fsdev_list, fsdev, next); > > > > 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; > > }; > > > > #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. I believe VFIO_PRESENT flag is dependent on the platform who supports VFIO and determined in rte_vfio.h. The driver will not work without VFIO support and returns silently (functions in #else part). Do you mean I need to change the title? > > > +static int > > +vfio_map_dev_obj(const char *path, const char *dev_obj, > > + uint32_t *size, void **addr, int *dev_fd) > > Regards, > Akhil Thanks, Vikas