get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 103659,
    "url": "https://patches.dpdk.org/api/patches/103659/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211103135754.17411-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": "<20211103135754.17411-2-vsrivast@xilinx.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211103135754.17411-2-vsrivast@xilinx.com",
    "date": "2021-11-03T13:57:45",
    "name": "[v4,01/10] vdpa/sfc: introduce Xilinx vDPA driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b75329327018bc68a268290ffc7c45614947db50",
    "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/20211103135754.17411-2-vsrivast@xilinx.com/mbox/",
    "series": [
        {
            "id": 20277,
            "url": "https://patches.dpdk.org/api/series/20277/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=20277",
            "date": "2021-11-03T13:57:44",
            "name": "vdpa/sfc: introduce Xilinx vDPA driver",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/20277/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/103659/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/103659/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 7B382A0C53;\n\tWed,  3 Nov 2021 15:00:49 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 80D5842721;\n\tWed,  3 Nov 2021 15:00:43 +0100 (CET)",
            "from NAM04-BN8-obe.outbound.protection.outlook.com\n (mail-bn8nam08on2068.outbound.protection.outlook.com [40.107.100.68])\n by mails.dpdk.org (Postfix) with ESMTP id A650E41134\n for <dev@dpdk.org>; Wed,  3 Nov 2021 15:00:41 +0100 (CET)",
            "from BN9PR03CA0353.namprd03.prod.outlook.com (2603:10b6:408:f6::28)\n by DM6PR02MB4186.namprd02.prod.outlook.com (2603:10b6:5:9a::24) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.19; Wed, 3 Nov\n 2021 14:00:39 +0000",
            "from BN1NAM02FT030.eop-nam02.prod.protection.outlook.com\n (2603:10b6:408:f6:cafe::e0) by BN9PR03CA0353.outlook.office365.com\n (2603:10b6:408:f6::28) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend\n Transport; Wed, 3 Nov 2021 14:00:39 +0000",
            "from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by\n BN1NAM02FT030.mail.protection.outlook.com (10.13.2.144) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.20.4649.14 via Frontend Transport; Wed, 3 Nov 2021 14:00:39 +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.14; Wed, 3 Nov 2021 07:00:35 -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.14 via Frontend Transport; Wed, 3 Nov 2021 07:00:35 -0700",
            "from [10.170.66.108] (port=38886 helo=xndengvm004108.xilinx.com)\n by smtp.xilinx.com with esmtp (Exim 4.90)\n (envelope-from <vijay.srivastava@xilinx.com>)\n id 1miGoc-0003SS-Sc; Wed, 03 Nov 2021 07:00:35 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=iwANE18L5Vs/r6qCHyJRbrKxX3a+xM8Ew7ku0vf4jKwfd9CstRXzgAyI+yT8Af+86CsXUsZOH+xWH0ZObWXDQ8XyvKqzf89DpwJOEDAFnF70YgXlzCnafsZ6W4aeMttMeB3xQMvtwwtp+gyEHjlFPuQUyaKANphyzSPTmo1irtPCQKeAh/1TRe/igLkidge/CIXc+qa8BoDZGtr/e4FQg7JvQDSA9A1wIH/AeTjt63qsSvXD+h8TsrGuN1wqSsBkL/Qn7/7a/KN+hfPhjzGbCkudIVjJvpB9Wkx6eISLt5vgC96F4z3NymfkG0I6FIIoC5C6h8oaslAzL82BXWjS1A==",
        "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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=mNlLgs5SJBl9ZDkoJLXmSAg5RUMdKiT2bbhDDELS5iE=;\n b=D2hMFIfck8g6JUYpo38AcOYC2uMgay3sfoiUdtuRdP4puLWU+9wLbBuF75hM7+4wx8qbhdZ0ecrcPkQRjunyW0DZukTjXT7yxM3U0gRz7ddsscQzuoZ90/tOXy5CVBhM1ZKhzNWXuRSALHJW6rWzzwCHoVVAm1xSaGUBK0oHM29D3VoTKlfg0zFQLZEaKrXe5JIFo4DkF/q9spo/pVjTYUcXszXYH31qeUtpXPAU9diUi1QgyxxFwNpdoNxOWhtydRyfo6jEq7mHubOWbVSaGx9x0hzy8YLhlhecgVxwHc0cdToErCTZNkIgUOTgxPIsYr/DsT5Uy17z7nY5oAbIHA==",
        "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=mNlLgs5SJBl9ZDkoJLXmSAg5RUMdKiT2bbhDDELS5iE=;\n b=AUJt5BunSWzYt4uwKaP7htGsDdKZCrECvFcMSKMaU5LrmQtiq5rR8n1JyUSD+TO1GlvaygeaPBJjpp9edoE0GoezK/mznr2GzJFooCZD8JsYKrgr8m/PSon9LWJ8O5mSgNYlKbo/2LstxLJfNizXP68/O9HyChI9R6VdVo/ivMU=",
        "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": "Wed, 3 Nov 2021 19:27:45 +0530",
        "Message-ID": "<20211103135754.17411-2-vsrivast@xilinx.com>",
        "X-Mailer": "git-send-email 2.25.0",
        "In-Reply-To": "<20211103135754.17411-1-vsrivast@xilinx.com>",
        "References": "<20210706164418.32615-1-vsrivast@xilinx.com>\n <20211103135754.17411-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": "0a0ff08d-ef27-45a4-a3a9-08d99ed2513d",
        "X-MS-TrafficTypeDiagnostic": "DM6PR02MB4186:",
        "X-Microsoft-Antispam-PRVS": "\n <DM6PR02MB4186CAF034F3B19462350E9EB98C9@DM6PR02MB4186.namprd02.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:236;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n SU0qKI2BjgpFdNr5GrcutPtd7gfWsjJ5gdZHQ/x65GNmqBweiFwh0swF3v0BY1PXU+fxEOTbQFcu0taf6NnzXz1UAMjpoY7nn2DoPHrnx3fk9DrTsLndpHNQST84D9gsu3u4lgZewt0xwW417A8Jpm/0VNqWE2eU4faSDpNhIdfm6MFOsIfV6ri/LzltxEXOQNrgK3MXi/HhQ5F8+0miaQjDJwHVKRQlVCQEcl6wdWNfsQ3Gd6rMyhyBnvsPkZSw1pl6qBZJNBxQzo0eJTl9mu3fOj1jTU3UniIairgk0cdvX2UGx/dIHAhSVp7ShiHFtzn7mrPyDKawiMD/J7lytheNtlIT0lFqLgS1E+nXdiI11it4jrApJEUxtg31wUHjnnR9/ZBOJ3bPFQgfNI6pWU1AIDJd71/fC+NdZSOCSFnpnsUQi86OeutR03qfWSjAZZVa2HFFZAIQstfJ/VXvvphSU+UNyTPpthFJjGCTa1dbKyJGRtXBslbfVnRDIFv9wxojdmA4MbQ98BlksMfbp/DtR02QyMMo/Mww/KaDu21yU004KdxlzWdcFMSTBKZKP13LHwlitunYTljbB/Iyl7PwM4EzCSV93WtvCbNhnZ33vxFWM8A5C7zYLaVlDNW3ZQpCtlIryS/rENp3Py7aEuhTDqNiT80FOvoFCRtsYJQmW+h1SD82CcsPtftQkrSMz+VT9zeslLZ2FZ5jJET5dJT3sceVmRX3y+AwnhF00qpd4PaPEUBMgFQ9UmpSD6paTW7WI3DUkGjJPeojpdyNWt2P4l2r6TY6k92OyQTVbjkYatKzZECB7PF04J1rMRsDehkbCtXGP3xZMAZVcQZumhfF6lxHMPC906M6+9RZ7oQ=",
        "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:(46966006)(36840700001)(2616005)(83380400001)(7636003)(82310400003)(70206006)(8676002)(1076003)(186003)(508600001)(36756003)(4326008)(356005)(30864003)(70586007)(336012)(2906002)(966005)(44832011)(47076005)(316002)(5660300002)(7696005)(426003)(54906003)(36860700001)(6666004)(26005)(8936002)(36906005)(9786002)(6916009)(107886003)(102446001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "xilinx.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "03 Nov 2021 14:00:39.1541 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 0a0ff08d-ef27-45a4-a3a9-08d99ed2513d",
        "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 BN1NAM02FT030.eop-nam02.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM6PR02MB4186",
        "Subject": "[dpdk-dev] [PATCH v4 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 operations of Xilinx devices.\nThis patch implements probe and remove functions.\n\nSigned-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>\nAcked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\nv2:\n* Updated logging macros to remove redundant code.\n\nv3:\n* Replaced depreciated whitelist with allowlist.\n* Text corrections in the sfc.rst and commit msg.\n* Added sfc in the toctree of doc/guides/vdpadevs/index.rst.\n* Removed extra compiler flags.\n\nv4:\n* Removed redundant NULL checks.\n* Removed unused pci_addr from adapter structure.\n* Updated format specifiers in log messages.\n\n MAINTAINERS                            |   6 +\n doc/guides/rel_notes/release_21_11.rst |   5 +\n doc/guides/vdpadevs/features/sfc.ini   |   9 ++\n doc/guides/vdpadevs/index.rst          |   1 +\n doc/guides/vdpadevs/sfc.rst            |  97 ++++++++++++\n drivers/vdpa/meson.build               |   1 +\n drivers/vdpa/sfc/meson.build           |  22 +++\n drivers/vdpa/sfc/sfc_vdpa.c            | 282 +++++++++++++++++++++++++++++++++\n drivers/vdpa/sfc/sfc_vdpa.h            |  39 +++++\n drivers/vdpa/sfc/sfc_vdpa_log.h        |  56 +++++++\n drivers/vdpa/sfc/version.map           |   3 +\n 11 files changed, 521 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 be2c9b6..5d12c49 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1236,6 +1236,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_11.rst b/doc/guides/rel_notes/release_21_11.rst\nindex c68f122..0859b9b 100644\n--- a/doc/guides/rel_notes/release_21_11.rst\n+++ b/doc/guides/rel_notes/release_21_11.rst\n@@ -324,6 +324,11 @@ New Features\n   with the capability for the application to configure the hash key, the\n   RETA and the hash types. Virtio hash reporting is yet to be added.\n \n+* **Added 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/index.rst b/doc/guides/vdpadevs/index.rst\nindex 1a13efe..cc2f858 100644\n--- a/doc/guides/vdpadevs/index.rst\n+++ b/doc/guides/vdpadevs/index.rst\n@@ -14,3 +14,4 @@ which can be used from an application through vhost API.\n     features_overview\n     ifc\n     mlx5\n+    sfc\ndiff --git a/doc/guides/vdpadevs/sfc.rst b/doc/guides/vdpadevs/sfc.rst\nnew file mode 100644\nindex 0000000..44e694f\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 that have 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+allowlist option like \"-a 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..4255d65\n--- /dev/null\n+++ b/drivers/vdpa/sfc/meson.build\n@@ -0,0 +1,22 @@\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+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..f087944\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa.c\n@@ -0,0 +1,282 @@\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+\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 = rte_intr_dev_fd_get(dev->intr_handle);\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+\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..2ae9ec3\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa.h\n@@ -0,0 +1,39 @@\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+\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..858e5ee\n--- /dev/null\n+++ b/drivers/vdpa/sfc/sfc_vdpa_log.h\n@@ -0,0 +1,56 @@\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, ...) \\\n+\tdo {\t\t\t\t\t\t\t\t\\\n+\t\tconst struct sfc_vdpa_adapter *_sva = (sva);\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\trte_log(RTE_LOG_ ## level, _sva->logtype_main,\t\t\\\n+\t\t\tRTE_FMT(\"%s\" RTE_FMT_HEAD(__VA_ARGS__ ,) \"\\n\",\t\\\n+\t\t\t\t_sva->log_prefix,\t\t\t\\\n+\t\t\t\tRTE_FMT_TAIL(__VA_ARGS__ ,)));\t\t\\\n+\t} while (0)\n+\n+#define sfc_vdpa_err(sva, ...) \\\n+\tSFC_VDPA_LOG(sva, ERR, __VA_ARGS__)\n+\n+#define sfc_vdpa_warn(sva, ...) \\\n+\tSFC_VDPA_LOG(sva, WARNING, __VA_ARGS__)\n+\n+#define sfc_vdpa_notice(sva, ...) \\\n+\tSFC_VDPA_LOG(sva, NOTICE, __VA_ARGS__)\n+\n+#define sfc_vdpa_info(sva, ...) \\\n+\tSFC_VDPA_LOG(sva, INFO, __VA_ARGS__)\n+\n+#define sfc_vdpa_log_init(sva, ...) \\\n+\tSFC_VDPA_LOG(sva, INFO,\t\t\t\t\\\n+\t\tRTE_FMT(\"%s(): \"\t\t\t\\\n+\t\t\tRTE_FMT_HEAD(__VA_ARGS__ ,),\t\\\n+\t\t\t__func__,\t\t\t\\\n+\t\t\tRTE_FMT_TAIL(__VA_ARGS__ ,)))\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": [
        "v4",
        "01/10"
    ]
}