get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132167,
    "url": "http://patches.dpdk.org/api/patches/132167/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230929020810.1219391-2-chaoyong.he@corigine.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230929020810.1219391-2-chaoyong.he@corigine.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230929020810.1219391-2-chaoyong.he@corigine.com",
    "date": "2023-09-29T02:08:02",
    "name": "[v3,1/9] net/nfp: add TLVs capability parsing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "798d6ee59c2b99699cdb7ecbf8e1a720fcf09f38",
    "submitter": {
        "id": 2554,
        "url": "http://patches.dpdk.org/api/people/2554/?format=api",
        "name": "Chaoyong He",
        "email": "chaoyong.he@corigine.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230929020810.1219391-2-chaoyong.he@corigine.com/mbox/",
    "series": [
        {
            "id": 29689,
            "url": "http://patches.dpdk.org/api/series/29689/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29689",
            "date": "2023-09-29T02:08:01",
            "name": "add the support of ipsec offload",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/29689/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/132167/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/132167/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 1CC7E42668;\n\tFri, 29 Sep 2023 04:08:43 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 46DD4402AD;\n\tFri, 29 Sep 2023 04:08:37 +0200 (CEST)",
            "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2139.outbound.protection.outlook.com [40.107.220.139])\n by mails.dpdk.org (Postfix) with ESMTP id 342A2400D6\n for <dev@dpdk.org>; Fri, 29 Sep 2023 04:08:35 +0200 (CEST)",
            "from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5)\n by CO3PR13MB5687.namprd13.prod.outlook.com (2603:10b6:303:17a::17)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.19; Fri, 29 Sep\n 2023 02:08:33 +0000",
            "from SJ0PR13MB5545.namprd13.prod.outlook.com\n ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com\n ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Fri, 29 Sep 2023\n 02:08:33 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=e/k1lvYUT2JTgo0+Z6xekcZop0JgTf3owYi6UBLg7EJCxuolQvqdKQ4dytacHQdT10g1b6fC3Swxbs5tD/hlMUb4cXo9q5lZGWY+PNyib+OhxJGlv5iX07AumBd9idGIddPg5vMkjMDLWQQEXWvWIGuoNN2CImNcFgle8XAJvgIdDBoNLiKnKPviBVOf+BCvmgUPx8h0jAfQcq7EYc7W1NsaqSQ0kB1+GcUJ6gUUeYlY4qACec+aNHVo4Nqrrm1AuKWfE1V+vF7vXwjILoGpFmcdaEVxuDdMKTAQfv5sqi2elnKzN71T6OJQRko/1PsLdCLrFj9civgyUhJJQn3y6A==",
        "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=+ft1RMlRk8wTTzRedT6hLKl5Gqi4MW/jmPI06FHs8xw=;\n b=AhCNd4F01QIF+fojFShv7kx6tspxnYHjKvtrvcmHyccnLnHyp17pIIcl5DBLSGCrU+y0owqdB1A/frroVbTSFexJg7qxwo7tLNNSHqCMr4Bc8gujoVq+gSR6EnFp/5V2jHbGEx/QKPBe9/7c5fuT7SxGxT8Ock3qUog5kXsU2uJieV+fjWugOOsHrH1/wwYN1YfuvZeGTBHZCydVNkLyr93Nll6uL2KmDzsEmjdoZWvcZNX8fWY7NC8InsqbI5YGIQq9GZDYGag24aXDyMSWWeqLjb7ToETb5CKxGduGwKZJxT3QkII4S81DEDVj2HjPaeVVmPATw9fUkbs+9ch/xA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com;\n dkim=pass header.d=corigine.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=+ft1RMlRk8wTTzRedT6hLKl5Gqi4MW/jmPI06FHs8xw=;\n b=E5AwvkBO3NZTX88DdMMZN8W14tjZi70vPlFVHQAs2/AioJ5iQf/oFwoOdUmC8tLhR0zKsGik6qhrxR4f4XpMPEaQ3c5W+cp9PiorXt3cd4ZD6GRikzUeml9az+Ugcrs/+nWsI9ikIMAEo6b/L+CoYJLEScfj1OsjsMgLyvjWuhM=",
        "Authentication-Results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=corigine.com;",
        "From": "Chaoyong He <chaoyong.he@corigine.com>",
        "To": "dev@dpdk.org",
        "Cc": "oss-drivers@corigine.com, Shihong Wang <shihong.wang@corigine.com>,\n Chang Miao <chang.miao@corigine.com>,\n Chaoyong He <chaoyong.he@corigine.com>",
        "Subject": "[PATCH v3 1/9] net/nfp: add TLVs capability parsing",
        "Date": "Fri, 29 Sep 2023 10:08:02 +0800",
        "Message-Id": "<20230929020810.1219391-2-chaoyong.he@corigine.com>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230929020810.1219391-1-chaoyong.he@corigine.com>",
        "References": "<20230926024959.207098-1-chaoyong.he@corigine.com>\n <20230929020810.1219391-1-chaoyong.he@corigine.com>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "PH8PR07CA0028.namprd07.prod.outlook.com\n (2603:10b6:510:2cf::23) To SJ0PR13MB5545.namprd13.prod.outlook.com\n (2603:10b6:a03:424::5)",
        "MIME-Version": "1.0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "SJ0PR13MB5545:EE_|CO3PR13MB5687:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "5dae8a0f-5009-42b9-7fb4-08dbc090fb8e",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n +StcWWgigexuGDeEYix1pTRxAe+MpBmonT4BUWHLs8HFlevMKTt3dyPBo78DuMCrVb1bmQ1pFCMwpOyzdyQHIJBz3ods1iJiSBlcM8ImmMNDRq/9GAPcwfLQtc/j6JGKw33zmr1jaKdiydy358oX8mqICQZ04sl1RbSeNcjjth1fZN7/wnDiZq+g+JeFvZIWHH8+bSWiIHe1viFqY7vfIA7FjEmIeoNY7Zc/fiUCp1/a9guN3lqux3vP3/FAMOqKoUgJX/0ojymITx111zq+pN9h9k0MKWsoiAc3zZQKcwEdYXRgRumT9FZ0wVzO8VHpULe0SYk7dB/olF1NFZVT1MrX64x+F3MNwZH+T1dz0m3pWG1cYMZwEImftXJEqcY0v9jubAJkh0HLxcUOox3t5oU/6Zd5qDiTRllXJPW0F90fAXTKmAw1XHGnUlgBFMKmFHHPnyex21fej1s3zyy92fpPvL06BF0ShVKuG/eul+UdzoQyxodEI7ouJcG45qFi96b8Dxso0m2bskqph2Lq3M+NGBZnPrfHSTwXJUCxR7Z0jQWKHFtYYR8Qro0cAvtqdy0O0mC6gGb+ZhXeZBA+TSyo37iNhxcuyGFhyiSr1f9Lc6l69yfnM3dS+wXA3+R4QdQM/YTzT0yFWH2Q/4a3A+p2mmxE533+Urq2K2Co8xI=",
        "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(346002)(366004)(396003)(376002)(39830400003)(136003)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(30864003)(2906002)(6916009)(316002)(54906003)(66946007)(66556008)(66476007)(44832011)(8936002)(8676002)(4326008)(41300700001)(5660300002)(2616005)(83380400001)(107886003)(1076003)(26005)(36756003)(86362001)(38100700002)(38350700002)(52116002)(6666004)(478600001)(6486002)(6512007)(6506007);\n DIR:OUT; SFP:1102;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n bqkTk1AwQ2KGbJEyrgp5Iiq2n1NtWOUifQElqlreJ8zpHQW601xoWddKlJn7RYUBU7lQOz7Rg7ApTxpLm/o+D8o99PiCCNEGIqlYyUyWZPrm6Xhf2r+VpXQdV4T9pqHyOfI6rrHvCCKjwWFQgBYV3iUqgAjI345Z3vu4HQnx9PuOf2hApsKmEhMxOg5ATz2gWm57Armv8ELlXHwAL6YS1/Wo5WcO4IJIgarEVH7yO32umiVdxhv2IOrMXC6mYzf/DNKrVrk7xQqRuoJdwOdnfzvEq7yMq6QmdlDlH7vhPC04uUEiK1RcGc+Qc/HZ9VCFnlCqh6ZQmRznbnzVh9ehvoeB4/htRf+D6LRC4Cl6JfeolrepaowmWv2El4PQ2MVpWcyeP7snuFcE0lE8PawTHVmrcpxtKQay08gZK1OH0uln1FGOfq3c/6fQXeEdJBVrBhxvMhR4OGhLiJDuGLpJPNQGgl6IK0RxiRLLZpHVQHGj+SU88RO9VQlDZAA8Vo8y/9NAQrgZRNF9MtXFnvzsycjH43A/c/ELU6qO9NAcDONxDIbIFBs/FZvFi4fE+e6ZPRJsVIZXyJ6vlIFXzXQP4dLu5AjuYB1LWDk03dhIIqQSXeVacDClx7RnaskoL+Yxk444rFEzZKQgHNCwe8721sPJ3Et5ATOn2i6ZKZWyMbqiysnxooafrXOI1l6A6ZtvSCouHWG2BSvbXm9LX4kjIGbpism0mqmUsbX4uTTHz37rCsGTwd1/b8lz9ZGyzvgeDQlJlOlAtWvGXNo1huyZ6yhW8QgCpJ3hpH1XXbx5nw2Psd75BZFBcascy32ciq5seXzQX7kDYHEtp9OPUhSCZ8uqBdATBvM7ys4sWCOgaXIgNFnRe1LXruOG+dCjBhgJOoTF7U19lxS07F+fgclkA4BnnXxmG4k9aMyzJ6UKcWLAW+1BrA1KMZ5kAhrFSXgL7QxfDr5xbLkgOCQCoDKSSecEq9kMLlMKE12wUusTcl/QAWcoX4BgDa0x1qfdl4DTLOuSC+c3M+j/O2jemywz9T4jRcJRVvYb3O7s2A0Srsa19XzYfGPnDpYrec//6xn09jRiMos23v4qSaMKygJgmd5Ydg65B76UUZCxuJDiP8BUKqfW1QDyWsA3eOMSHlvLPT6CbfqjaIhBFv6fc4ZNejQkcAEbQAqT3JXpNtckpBAZaawu4a5UbhyovxyaVXqIhp85Wi1vDtD6VCrCdNBwQGI1/aSUX8+D4zM5pduOh0fnLhs+1d8Byem6gaFAO9P2aNFTIaR1XVNLJ3gXuTNj2SqAOJ4ETYTmCvCaJBJ1t7BX5E1dG6N/SX+H3z9ZYcfnMBr1LpTOKWUC97vlRn1u55z7igVsklECr27g92tlzJwP6BWoIUXtrUnMUoJYami6vR0UADE0CLxmlI1E1hvnQH/bTrmpZNiNaeTnkOEA/ucO1mgnGmrWygLDZgaHXbzWTalNNeDKEVQP1aYnaSDr/HsdVuD8pY56e55n7EF4BKIlQjOGWTCKSYV9YlPYQ/LbFd+xN0vqTPORSoBjEMwwscmLeYjdzzJxhmfKxn8jVFXOADK6ooQKQYp5kbb+y180vQW5sYg/mjwEC7HZHvtzXw==",
        "X-OriginatorOrg": "corigine.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 5dae8a0f-5009-42b9-7fb4-08dbc090fb8e",
        "X-MS-Exchange-CrossTenant-AuthSource": "SJ0PR13MB5545.namprd13.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "29 Sep 2023 02:08:33.4158 (UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "fe128f2c-073b-4c20-818e-7246a585940c",
        "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED",
        "X-MS-Exchange-CrossTenant-UserPrincipalName": "\n /zVwq+0UFo7NjCvHGsQzycXXLU8hHYRRWIzBa6aaWsYW0GWwfy3fTfb4uEbMIFBj5Xw6Uu5cSRjb6ahPKkpe63iXYzkPMjV03GwrVYOZP84=",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CO3PR13MB5687",
        "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"
    },
    "content": "From: Shihong Wang <shihong.wang@corigine.com>\n\nAdd TLV capabilities to the BAR, TLVs is fit for expressing\ncapabilities of applications running on programmable hardware.\nThe TVL capabilities is needed for the upcoming mailbox channel.\nAlso add contributor entries to .mailmap file.\n\nSigned-off-by: Shihong Wang <shihong.wang@corigine.com>\nSigned-off-by: Chang Miao <chang.miao@corigine.com>\nReviewed-by: Chaoyong He <chaoyong.he@corigine.com>\n---\n .mailmap                     |   2 +\n drivers/net/nfp/meson.build  |   1 +\n drivers/net/nfp/nfp_common.h |   9 +++\n drivers/net/nfp/nfp_ctrl.c   | 110 +++++++++++++++++++++++++++++++++\n drivers/net/nfp/nfp_ctrl.h   | 114 +++++++++++++++++++++++++++++++++++\n drivers/net/nfp/nfp_ethdev.c |   6 ++\n 6 files changed, 242 insertions(+)\n create mode 100644 drivers/net/nfp/nfp_ctrl.c",
    "diff": "diff --git a/.mailmap b/.mailmap\nindex 276325211c..5abd5810e2 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -200,6 +200,7 @@ Carolyn Wyborny <carolyn.wyborny@intel.com>\n Chaeyong Chong <cychong@gmail.com>\n Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>\n Chandubabu Namburu <chandu@amd.com>\n+Chang Miao <chang.miao@corigine.com>\n Changchun Ouyang <changchun.ouyang@intel.com>\n Changpeng Liu <changpeng.liu@intel.com>\n Changqing Wu <changqingx.wu@intel.com>\n@@ -1265,6 +1266,7 @@ Shelton Chia <jiaxt@sinogrid.com>\n Shepard Siegel <shepard.siegel@atomicrules.com>\n Shesha Sreenivasamurthy <shesha@cisco.com>\n Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>\n+Shihong Wang <shihong.wang@corigine.com>\n Shijith Thotton <sthotton@marvell.com> <shijith.thotton@caviumnetworks.com>\n Shiqi Liu <835703180@qq.com>\n Shiri Kuzin <shirik@nvidia.com> <shirik@mellanox.com>\ndiff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build\nindex d422269c4b..e78bcb8b75 100644\n--- a/drivers/net/nfp/meson.build\n+++ b/drivers/net/nfp/meson.build\n@@ -27,6 +27,7 @@ sources = files(\n         'nfpcore/nfp_target.c',\n         'nfpcore/nfp6000_pcie.c',\n         'nfp_common.c',\n+        'nfp_ctrl.c',\n         'nfp_rxtx.c',\n         'nfp_cpp_bridge.c',\n         'nfp_ethdev_vf.c',\ndiff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h\nindex b0372c3dc6..b02475b403 100644\n--- a/drivers/net/nfp/nfp_common.h\n+++ b/drivers/net/nfp/nfp_common.h\n@@ -64,6 +64,13 @@ enum nfp_net_meta_format {\n \tNFP_NET_METAFORMAT_CHAINED,\n };\n \n+/* Parsed control BAR TLV capabilities */\n+struct nfp_net_tlv_caps {\n+\tuint32_t mbox_off;               /**< VNIC mailbox area offset */\n+\tuint32_t mbox_len;               /**< VNIC mailbox area length */\n+\tuint32_t mbox_cmsg_types;        /**< Cmsgs which can be passed through the mailbox */\n+};\n+\n struct nfp_pf_dev {\n \t/* Backpointer to associated pci device */\n \tstruct rte_pci_device *pci_dev;\n@@ -163,6 +170,8 @@ struct nfp_net_hw {\n \tuint8_t idx;\n \t/* Internal port number as seen from NFP */\n \tuint8_t nfp_idx;\n+\n+\tstruct nfp_net_tlv_caps tlv_caps;\n };\n \n struct nfp_net_adapter {\ndiff --git a/drivers/net/nfp/nfp_ctrl.c b/drivers/net/nfp/nfp_ctrl.c\nnew file mode 100644\nindex 0000000000..6fc8cffd2e\n--- /dev/null\n+++ b/drivers/net/nfp/nfp_ctrl.c\n@@ -0,0 +1,110 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2023 Corigine Systems, Inc.\n+ * All rights reserved.\n+ */\n+\n+#include \"nfp_ctrl.h\"\n+\n+#include <ethdev_pci.h>\n+\n+#include \"nfpcore/nfp_platform.h\"\n+\n+#include \"nfp_common.h\"\n+#include \"nfp_logs.h\"\n+\n+static void\n+nfp_net_tlv_caps_reset(struct nfp_net_tlv_caps *caps)\n+{\n+\tmemset(caps, 0, sizeof(*caps));\n+\tcaps->mbox_off = NFP_NET_CFG_MBOX_BASE;\n+\tcaps->mbox_len = NFP_NET_CFG_MBOX_VAL_MAX_SZ;\n+}\n+\n+int\n+nfp_net_tlv_caps_parse(struct rte_eth_dev *dev)\n+{\n+\tuint32_t hdr;\n+\tuint8_t *end;\n+\tuint8_t *data;\n+\tuint32_t length;\n+\tuint32_t offset;\n+\tuint32_t tlv_type;\n+\tstruct nfp_net_hw *hw;\n+\tstruct nfp_net_tlv_caps *caps;\n+\n+\thw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tcaps = &hw->tlv_caps;\n+\tnfp_net_tlv_caps_reset(caps);\n+\n+\tdata = hw->ctrl_bar + NFP_NET_CFG_TLV_BASE;\n+\tend = hw->ctrl_bar + NFP_NET_CFG_BAR_SZ;\n+\n+\thdr = rte_read32(data);\n+\tif (hdr == 0) {\n+\t\tPMD_DRV_LOG(INFO, \"TLV is empty!\");\n+\t\treturn 0;\n+\t}\n+\n+\tfor (; ; data += length) {\n+\t\toffset = data - hw->ctrl_bar;\n+\n+\t\tif (data + NFP_NET_CFG_TLV_VALUE > end) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Reached end of BAR without END TLV\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\thdr = rte_read32(data);\n+\n+\t\tlength = FIELD_GET(NFP_NET_CFG_TLV_HEADER_LENGTH, hdr);\n+\t\tif ((length & (NFP_NET_CFG_TLV_LENGTH_INC - 1)) != 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"TLV size not multiple of 4B len: %u\", length);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\t/* Advance past the header */\n+\t\tdata += NFP_NET_CFG_TLV_VALUE;\n+\t\tif (data + length > end) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Oversized TLV offset: %u len: %u\",\n+\t\t\t\t\toffset, length);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\ttlv_type = FIELD_GET(NFP_NET_CFG_TLV_HEADER_TYPE, hdr);\n+\n+\t\tswitch (tlv_type) {\n+\t\tcase NFP_NET_CFG_TLV_TYPE_UNKNOWN:\n+\t\t\tPMD_DRV_LOG(ERR, \"Unknown TLV at offset: %u\", offset);\n+\t\t\treturn -EINVAL;\n+\t\tcase NFP_NET_CFG_TLV_TYPE_RESERVED:\n+\t\t\tbreak;\n+\t\tcase NFP_NET_CFG_TLV_TYPE_END:\n+\t\t\tif (length == 0)\n+\t\t\t\treturn 0;\n+\n+\t\t\tPMD_DRV_LOG(ERR, \"END TLV should be empty, has len: %u\", length);\n+\t\t\treturn -EINVAL;\n+\t\tcase NFP_NET_CFG_TLV_TYPE_MBOX:\n+\t\t\tcaps->mbox_len = length;\n+\n+\t\t\tif (length != 0)\n+\t\t\t\tcaps->mbox_off = data - hw->ctrl_bar;\n+\t\t\telse\n+\t\t\t\tcaps->mbox_off = 0;\n+\t\t\tbreak;\n+\t\tcase NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES:\n+\t\t\tif (length != 0)\n+\t\t\t\tcaps->mbox_cmsg_types = rte_read32(data);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tif (FIELD_GET(NFP_NET_CFG_TLV_HEADER_REQUIRED, hdr) == 0)\n+\t\t\t\tbreak;\n+\n+\t\t\tPMD_DRV_LOG(ERR, \"Unknown TLV type: %u offset: %u len: %u\",\n+\t\t\t\t\ttlv_type, offset, length);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tPMD_DRV_LOG(ERR, \"Reached end of BAR without END TLV\");\n+\treturn -EINVAL;\n+}\ndiff --git a/drivers/net/nfp/nfp_ctrl.h b/drivers/net/nfp/nfp_ctrl.h\nindex 53727992a9..43fc9972a0 100644\n--- a/drivers/net/nfp/nfp_ctrl.h\n+++ b/drivers/net/nfp/nfp_ctrl.h\n@@ -8,6 +8,8 @@\n \n #include <stdint.h>\n \n+#include <ethdev_driver.h>\n+\n /*\n  * Configuration BAR size.\n  *\n@@ -207,6 +209,9 @@ struct nfp_net_fw_ver {\n #define NFP_NET_CFG_RX_OFFSET\t\t0x0050\n #define NFP_NET_CFG_RX_OFFSET_DYNAMIC\t\t0\t/* Prepend mode */\n \n+/* Start anchor of the TLV area */\n+#define NFP_NET_CFG_TLV_BASE            0x0058\n+\n /**\n  * Reuse spare address to contain the offset from the start of\n  * the host buffer where the first byte of the received frame\n@@ -434,6 +439,115 @@ struct nfp_net_fw_ver {\n \n #define NFP_PF_CSR_SLICE_SIZE\t(32 * 1024)\n \n+/*\n+ * General use mailbox area (0x1800 - 0x19ff)\n+ * 4B used for update command and 4B return code followed by\n+ * a max of 504B of variable length value.\n+ */\n+#define NFP_NET_CFG_MBOX_BASE                 0x1800\n+#define NFP_NET_CFG_MBOX_VAL                  0x1808\n+#define NFP_NET_CFG_MBOX_VAL_MAX_SZ           0x1F8\n+\n+/*\n+ * TLV capabilities\n+ * @NFP_NET_CFG_TLV_TYPE:          Offset of type within the TLV\n+ * @NFP_NET_CFG_TLV_TYPE_REQUIRED: Driver must be able to parse the TLV\n+ * @NFP_NET_CFG_TLV_LENGTH:        Offset of length within the TLV\n+ * @NFP_NET_CFG_TLV_LENGTH_INC:    TLV length increments\n+ * @NFP_NET_CFG_TLV_VALUE:         Offset of value with the TLV\n+ * @NFP_NET_CFG_TLV_STATS_OFFSET:  Length of TLV stats offset\n+ *\n+ * List of simple TLV structures, first one starts at @NFP_NET_CFG_TLV_BASE.\n+ * Last structure must be of type @NFP_NET_CFG_TLV_TYPE_END. Presence of TLVs\n+ * is indicated by @NFP_NET_CFG_TLV_BASE being non-zero. TLV structures may\n+ * fill the entire remainder of the BAR or be shorter. FW must make sure TLVs\n+ * don't conflict with other features which allocate space beyond\n+ * @NFP_NET_CFG_TLV_BASE. @NFP_NET_CFG_TLV_TYPE_RESERVED should be used to wrap\n+ * space used by such features.\n+ *\n+ * Note that the 4 byte TLV header is not counted in %NFP_NET_CFG_TLV_LENGTH.\n+ */\n+#define NFP_NET_CFG_TLV_TYPE                  0x00\n+#define NFP_NET_CFG_TLV_TYPE_REQUIRED         0x8000\n+#define NFP_NET_CFG_TLV_LENGTH                0x02\n+#define NFP_NET_CFG_TLV_LENGTH_INC            4\n+#define NFP_NET_CFG_TLV_VALUE                 0x04\n+#define NFP_NET_CFG_TLV_STATS_OFFSET          0x08\n+\n+#define NFP_NET_CFG_TLV_HEADER_REQUIRED       0x80000000\n+#define NFP_NET_CFG_TLV_HEADER_TYPE           0x7fff0000\n+#define NFP_NET_CFG_TLV_HEADER_LENGTH         0x0000ffff\n+\n+/*\n+ * Capability TLV types\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_UNKNOWN:\n+ * Special TLV type to catch bugs, should never be encountered. Drivers should\n+ * treat encountering this type as error and refuse to probe.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_RESERVED:\n+ * Reserved space, may contain legacy fixed-offset fields, or be used for\n+ * padding. The use of this type should be otherwise avoided.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_END:\n+ * Empty, end of TLV list. Must be the last TLV. Drivers will stop processing\n+ * further TLVs when encountered.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_ME_FREQ:\n+ * Single word, ME frequency in MHz as used in calculation for\n+ * @NFP_NET_CFG_RXR_IRQ_MOD and @NFP_NET_CFG_TXR_IRQ_MOD.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_MBOX:\n+ * Variable, mailbox area. Overwrites the default location which is\n+ * @NFP_NET_CFG_MBOX_BASE and length @NFP_NET_CFG_MBOX_VAL_MAX_SZ.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0:\n+ * @NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1:\n+ * Variable, experimental IDs. IDs designated for internal development and\n+ * experiments before a stable TLV ID has been allocated to a feature. Should\n+ * never be present in production FW.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_REPR_CAP:\n+ * Single word, equivalent of %NFP_NET_CFG_CAP for representors, features which\n+ * can be used on representors.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES:\n+ * Variable, bitmap of control message types supported by the mailbox handler.\n+ * Bit 0 corresponds to message type 0, bit 1 to 1, etc. Control messages are\n+ * encapsulated into simple TLVs, with an end TLV and written to the Mailbox.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS:\n+ * 8 words, bitmaps of supported and enabled crypto operations.\n+ * First 16B (4 words) contains a bitmap of supported crypto operations,\n+ * and next 16B contain the enabled operations.\n+ * This capability is obsoleted by ones with better sync methods.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_VNIC_STATS:\n+ * Variable, per-vNIC statistics, data should be 8B aligned (FW should insert\n+ * zero-length RESERVED TLV to pad).\n+ * TLV data has two sections. First is an array of statistics' IDs (2B each).\n+ * Second 8B statistics themselves. Statistics are 8B aligned, meaning there\n+ * may be a padding between sections.\n+ * Number of statistics can be determined as floor(tlv.length / (2 + 8)).\n+ * This TLV overwrites %NFP_NET_CFG_STATS_* values (statistics in this TLV\n+ * duplicate the old ones, so driver should be careful not to unnecessarily\n+ * render both).\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS_RX_SCAN:\n+ * Same as %NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS, but crypto TLS does stream scan\n+ * RX sync, rather than kernel-assisted sync.\n+ *\n+ * @NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS_LENGTH:\n+ * CRYPTO OPS TLV should be at least 32B.\n+ */\n+#define NFP_NET_CFG_TLV_TYPE_UNKNOWN            0\n+#define NFP_NET_CFG_TLV_TYPE_RESERVED           1\n+#define NFP_NET_CFG_TLV_TYPE_END                2\n+#define NFP_NET_CFG_TLV_TYPE_MBOX               4\n+#define NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES    10\n+\n+int nfp_net_tlv_caps_parse(struct rte_eth_dev *dev);\n+\n /*\n  * nfp_net_cfg_ctrl_rss() - Get RSS flag based on firmware's capability\n  * @hw_cap: The firmware's capabilities\ndiff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c\nindex 241595be9d..7dc93f7c43 100644\n--- a/drivers/net/nfp/nfp_ethdev.c\n+++ b/drivers/net/nfp/nfp_ethdev.c\n@@ -549,6 +549,12 @@ nfp_net_init(struct rte_eth_dev *eth_dev)\n \tif (err != 0)\n \t\treturn err;\n \n+\terr = nfp_net_tlv_caps_parse(eth_dev);\n+\tif (err != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to parser TLV caps\");\n+\t\treturn err;\n+\t}\n+\n \tnfp_net_ethdev_ops_mount(hw, eth_dev);\n \n \thw->eth_xstats_base = rte_malloc(\"rte_eth_xstat\", sizeof(struct rte_eth_xstat) *\n",
    "prefixes": [
        "v3",
        "1/9"
    ]
}