get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/95463/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 95463,
    "url": "https://patches.dpdk.org/api/patches/95463/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210706164418.32615-2-vsrivast@xilinx.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210706164418.32615-2-vsrivast@xilinx.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210706164418.32615-2-vsrivast@xilinx.com",
    "date": "2021-07-06T16:44:09",
    "name": "[01/10] vdpa/sfc: introduce Xilinx vDPA driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "082ff43763f0eda157f0fce92ad14b3032844534",
    "submitter": {
        "id": 2281,
        "url": "https://patches.dpdk.org/api/people/2281/?format=api",
        "name": "Vijay Srivastava",
        "email": "vijay.srivastava@xilinx.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210706164418.32615-2-vsrivast@xilinx.com/mbox/",
    "series": [
        {
            "id": 17687,
            "url": "https://patches.dpdk.org/api/series/17687/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17687",
            "date": "2021-07-06T16:44:08",
            "name": "vdpa/sfc: introduce Xilinx vDPA driver",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/17687/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/95463/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/95463/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A4632A0C4A;\n\tWed,  7 Jul 2021 10:25:35 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 83FD54147E;\n\tWed,  7 Jul 2021 10:25:31 +0200 (CEST)",
            "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2054.outbound.protection.outlook.com [40.107.244.54])\n by mails.dpdk.org (Postfix) with ESMTP id 71E444120E\n for <dev@dpdk.org>; Tue,  6 Jul 2021 18:45:56 +0200 (CEST)",
            "from DS7PR05CA0004.namprd05.prod.outlook.com (2603:10b6:5:3b9::9) by\n CH2PR02MB6950.namprd02.prod.outlook.com (2603:10b6:610:5c::21) with\n Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.4287.31; Tue, 6 Jul 2021 16:45:54 +0000",
            "from DM3NAM02FT056.eop-nam02.prod.protection.outlook.com\n (2603:10b6:5:3b9:cafe::c5) by DS7PR05CA0004.outlook.office365.com\n (2603:10b6:5:3b9::9) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.8 via Frontend\n Transport; Tue, 6 Jul 2021 16:45:54 +0000",
            "from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by\n DM3NAM02FT056.mail.protection.outlook.com (10.13.4.177) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.20.4287.22 via Frontend Transport; Tue, 6 Jul 2021 16:45:53 +0000",
            "from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by\n xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2176.2; Tue, 6 Jul 2021 09:45:53 -0700",
            "from smtp.xilinx.com (172.19.127.96) by\n xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id\n 15.1.2176.2 via Frontend Transport; Tue, 6 Jul 2021 09:45:53 -0700",
            "from [10.177.4.108] (port=54950 helo=xndengvm004108.xilinx.com)\n by smtp.xilinx.com with esmtp (Exim 4.90)\n (envelope-from <vijay.srivastava@xilinx.com>)\n id 1m0oCm-0000pF-Dt; Tue, 06 Jul 2021 09:45:53 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=ee4G8ndcaAeEl6HHjD5MBAqSM+W2aioOvM3veZf/TsLlqvhLQsQhrh7sgsd4Ap94HrplwiYINRAkQhjcVIDs8xz2bgq71o7K4wrVUpv3wwvjL2/KjB2cSVQkyj4QYAE8y3CMtXp7xdRCpoW5PfJuBHYoG6FpbCHtkUABm17QynFxlk61SJoWO2TUEUOSEevO6UKsVmtX4fNPPORLjC9ZuoptYD2cJWtXQHkK/KQzXykYIKArlHIBe6/xumCkeol5datssUv9F7C/ueDtA99yg4ScVdmoT6IQydxtad6dLUuLcvVjGYZSlMsPjzQHwJy921qKICqc0VdHCgJi4tP0wA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=n4N2D6snkhTwdlVy1vN2rCO9H8Gxsy8KP3GonTNzptw=;\n b=WQWGY7sf+TFOUgIOVAiV0a/WIBZOY9ei8GaahREI+fziy2o/LPOBAxkWwKGlTEUb2S0ZFOlfMRw4lTlEc0dLvo96bsQNCnxoZKsu0UbUpmHXzo4FhQQE/ArwJlKI/WnwoaxfEVRHpup2V5oXn4wGHgiplXVhL+zUSbzE0wGIjIjAFDnYLUw/NkiNDtkdG4L4Jx8Ri8Oi4xwd3Xlf0w3AYvUqW+pRPrCocq4KAIdjn3bpUxYPVccrA2Qrq7xQzNAnRoItAnc8mWeVWN1ZWJ6QR7Zz3CJ6PCgB8kBa3rSpY35iL6vRrpv+u5AMFdLIuHZe3PXWFafkaSesIy+HdqzqrA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 149.199.62.198) smtp.rcpttodomain=dpdk.org smtp.mailfrom=xilinx.com;\n dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=n4N2D6snkhTwdlVy1vN2rCO9H8Gxsy8KP3GonTNzptw=;\n b=pjU0p4U2rTv5PBd0mOoyAankBCGiPJkJ7rZxbAm4osaLd++kJjkjZJGMIseUjh/kNe0k7+Qg7x4dpqwy/PMEB0L60noN/kmX+BF2eq7uVtr9UTpgItCUUtXRK5aMjZeEmBS5ZNktrOCYfY8MjQfcclfoy2VeoYQH1PoCUlZT8Vk=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 149.199.62.198)\n smtp.mailfrom=xilinx.com; dpdk.org; dkim=none (message not signed)\n header.d=none;dpdk.org; dmarc=pass action=none header.from=xilinx.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of xilinx.com designates\n 149.199.62.198 as permitted sender) receiver=protection.outlook.com;\n client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com;",
        "Envelope-to": "dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com,\n andrew.rybchenko@oktetlabs.ru",
        "From": "Vijay Srivastava <vijay.srivastava@xilinx.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<maxime.coquelin@redhat.com>, <chenbo.xia@intel.com>,\n <andrew.rybchenko@oktetlabs.ru>, Vijay Kumar Srivastava <vsrivast@xilinx.com>",
        "Date": "Tue, 6 Jul 2021 22:14:09 +0530",
        "Message-ID": "<20210706164418.32615-2-vsrivast@xilinx.com>",
        "X-Mailer": "git-send-email 2.25.0",
        "In-Reply-To": "<20210706164418.32615-1-vsrivast@xilinx.com>",
        "References": "<20210706164418.32615-1-vsrivast@xilinx.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "a35f68bf-a90c-4ba7-68dd-08d9409d850c",
        "X-MS-TrafficTypeDiagnostic": "CH2PR02MB6950:",
        "X-Microsoft-Antispam-PRVS": "\n <CH2PR02MB695052850283FE33F5E1408EB91B9@CH2PR02MB6950.namprd02.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:2582;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n RTqXbaMQtsoG6a7eIl8tuFGwDTYvM0mxkhUX0wUi5ZIsgYXCIrHTy+ccYgYtkJ7ZcMGxMLYdd8MDX0hzqlJLr4H7bHbwq61/5P+J9NbyU6aHtkRmbzJkl279p/TlsJjlWgjLU4Kyasvb945236npoeEGA3N8pHEWqDz1BTgziVgjWL7oAyf5AXuRPEoDqo8EUEhvOIvaFRtAg8+vFaS/Q81KX4W2kTMBF72pn/T/jXr71SifEnrWSvHR7zuBP6qPHu2LbCJxN7fdHAl7OsMXG+COyjlWpimV010E3NztbZOly3BnvasSDX99feutCsAFDoajhm3ms7fCVBD3KjlawCZveZ737qK84wtvZfsI9tMXI5TScc+tqNJuK00PwRT4h0RPp5M7ybYE1jnlCPfYZkcKaRSfS/xLNb16XYQTODa6eyTu/1hmIes+TUwGtPps5Uq3ZXILTRrE79b855bSmd343rDHCvllXnMLGgERNRiYV+JAyoE7EK7bdgH5zdkxJingbZW/OcW3FJ9gtNqZbPgXT22EqzNsKwoIGkfRDne5bQgOIoApNE27eDz7yXqahIATicDcldo1lMmgACIBp60IlS6Pz7qi5UvJShZ5z0w/fk+mH+cq2WZyvUAzqa0FZ8I9dUOKuxpB/UAMHmiUmmS9Y/Th4tF+6D1c9hRUx8QLUCYcRHqqz4sRqCDfcBUSN+eX7Zz22bXFzNGYkN1Qvcf12D8k29WNiQwt/+pPR7xEpuq59fwpI2EQoid116JvV+HQcc7R07Wz0ZXWNd2OJ7eHTtUpKciu/OiCv4cI6wV0Rhvj+Wu3jxoUywK7r7yRsTUM9l5R28qM05RngSj8jd0rMpGeC6iOpf/GSmReleg=",
        "X-Forefront-Antispam-Report": "CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com;\n PTR:unknown-62-198.xilinx.com; CAT:NONE;\n SFS:(4636009)(396003)(136003)(376002)(39860400002)(346002)(36840700001)(46966006)(478600001)(30864003)(966005)(6666004)(2616005)(316002)(36860700001)(186003)(47076005)(36756003)(36906005)(5660300002)(70206006)(9786002)(8936002)(7696005)(336012)(1076003)(2906002)(8676002)(107886003)(426003)(26005)(4326008)(6916009)(356005)(82740400003)(54906003)(83380400001)(44832011)(82310400003)(70586007)(7636003)(102446001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "xilinx.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "06 Jul 2021 16:45:53.4952 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n a35f68bf-a90c-4ba7-68dd-08d9409d850c",
        "X-MS-Exchange-CrossTenant-Id": "657af505-d5df-48d0-8300-c31994686c5c",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198];\n Helo=[xsj-pvapexch01.xlnx.xilinx.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n DM3NAM02FT056.eop-nam02.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CH2PR02MB6950",
        "X-Mailman-Approved-At": "Wed, 07 Jul 2021 10:25:28 +0200",
        "Subject": "[dpdk-dev] [PATCH 01/10] vdpa/sfc: introduce Xilinx vDPA driver",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Vijay Kumar Srivastava <vsrivast@xilinx.com>\n\nAdd new vDPA PMD to support vDPA operation by Xilinx devices.\nThis patch implements probe and remove functions.\n\nSigned-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>\n---\n MAINTAINERS                            |   6 +\n doc/guides/rel_notes/release_21_08.rst |   5 +\n doc/guides/vdpadevs/features/sfc.ini   |   9 ++\n doc/guides/vdpadevs/sfc.rst            |  97 +++++++++++\n drivers/vdpa/meson.build               |   1 +\n drivers/vdpa/sfc/meson.build           |  33 ++++\n drivers/vdpa/sfc/sfc_vdpa.c            | 286 +++++++++++++++++++++++++++++++++\n drivers/vdpa/sfc/sfc_vdpa.h            |  40 +++++\n drivers/vdpa/sfc/sfc_vdpa_log.h        |  77 +++++++++\n drivers/vdpa/sfc/version.map           |   3 +\n 10 files changed, 557 insertions(+)\n create mode 100644 doc/guides/vdpadevs/features/sfc.ini\n create mode 100644 doc/guides/vdpadevs/sfc.rst\n create mode 100644 drivers/vdpa/sfc/meson.build\n create mode 100644 drivers/vdpa/sfc/sfc_vdpa.c\n create mode 100644 drivers/vdpa/sfc/sfc_vdpa.h\n create mode 100644 drivers/vdpa/sfc/sfc_vdpa_log.h\n create mode 100644 drivers/vdpa/sfc/version.map",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 5877a16..ccc0a2a 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1197,6 +1197,12 @@ F: drivers/vdpa/mlx5/\n F: doc/guides/vdpadevs/mlx5.rst\n F: doc/guides/vdpadevs/features/mlx5.ini\n \n+Xilinx sfc vDPA\n+M: Vijay Kumar Srivastava <vsrivast@xilinx.com>\n+F: drivers/vdpa/sfc/\n+F: doc/guides/vdpadevs/sfc.rst\n+F: doc/guides/vdpadevs/features/sfc.ini\n+\n \n Eventdev Drivers\n ----------------\ndiff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst\nindex a6ecfdf..bb9aa83 100644\n--- a/doc/guides/rel_notes/release_21_08.rst\n+++ b/doc/guides/rel_notes/release_21_08.rst\n@@ -55,6 +55,11 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Add new vDPA PMD based on Xilinx devices.**\n+\n+  Added a new Xilinx vDPA  (``sfc_vdpa``) PMD.\n+  See the :doc:`../vdpadevs/sfc` guide for more details on this driver.\n+\n \n Removed Items\n -------------\ndiff --git a/doc/guides/vdpadevs/features/sfc.ini b/doc/guides/vdpadevs/features/sfc.ini\nnew file mode 100644\nindex 0000000..71b6158\n--- /dev/null\n+++ b/doc/guides/vdpadevs/features/sfc.ini\n@@ -0,0 +1,9 @@\n+;\n+; Supported features of the 'sfc' vDPA driver.\n+;\n+; Refer to default.ini for the full list of available driver features.\n+;\n+[Features]\n+Linux\t\t\t= Y\n+x86-64\t\t\t= Y\n+Usage doc\t\t= Y\ndiff --git a/doc/guides/vdpadevs/sfc.rst b/doc/guides/vdpadevs/sfc.rst\nnew file mode 100644\nindex 0000000..59f990b\n--- /dev/null\n+++ b/doc/guides/vdpadevs/sfc.rst\n@@ -0,0 +1,97 @@\n+..  SPDX-License-Identifier: BSD-3-Clause\n+    Copyright(c) 2021 Xilinx Corporation.\n+\n+Xilinx vDPA driver\n+==================\n+\n+The Xilinx vDPA (vhost data path acceleration) driver (**librte_pmd_sfc_vdpa**)\n+provides support for the Xilinx SN1022 SmartNICs family of 10/25/40/50/100 Gbps\n+adapters has support for latest Linux and FreeBSD operating systems.\n+\n+More information can be found at Xilinx website https://www.xilinx.com.\n+\n+\n+Xilinx vDPA implementation\n+--------------------------\n+\n+ef100 device can be configured in the net device or vDPA mode.\n+Adding \"class=vdpa\" parameter helps to specify that this\n+device is to be used in vDPA mode. If this parameter is not specified, device\n+will be probed by net/sfc driver and will used as a net device.\n+\n+This PMD uses libefx (common/sfc_efx) code to access the device firmware.\n+\n+\n+Supported NICs\n+--------------\n+\n+- Xilinx SN1022 SmartNICs\n+\n+\n+Features\n+--------\n+\n+Features of the Xilinx vDPA driver are:\n+\n+- Compatibility with virtio 0.95 and 1.0\n+\n+\n+Non-supported Features\n+----------------------\n+\n+- Control Queue\n+- Multi queue\n+- Live Migration\n+\n+\n+Prerequisites\n+-------------\n+\n+Requires firmware version: v1.0.7.0 or higher\n+\n+Visit `Xilinx Support Downloads <https://www.xilinx.com/support.html>`_\n+to get Xilinx Utilities with the latest firmware.\n+Follow instructions from Alveo SN1000 SmartNICs User Guide to\n+update firmware and configure the adapter.\n+\n+\n+Per-Device Parameters\n+~~~~~~~~~~~~~~~~~~~~~\n+\n+The following per-device parameters can be passed via EAL PCI device\n+whitelist option like \"-w 02:00.0,arg1=value1,...\".\n+\n+Case-insensitive 1/y/yes/on or 0/n/no/off may be used to specify\n+boolean parameters value.\n+\n+- ``class`` [net|vdpa] (default **net**)\n+\n+  Choose the mode of operation of ef100 device.\n+  **net** device will work as network device and will be probed by net/sfc driver.\n+  **vdpa** device will work as vdpa device and will be probed by vdpa/sfc driver.\n+  If this parameter is not specified then ef100 device will operate as network device.\n+\n+\n+Dynamic Logging Parameters\n+~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+One may leverage EAL option \"--log-level\" to change default levels\n+for the log types supported by the driver. The option is used with\n+an argument typically consisting of two parts separated by a colon.\n+\n+Level value is the last part which takes a symbolic name (or integer).\n+Log type is the former part which may shell match syntax.\n+Depending on the choice of the expression, the given log level may\n+be used either for some specific log type or for a subset of types.\n+\n+SFC vDPA PMD provides the following log types available for control:\n+\n+- ``pmd.vdpa.sfc.driver`` (default level is **notice**)\n+\n+  Affects driver-wide messages unrelated to any particular devices.\n+\n+- ``pmd.vdpa.sfc.main`` (default level is **notice**)\n+\n+  Matches a subset of per-port log types registered during runtime.\n+  A full name for a particular type may be obtained by appending a\n+  dot and a PCI device identifier (``XXXX:XX:XX.X``) to the prefix.\ndiff --git a/drivers/vdpa/meson.build b/drivers/vdpa/meson.build\nindex f765fe3..77412c7 100644\n--- a/drivers/vdpa/meson.build\n+++ b/drivers/vdpa/meson.build\n@@ -8,6 +8,7 @@ endif\n drivers = [\n         'ifc',\n         'mlx5',\n+        'sfc',\n ]\n std_deps = ['bus_pci', 'kvargs']\n std_deps += ['vhost']\ndiff --git a/drivers/vdpa/sfc/meson.build b/drivers/vdpa/sfc/meson.build\nnew file mode 100644\nindex 0000000..d916389\n--- /dev/null\n+++ b/drivers/vdpa/sfc/meson.build\n@@ -0,0 +1,33 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+#\n+# Copyright(c) 2020-2021 Xilinx, Inc.\n+\n+if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and (arch_subdir != 'arm' or not host_machine.cpu_family().startswith('aarch64'))\n+\tbuild = false\n+\treason = 'only supported on x86_64 and aarch64'\n+endif\n+\n+fmt_name = 'sfc_vdpa'\n+extra_flags = []\n+\n+# Enable more warnings\n+extra_flags += [\n+\t'-Wdisabled-optimization'\n+]\n+\n+# Compiler and version dependent flags\n+extra_flags += [\n+\t'-Waggregate-return',\n+\t'-Wbad-function-cast'\n+]\n+\n+foreach flag: extra_flags\n+\tif cc.has_argument(flag)\n+\t\tcflags += flag\n+\tendif\n+endforeach\n+\n+deps += ['common_sfc_efx', 'bus_pci']\n+sources = files(\n+\t'sfc_vdpa.c',\n+)\ndiff --git a/drivers/vdpa/sfc/sfc_vdpa.c b/drivers/vdpa/sfc/sfc_vdpa.c\nnew file mode 100644\nindex 0000000..d8faaca\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa.c\n@@ -0,0 +1,286 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * Copyright(c) 2020-2021 Xilinx, Inc.\n+ */\n+\n+#include <stdbool.h>\n+#include <stdint.h>\n+#include <sys/queue.h>\n+\n+#include <rte_common.h>\n+#include <rte_errno.h>\n+#include <rte_string_fns.h>\n+#include <rte_vfio.h>\n+#include <rte_vhost.h>\n+\n+#include \"efx.h\"\n+#include \"sfc_efx.h\"\n+#include \"sfc_vdpa.h\"\n+\n+TAILQ_HEAD(sfc_vdpa_adapter_list_head, sfc_vdpa_adapter);\n+static struct sfc_vdpa_adapter_list_head sfc_vdpa_adapter_list =\n+\tTAILQ_HEAD_INITIALIZER(sfc_vdpa_adapter_list);\n+\n+static pthread_mutex_t sfc_vdpa_adapter_list_lock = PTHREAD_MUTEX_INITIALIZER;\n+\n+struct sfc_vdpa_adapter *\n+sfc_vdpa_get_adapter_by_dev(struct rte_pci_device *pdev)\n+{\n+\tbool found = false;\n+\tstruct sfc_vdpa_adapter *sva;\n+\n+\tpthread_mutex_lock(&sfc_vdpa_adapter_list_lock);\n+\n+\tTAILQ_FOREACH(sva, &sfc_vdpa_adapter_list, next) {\n+\t\tif (pdev == sva->pdev) {\n+\t\t\tfound = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tpthread_mutex_unlock(&sfc_vdpa_adapter_list_lock);\n+\n+\treturn found ? sva : NULL;\n+}\n+\n+static int\n+sfc_vdpa_vfio_setup(struct sfc_vdpa_adapter *sva)\n+{\n+\tstruct rte_pci_device *dev = sva->pdev;\n+\tchar dev_name[RTE_DEV_NAME_MAX_LEN] = {0};\n+\tint rc;\n+\n+\tif (dev == NULL)\n+\t\tgoto fail_inval;\n+\n+\trte_pci_device_name(&dev->addr, dev_name, RTE_DEV_NAME_MAX_LEN);\n+\n+\tsva->vfio_container_fd = rte_vfio_container_create();\n+\tif (sva->vfio_container_fd < 0)\t{\n+\t\tsfc_vdpa_err(sva, \"failed to create VFIO container\");\n+\t\tgoto fail_container_create;\n+\t}\n+\n+\trc = rte_vfio_get_group_num(rte_pci_get_sysfs_path(), dev_name,\n+\t\t\t\t    &sva->iommu_group_num);\n+\tif (rc <= 0) {\n+\t\tsfc_vdpa_err(sva, \"failed to get IOMMU group for %s : %s\",\n+\t\t\t     dev_name, rte_strerror(-rc));\n+\t\tgoto fail_get_group_num;\n+\t}\n+\n+\tsva->vfio_group_fd =\n+\t\trte_vfio_container_group_bind(sva->vfio_container_fd,\n+\t\t\t\t\t      sva->iommu_group_num);\n+\tif (sva->vfio_group_fd < 0) {\n+\t\tsfc_vdpa_err(sva,\n+\t\t\t     \"failed to bind IOMMU group %d to container %d\",\n+\t\t\t     sva->iommu_group_num, sva->vfio_container_fd);\n+\t\tgoto fail_group_bind;\n+\t}\n+\n+\tif (rte_pci_map_device(dev) != 0) {\n+\t\tsfc_vdpa_err(sva, \"failed to map PCI device %s : %s\",\n+\t\t\t     dev_name, rte_strerror(rte_errno));\n+\t\tgoto fail_pci_map_device;\n+\t}\n+\n+\tsva->vfio_dev_fd = dev->intr_handle.vfio_dev_fd;\n+\n+\treturn 0;\n+\n+fail_pci_map_device:\n+\tif (rte_vfio_container_group_unbind(sva->vfio_container_fd,\n+\t\t\t\t\tsva->iommu_group_num) != 0) {\n+\t\tsfc_vdpa_err(sva,\n+\t\t\t     \"failed to unbind IOMMU group %d from container %d\",\n+\t\t\t     sva->iommu_group_num, sva->vfio_container_fd);\n+\t}\n+\n+fail_group_bind:\n+fail_get_group_num:\n+\tif (rte_vfio_container_destroy(sva->vfio_container_fd) != 0) {\n+\t\tsfc_vdpa_err(sva, \"failed to destroy container %d\",\n+\t\t\t     sva->vfio_container_fd);\n+\t}\n+\n+fail_container_create:\n+fail_inval:\n+\treturn -1;\n+}\n+\n+static void\n+sfc_vdpa_vfio_teardown(struct sfc_vdpa_adapter *sva)\n+{\n+\trte_pci_unmap_device(sva->pdev);\n+\n+\tif (rte_vfio_container_group_unbind(sva->vfio_container_fd,\n+\t\t\t\t\t    sva->iommu_group_num) != 0) {\n+\t\tsfc_vdpa_err(sva,\n+\t\t\t     \"failed to unbind IOMMU group %d from container %d\",\n+\t\t\t     sva->iommu_group_num, sva->vfio_container_fd);\n+\t}\n+\n+\tif (rte_vfio_container_destroy(sva->vfio_container_fd) != 0) {\n+\t\tsfc_vdpa_err(sva,\n+\t\t\t     \"failed to destroy container %d\",\n+\t\t\t     sva->vfio_container_fd);\n+\t}\n+}\n+\n+static int\n+sfc_vdpa_set_log_prefix(struct sfc_vdpa_adapter *sva)\n+{\n+\tstruct rte_pci_device *pci_dev = sva->pdev;\n+\tint ret;\n+\n+\tret = snprintf(sva->log_prefix, sizeof(sva->log_prefix),\n+\t\t       \"PMD: sfc_vdpa \" PCI_PRI_FMT \" : \",\n+\t\t       pci_dev->addr.domain, pci_dev->addr.bus,\n+\t\t       pci_dev->addr.devid, pci_dev->addr.function);\n+\n+\tif (ret < 0 || ret >= (int)sizeof(sva->log_prefix)) {\n+\t\tSFC_VDPA_GENERIC_LOG(ERR,\n+\t\t\t\"reserved log prefix is too short for \" PCI_PRI_FMT,\n+\t\t\tpci_dev->addr.domain, pci_dev->addr.bus,\n+\t\t\tpci_dev->addr.devid, pci_dev->addr.function);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+uint32_t\n+sfc_vdpa_register_logtype(const struct rte_pci_addr *pci_addr,\n+\t\t\t  const char *lt_prefix_str, uint32_t ll_default)\n+{\n+\tsize_t lt_prefix_str_size = strlen(lt_prefix_str);\n+\tsize_t lt_str_size_max;\n+\tchar *lt_str = NULL;\n+\tint ret;\n+\n+\tif (SIZE_MAX - PCI_PRI_STR_SIZE - 1 > lt_prefix_str_size) {\n+\t\t++lt_prefix_str_size; /* Reserve space for prefix separator */\n+\t\tlt_str_size_max = lt_prefix_str_size + PCI_PRI_STR_SIZE + 1;\n+\t} else {\n+\t\treturn RTE_LOGTYPE_PMD;\n+\t}\n+\n+\tlt_str = rte_zmalloc(\"logtype_str\", lt_str_size_max, 0);\n+\tif (lt_str == NULL)\n+\t\treturn RTE_LOGTYPE_PMD;\n+\n+\tstrncpy(lt_str, lt_prefix_str, lt_prefix_str_size);\n+\tlt_str[lt_prefix_str_size - 1] = '.';\n+\trte_pci_device_name(pci_addr, lt_str + lt_prefix_str_size,\n+\t\t\t    lt_str_size_max - lt_prefix_str_size);\n+\tlt_str[lt_str_size_max - 1] = '\\0';\n+\n+\tret = rte_log_register_type_and_pick_level(lt_str, ll_default);\n+\trte_free(lt_str);\n+\n+\treturn (ret < 0) ? RTE_LOGTYPE_PMD : ret;\n+}\n+\n+static struct rte_pci_id pci_id_sfc_vdpa_efx_map[] = {\n+\t{ RTE_PCI_DEVICE(EFX_PCI_VENID_XILINX, EFX_PCI_DEVID_RIVERHEAD_VF) },\n+\t{ .vendor_id = 0, /* sentinel */ },\n+};\n+\n+static int\n+sfc_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n+\tstruct rte_pci_device *pci_dev)\n+{\n+\tstruct sfc_vdpa_adapter *sva = NULL;\n+\tuint32_t logtype_main;\n+\tint ret = 0;\n+\n+\tif (sfc_efx_dev_class_get(pci_dev->device.devargs) !=\n+\t\t\tSFC_EFX_DEV_CLASS_VDPA) {\n+\t\tSFC_VDPA_GENERIC_LOG(INFO,\n+\t\t\t\"Incompatible device class: skip probing, should be probed by other sfc driver.\");\n+\t\t\treturn 1;\n+\t}\n+\n+\t/*\n+\t * It will not be probed in the secondary process. As device class\n+\t * is vdpa so return 0 to avoid probe by other sfc driver\n+\t */\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\tlogtype_main = sfc_vdpa_register_logtype(&pci_dev->addr,\n+\t\t\t\t\t\t SFC_VDPA_LOGTYPE_MAIN_STR,\n+\t\t\t\t\t\t RTE_LOG_NOTICE);\n+\n+\tsva = rte_zmalloc(\"sfc_vdpa\", sizeof(struct sfc_vdpa_adapter), 0);\n+\tif (sva == NULL)\n+\t\tgoto fail_zmalloc;\n+\n+\tsva->pdev = pci_dev;\n+\tsva->logtype_main = logtype_main;\n+\n+\tret = sfc_vdpa_set_log_prefix(sva);\n+\tif (ret != 0)\n+\t\tgoto fail_set_log_prefix;\n+\n+\tsfc_vdpa_log_init(sva, \"entry\");\n+\n+\tsfc_vdpa_log_init(sva, \"vfio init\");\n+\tif (sfc_vdpa_vfio_setup(sva) < 0) {\n+\t\tsfc_vdpa_err(sva, \"failed to setup device %s\", pci_dev->name);\n+\t\tgoto fail_vfio_setup;\n+\t}\n+\n+\tpthread_mutex_lock(&sfc_vdpa_adapter_list_lock);\n+\tTAILQ_INSERT_TAIL(&sfc_vdpa_adapter_list, sva, next);\n+\tpthread_mutex_unlock(&sfc_vdpa_adapter_list_lock);\n+\n+\tsfc_vdpa_log_init(sva, \"done\");\n+\n+\treturn 0;\n+\n+fail_vfio_setup:\n+fail_set_log_prefix:\n+\trte_free(sva);\n+\n+fail_zmalloc:\n+\treturn -1;\n+}\n+\n+static int\n+sfc_vdpa_pci_remove(struct rte_pci_device *pci_dev)\n+{\n+\tstruct sfc_vdpa_adapter *sva = NULL;\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn -1;\n+\n+\tsva = sfc_vdpa_get_adapter_by_dev(pci_dev);\n+\tif (sva == NULL) {\n+\t\tsfc_vdpa_info(sva, \"invalid device: %s\", pci_dev->name);\n+\t\treturn -1;\n+\t}\n+\n+\tpthread_mutex_lock(&sfc_vdpa_adapter_list_lock);\n+\tTAILQ_REMOVE(&sfc_vdpa_adapter_list, sva, next);\n+\tpthread_mutex_unlock(&sfc_vdpa_adapter_list_lock);\n+\n+\tsfc_vdpa_vfio_teardown(sva);\n+\n+\trte_free(sva);\n+\n+\treturn 0;\n+}\n+\n+static struct rte_pci_driver rte_sfc_vdpa = {\n+\t.id_table = pci_id_sfc_vdpa_efx_map,\n+\t.drv_flags = 0,\n+\t.probe = sfc_vdpa_pci_probe,\n+\t.remove = sfc_vdpa_pci_remove,\n+};\n+\n+RTE_PMD_REGISTER_PCI(net_sfc_vdpa, rte_sfc_vdpa);\n+RTE_PMD_REGISTER_PCI_TABLE(net_sfc_vdpa, pci_id_sfc_vdpa_efx_map);\n+RTE_PMD_REGISTER_KMOD_DEP(net_sfc_vdpa, \"* vfio-pci\");\n+RTE_LOG_REGISTER_SUFFIX(sfc_vdpa_logtype_driver, driver, NOTICE);\ndiff --git a/drivers/vdpa/sfc/sfc_vdpa.h b/drivers/vdpa/sfc/sfc_vdpa.h\nnew file mode 100644\nindex 0000000..3b77900\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa.h\n@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * Copyright(c) 2020-2021 Xilinx, Inc.\n+ */\n+\n+#ifndef _SFC_VDPA_H\n+#define _SFC_VDPA_H\n+\n+#include <stdint.h>\n+#include <sys/queue.h>\n+\n+#include <rte_bus_pci.h>\n+\n+#include \"sfc_vdpa_log.h\"\n+\n+/* Adapter private data */\n+struct sfc_vdpa_adapter {\n+\tTAILQ_ENTRY(sfc_vdpa_adapter)\tnext;\n+\tstruct rte_pci_device\t\t*pdev;\n+\tstruct rte_pci_addr\t\tpci_addr;\n+\n+\tchar\t\t\t\tlog_prefix[SFC_VDPA_LOG_PREFIX_MAX];\n+\tuint32_t\t\t\tlogtype_main;\n+\n+\tint\t\t\t\tvfio_group_fd;\n+\tint\t\t\t\tvfio_dev_fd;\n+\tint\t\t\t\tvfio_container_fd;\n+\tint\t\t\t\tiommu_group_num;\n+};\n+\n+uint32_t\n+sfc_vdpa_register_logtype(const struct rte_pci_addr *pci_addr,\n+\t\t\t  const char *lt_prefix_str,\n+\t\t\t  uint32_t ll_default);\n+\n+struct sfc_vdpa_adapter *\n+sfc_vdpa_get_adapter_by_dev(struct rte_pci_device *pdev);\n+\n+#endif  /* _SFC_VDPA_H */\n+\ndiff --git a/drivers/vdpa/sfc/sfc_vdpa_log.h b/drivers/vdpa/sfc/sfc_vdpa_log.h\nnew file mode 100644\nindex 0000000..0a3d6ad\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa_log.h\n@@ -0,0 +1,77 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * Copyright(c) 2020-2021 Xilinx, Inc.\n+ */\n+\n+#ifndef _SFC_VDPA_LOG_H_\n+#define _SFC_VDPA_LOG_H_\n+\n+/** Generic driver log type */\n+extern int sfc_vdpa_logtype_driver;\n+\n+/** Common log type name prefix */\n+#define SFC_VDPA_LOGTYPE_PREFIX\t\"pmd.vdpa.sfc.\"\n+\n+/** Log PMD generic message, add a prefix and a line break */\n+#define SFC_VDPA_GENERIC_LOG(level, ...) \\\n+\trte_log(RTE_LOG_ ## level, sfc_vdpa_logtype_driver,\t\t\\\n+\t\tRTE_FMT(\"PMD: \" RTE_FMT_HEAD(__VA_ARGS__ ,) \"\\n\",\t\\\n+\t\t\tRTE_FMT_TAIL(__VA_ARGS__ ,)))\n+\n+/** Name prefix for the per-device log type used to report basic information */\n+#define SFC_VDPA_LOGTYPE_MAIN_STR\tSFC_VDPA_LOGTYPE_PREFIX \"main\"\n+\n+#define SFC_VDPA_LOG_PREFIX_MAX\t32\n+\n+/* Log PMD message, automatically add prefix and \\n */\n+#define SFC_VDPA_LOG(sva, level, type, ...) \\\n+\trte_log(level, type,\t\t\t\t\t\\\n+\t\tRTE_FMT(\"%s\" RTE_FMT_HEAD(__VA_ARGS__ ,) \"\\n\",\t\\\n+\t\t\tsva->log_prefix,\t\t\t\\\n+\t\t\tRTE_FMT_TAIL(__VA_ARGS__ ,)))\n+\n+#define sfc_vdpa_err(sva, ...) \\\n+\tdo {\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\\\n+\t\t\t\t\t\t\t\t\\\n+\t\tSFC_VDPA_LOG(_sva, RTE_LOG_ERR,\t\t\t\\\n+\t\t\t_sva->logtype_main, __VA_ARGS__);\t\\\n+\t} while (0)\n+\n+#define sfc_vdpa_warn(sva, ...) \\\n+\tdo {\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\\\n+\t\t\t\t\t\t\t\t\\\n+\t\tSFC_VDPA_LOG(_sva, RTE_LOG_WARNING,\t\t\\\n+\t\t\t_sva->logtype_main, __VA_ARGS__);\t\\\n+\t} while (0)\n+\n+#define sfc_vdpa_notice(sva, ...) \\\n+\tdo {\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\\\n+\t\t\t\t\t\t\t\t\\\n+\t\tSFC_VDPA_LOG(_sva, RTE_LOG_NOTICE,\t\t\\\n+\t\t\t_sva->logtype_main, __VA_ARGS__);\t\\\n+\t} while (0)\n+\n+#define sfc_vdpa_info(sva, ...) \\\n+\tdo {\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\\\n+\t\t\t\t\t\t\t\t\\\n+\t\tSFC_VDPA_LOG(_sva, RTE_LOG_INFO,\t\t\\\n+\t\t\t_sva->logtype_main, __VA_ARGS__);\t\\\n+\t} while (0)\n+\n+#define sfc_vdpa_log_init(sva, ...) \\\n+\tdo {\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\\\n+\t\t\t\t\t\t\t\t\\\n+\t\tSFC_VDPA_LOG(_sva, RTE_LOG_INFO,\t\t\\\n+\t\t\t_sva->logtype_main,\t\t\t\\\n+\t\t\tRTE_FMT(\"%s(): \"\t\t\t\\\n+\t\t\t\tRTE_FMT_HEAD(__VA_ARGS__ ,),\t\\\n+\t\t\t\t__func__,\t\t\t\\\n+\t\t\t\tRTE_FMT_TAIL(__VA_ARGS__ ,)));\t\\\n+\t} while (0)\n+\n+#endif /* _SFC_VDPA_LOG_H_ */\ndiff --git a/drivers/vdpa/sfc/version.map b/drivers/vdpa/sfc/version.map\nnew file mode 100644\nindex 0000000..4a76d1d\n--- /dev/null\n+++ b/drivers/vdpa/sfc/version.map\n@@ -0,0 +1,3 @@\n+DPDK_21 {\n+\tlocal: *;\n+};\n",
    "prefixes": [
        "01/10"
    ]
}