Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/131487/?format=api
https://patches.dpdk.org/api/patches/131487/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230915091551.1459606-13-chaoyong.he@corigine.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": "<20230915091551.1459606-13-chaoyong.he@corigine.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230915091551.1459606-13-chaoyong.he@corigine.com", "date": "2023-09-15T09:15:36", "name": "[v3,12/27] net/nfp: refact the hwinfo module", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "f0da8b71e0f0f903ecaf14ad44d0b722c432d773", "submitter": { "id": 2554, "url": "https://patches.dpdk.org/api/people/2554/?format=api", "name": "Chaoyong He", "email": "chaoyong.he@corigine.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230915091551.1459606-13-chaoyong.he@corigine.com/mbox/", "series": [ { "id": 29520, "url": "https://patches.dpdk.org/api/series/29520/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29520", "date": "2023-09-15T09:15:24", "name": "refact the nfpcore module", "version": 3, "mbox": "https://patches.dpdk.org/series/29520/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/131487/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/131487/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 41179425A3;\n\tFri, 15 Sep 2023 11:18:00 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1739141611;\n\tFri, 15 Sep 2023 11:16:43 +0200 (CEST)", "from NAM12-BN8-obe.outbound.protection.outlook.com\n (mail-bn8nam12on2091.outbound.protection.outlook.com [40.107.237.91])\n by mails.dpdk.org (Postfix) with ESMTP id 3F04F41157\n for <dev@dpdk.org>; Fri, 15 Sep 2023 11:16:40 +0200 (CEST)", "from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5)\n by CO1PR13MB4773.namprd13.prod.outlook.com (2603:10b6:303:fb::6) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep\n 2023 09:16:38 +0000", "from SJ0PR13MB5545.namprd13.prod.outlook.com\n ([fe80::c05c:6915:1628:70c4]) by SJ0PR13MB5545.namprd13.prod.outlook.com\n ([fe80::c05c:6915:1628:70c4%7]) with mapi id 15.20.6768.029; Fri, 15 Sep 2023\n 09:16:38 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=kn6QCgk2vZwipiaAoEfBaX91AfoZd8F8wE7/kRcDqMYIM6UvYx6YcL4lJzaHEC6p2Lf/LF9MpjpqAKph6Rk/BOXZk3Pt8KBT/ulubOZs9IdMVno/z6M0V9sfevP8cmWpf4SNB8SYDpPMMjMOXn6mOwf+qJf/bvou3Yc7F0uLfYc3lfxMf6F4nq2ITDGoIxkeOIy50FWBcFtr/ngzoh5jpi0fZ73lra0vCXEnTSct7b+8cyA32k0cAlz7EsR3kh5ioAmKeSTacnmKNkKMb385OAfnMxO41YOMlUskbCCwpKckV3ByvdZFf9q6sYuXwuFtktI3V3tOSFafCcPEEWAlqQ==", "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=+yvZDG2HDEPnYtWF1Wkl+yal9KI7LdfqgZhh7PgB9Zg=;\n b=V2tVULe2v96LHzNnbtUq/n+qKOY0RJiDnvxS/fpJJnT6p1wS7hwpXYWqXOX9zADYAVMDm3LmySdBS4JQqIMmr1Jqd4INqheZUM/62zECO1501S551xU/Kpa2QoF/24f5lTr16DqHB7Tysm+EP8XriD2VSC4n+Wb8cNEI4EP9l1WTyaceEhtcvHR1YFZDmYvmp5l3oXhOFCPBCcKkBn1bavWcYevkmmYzVD38o6ybCg2NYkszbNsmLw1r1KttIZBzN0Lfr5rT1bJNYoku9cK8qPDeOu3s9GaU+ozFI66/1pP9tZX+1Cf6dmYSrVaW1Saouj/B+/ElQTP6O+aIAzYg8Q==", "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=+yvZDG2HDEPnYtWF1Wkl+yal9KI7LdfqgZhh7PgB9Zg=;\n b=Td/wvO2F93XNIx86mgfrV3Axfzw+9ZEhjtS/0lCO/A7AKl821Lz5bHWnNKhZHWKnt7ylNwYoQ9saEEaGadoQVer+lL7iHtBiokSRQd0sRRvPJJi/+mYWukykYVr5wjuNCbfTGgzTKJeC6aICGPavY2Qisz6OgkMXZXQ0KkyX3sE=", "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, Chaoyong He <chaoyong.he@corigine.com>,\n\t=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@corigine.com>", "Subject": "[PATCH v3 12/27] net/nfp: refact the hwinfo module", "Date": "Fri, 15 Sep 2023 17:15:36 +0800", "Message-Id": "<20230915091551.1459606-13-chaoyong.he@corigine.com>", "X-Mailer": "git-send-email 2.39.1", "In-Reply-To": "<20230915091551.1459606-1-chaoyong.he@corigine.com>", "References": "<20230830021457.2064750-1-chaoyong.he@corigine.com>\n <20230915091551.1459606-1-chaoyong.he@corigine.com>", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-ClientProxiedBy": "PH7PR10CA0017.namprd10.prod.outlook.com\n (2603:10b6:510:23d::10) 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_|CO1PR13MB4773:EE_", "X-MS-Office365-Filtering-Correlation-Id": "c9deae8d-dd65-435e-e93d-08dbb5cc7770", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n Oghf1cMwp4EcG71HBQ5iXzwfbrAG52UpSufZ3mEDX8AtvV7WLvICYEGfLsHDSLfiGWCS3vEqWg85kla53IviCZrHf1W9+y/QM3e1t5J3NAqFE1zF8pv7Vm1DnUx6YoDoA1YPCyC0OLHf8kV67TZJXV2jFamO0ozXGeEbdc6mg7V7hPUXMT2XizqQr+FLKYjJ94lzDsiWsbDypJm/dYjKmd44ZaX+mzZh9Nv8IN616KF4N3S20JL0Q9UQDheNX9E1nJ3QLekYC6gPXBehYzTNxO6yfk6cgihCdxOw9rqtDvQISHva4OwvtcuqPIYDx7Vwd3pwLoTfCxVr0MEhr0lFu/+7JXdfnWCUeWU1MfS6fxoAOgrbaXg5LGL9GbXz/2jaLOApjZg1zl8iRbQP5P/mp0kJRbpem8XXJxzrB3tC0rmOTXEVUPPDEth/DYX7oksbuXqLGrMoRtye9pWbiIHAiaoSqG3j4PNJm5JqB88MPAqf5djh3PENNJQSkgXpy4QtuL6lfmDA+A/oZMZidTkLEFWZdosN4QHLn2BmDAdAeMBpy18RKORymY2aJw67oO/Ra1Qu2ff+92mwV0DH3VC0viP4+FMtRb7ebCWycRjp6yDFxRkt8xj+9p4gFQ1Fbz0PMuDv3UXVHx8Mjlbc7LTlycrxe6h7LX3wC0bc67mLPsI=", "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)(39840400004)(346002)(136003)(376002)(396003)(366004)(451199024)(186009)(1800799009)(6512007)(107886003)(1076003)(2616005)(52116002)(6506007)(6486002)(66946007)(26005)(316002)(41300700001)(66476007)(66556008)(6916009)(54906003)(5660300002)(4326008)(8676002)(38350700002)(8936002)(38100700002)(478600001)(66574015)(83380400001)(36756003)(44832011)(86362001)(2906002);\n DIR:OUT; SFP:1102;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "=?utf-8?q?wPP2ez28pgkdx0BZ3iOSIaQFX4Yt?=\n\t=?utf-8?q?OuQSwr0zqpiwVpOnngUjiQhWU/VlHThYM9J3LRZCU57seVgn045IF2sSqJR5ZI5bG?=\n\t=?utf-8?q?IrtDYG7QVF68lYMKLqjALzLHHV9pxWDZTV221vPuNg3IfW7rqDyQaM9KALznBda3e?=\n\t=?utf-8?q?z3DL2UWI/GRp3c6tKtOMTK7FEyxhm0rqk+eObnMRPWKpX/TpqjYQJlsGKbjMb2+ue?=\n\t=?utf-8?q?ya3OAQF+ZdJpHzT6Baik+yGi3pcyDY0KDUEM+MgBVTxOjK0Y15ZU5IftwBWAy5Ad2?=\n\t=?utf-8?q?a7YwxAPYlEmjy9ZVhLz6HeUof9XDMF8v/s3JMVp417/46SR/m882IUITTUH1EI3kr?=\n\t=?utf-8?q?PoXfpfkKr6L/YjIQGdh9UjUx+J/lHbd4+tg3p85j9bbKPOWOxEaS2465ReLLluIgv?=\n\t=?utf-8?q?RYJbJFvX81uvMhM3whM+p141dr+WFH18zxPwBaxSw9Enr0arXuewEMzoSmEY1vXKf?=\n\t=?utf-8?q?JnssNx8KU38EA9pgAqmBdiVD/LOZlv1GnRgVg+8mEcykrJnmrn4VJPmnU8890d2er?=\n\t=?utf-8?q?GeV2OTJ53+jjLc1wYc8XynS/l5vEwntadSvej+feT3Q1RvF9i7KVzQ33nJW++SNLT?=\n\t=?utf-8?q?Yj/s4ZouwsBewUkSt6rHamL4VtDqUgxCuh/VZ3mFRARgYqUN0BfAxY8orm3q/qwuI?=\n\t=?utf-8?q?XVw1+JrLq3UOTPFIvb9v3jg81oiNQDsYQO9y6BJWEaneW1I32xvlw2egoK1H7b4/2?=\n\t=?utf-8?q?ntDP23iqx7fqa38bW0pQ2zprON0ZmqzDkWYcp7zCclQXSOJS0gxUUhvBnaKWfUiNE?=\n\t=?utf-8?q?ijox/ABNdRsn5sHq9ZXVfoNyjROj0g2R6k1Oq0q4qxrwCFN0bLDOyT/j4ys9CBX+v?=\n\t=?utf-8?q?qnj7YJ2s3l46x+oK7Sc1oKlWeKR2WbBZdCO7A/fMa106JDP6/NslTJdgS+TFstxvW?=\n\t=?utf-8?q?56yKphaJBbEV+zm3mhzno46IpDAyeqPzhm7PAvj4H5a0PeyXfqMp2ZCsERvNqF5vl?=\n\t=?utf-8?q?CNQy62XVLdUVsNYybF6b8CNv1j/MWwFump1B0TqAYDsXLyvi2z4PxmSLQuL47pvtO?=\n\t=?utf-8?q?//lOGmZQFf0kpuFFWLswbPVadB+cPA8Jtx3TUn3i6Ml01tRNKlri628OA73gYOs0B?=\n\t=?utf-8?q?FhjEXT/KIicCq1eFMCTkKI0cDD3cv+j+zNU9aAHBq9B5tlYDqa5ILWKWjXnHR5744?=\n\t=?utf-8?q?si7cmxQwFRfRelckyIK0HFAIp5ulzCanHZikEXdGDwhTG1MxApy0Ch3QahEZnMmq1?=\n\t=?utf-8?q?Uc5TLbtBfzqjf22wBhuJIhv8Pqgd+QibEN3Is4A/TBQUtj1sbHhXG/pQHJLhPqHsq?=\n\t=?utf-8?q?IEemMuG6Rpo1g+lS9r2NEhMZpMffRrfYo7iNcNW14krpngf+pjtLkaeWKHkdnEyFu?=\n\t=?utf-8?q?kTVWvlRBu+fyTs618PLJWsOqAkROHLOMd6wylu0fyZ/9Qa2K0fL7yw4LQgJgg3IiN?=\n\t=?utf-8?q?MwuCj2LM2KFTo7qeDQue+hh4zqJ8ZwxrXrp16N7vnLegiLRe0erdaRAprpPH9ACBC?=\n\t=?utf-8?q?ygMr19tsDn5O0vu7PGlSlSefBCJiA9xHUmQ77bk8+mlMVyaO3XEXBKKf5m+Wt3Etj?=\n\t=?utf-8?q?rL8aEjjxyfweQAbcpMWz7+qHjDTKzMoOcQ=3D=3D?=", "X-OriginatorOrg": "corigine.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n c9deae8d-dd65-435e-e93d-08dbb5cc7770", "X-MS-Exchange-CrossTenant-AuthSource": "SJ0PR13MB5545.namprd13.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "15 Sep 2023 09:16:38.7860 (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 a+UjetcMufvl2zoh3JpiDJuvoPqNnmoxwUuJF/xyeNCFoXPyi9VmiuKw6n+JtM9AL7ZKd7GFRrTiNVFXM30a42NkmpWY8lkeAuwZ1P+60AU=", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CO1PR13MB4773", "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": "Move the definition of data structure and macro into the implement file.\nAlso remove the unneeded header file include statements.\n\nSigned-off-by: Chaoyong He <chaoyong.he@corigine.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>\n---\n drivers/net/nfp/nfpcore/nfp_hwinfo.c | 84 +++++++++++++++++++++++++---\n drivers/net/nfp/nfpcore/nfp_hwinfo.h | 71 +----------------------\n 2 files changed, 77 insertions(+), 78 deletions(-)", "diff": "diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c\nindex cee37210b0..25c2262dfc 100644\n--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c\n+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c\n@@ -17,17 +17,82 @@\n * (ie, in this example, ME 39 has been reserved by boardconfig.)\n */\n \n-#include <stdio.h>\n-#include <time.h>\n+#include \"nfp_hwinfo.h\"\n \n-#include \"nfp_cpp.h\"\n+#include \"nfp_crc.h\"\n #include \"nfp_logs.h\"\n-#include \"nfp6000/nfp6000.h\"\n #include \"nfp_resource.h\"\n-#include \"nfp_hwinfo.h\"\n-#include \"nfp_crc.h\"\n \n-static int\n+#define HWINFO_SIZE_MIN 0x100\n+\n+/*\n+ * The Hardware Info Table defines the properties of the system.\n+ *\n+ * HWInfo v1 Table (fixed size)\n+ *\n+ * 0x0000: uint32_t version Hardware Info Table version (1.0)\n+ * 0x0004: uint32_t size Total size of the table, including the\n+ * CRC32 (IEEE 802.3)\n+ * 0x0008: uint32_t jumptab Offset of key/value table\n+ * 0x000c: uint32_t keys Total number of keys in the key/value table\n+ * NNNNNN: Key/value jump table and string data\n+ * (size - 4): uint32_t crc32 CRC32 (same as IEEE 802.3, POSIX csum, etc)\n+ * CRC32(\"\",0) = ~0, CRC32(\"a\",1) = 0x48C279FE\n+ *\n+ * HWInfo v2 Table (variable size)\n+ *\n+ * 0x0000: uint32_t version Hardware Info Table version (2.0)\n+ * 0x0004: uint32_t size Current size of the data area, excluding CRC32\n+ * 0x0008: uint32_t limit Maximum size of the table\n+ * 0x000c: uint32_t reserved Unused, set to zero\n+ * NNNNNN: Key/value data\n+ * (size - 4): uint32_t crc32 CRC32 (same as IEEE 802.3, POSIX csum, etc)\n+ * CRC32(\"\",0) = ~0, CRC32(\"a\",1) = 0x48C279FE\n+ *\n+ * If the HWInfo table is in the process of being updated, the low bit of\n+ * version will be set.\n+ *\n+ * HWInfo v1 Key/Value Table\n+ * -------------------------\n+ *\n+ * The key/value table is a set of offsets to ASCIIZ strings which have\n+ * been strcmp(3) sorted (yes, please use bsearch(3) on the table).\n+ *\n+ * All keys are guaranteed to be unique.\n+ *\n+ * N+0: uint32_t key_1 Offset to the first key\n+ * N+4: uint32_t val_1 Offset to the first value\n+ * N+8: uint32_t key_2 Offset to the second key\n+ * N+c: uint32_t val_2 Offset to the second value\n+ * ...\n+ *\n+ * HWInfo v2 Key/Value Table\n+ * -------------------------\n+ *\n+ * Packed UTF8Z strings, ie 'key1\\000value1\\000key2\\000value2\\000'\n+ * Unsorted.\n+ *\n+ * Note: Only the HwInfo v2 Table be supported now.\n+ */\n+\n+#define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)\n+#define NFP_HWINFO_VERSION_2 ('H' << 24 | 'I' << 16 | 2 << 8 | 0 << 1 | 0)\n+#define NFP_HWINFO_VERSION_UPDATING RTE_BIT32(0)\n+\n+struct nfp_hwinfo {\n+\tuint8_t start[0];\n+\n+\tuint32_t version;\n+\tuint32_t size;\n+\n+\t/* V2 specific fields */\n+\tuint32_t limit;\n+\tuint32_t resv;\n+\n+\tchar data[];\n+};\n+\n+static bool\n nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)\n {\n \treturn hwinfo->version & NFP_HWINFO_VERSION_UPDATING;\n@@ -120,7 +185,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,\n \t\tgoto exit_free;\n \t}\n \n-\theader = (void *)db;\n+\theader = (struct nfp_hwinfo *)db;\n \tif (nfp_hwinfo_is_updating(header))\n \t\tgoto exit_free;\n \n@@ -133,7 +198,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,\n \t/* NULL-terminate for safety */\n \tdb[*cpp_size] = '\\0';\n \n-\treturn (void *)db;\n+\treturn (struct nfp_hwinfo *)db;\n+\n exit_free:\n \trte_free(db);\n \treturn NULL;\ndiff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h\nindex 543562779a..c812f10076 100644\n--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h\n+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h\n@@ -6,76 +6,9 @@\n #ifndef __NFP_HWINFO_H__\n #define __NFP_HWINFO_H__\n \n-#include <inttypes.h>\n+#include \"nfp_cpp.h\"\n \n-#define HWINFO_SIZE_MIN 0x100\n-\n-/*\n- * The Hardware Info Table defines the properties of the system.\n- *\n- * HWInfo v1 Table (fixed size)\n- *\n- * 0x0000: uint32_t version Hardware Info Table version (1.0)\n- * 0x0004: uint32_t size Total size of the table, including the\n- * CRC32 (IEEE 802.3)\n- * 0x0008: uint32_t jumptab Offset of key/value table\n- * 0x000c: uint32_t keys Total number of keys in the key/value table\n- * NNNNNN: Key/value jump table and string data\n- * (size - 4): uint32_t crc32 CRC32 (same as IEEE 802.3, POSIX csum, etc)\n- * CRC32(\"\",0) = ~0, CRC32(\"a\",1) = 0x48C279FE\n- *\n- * HWInfo v2 Table (variable size)\n- *\n- * 0x0000: uint32_t version Hardware Info Table version (2.0)\n- * 0x0004: uint32_t size Current size of the data area, excluding CRC32\n- * 0x0008: uint32_t limit Maximum size of the table\n- * 0x000c: uint32_t reserved Unused, set to zero\n- * NNNNNN: Key/value data\n- * (size - 4): uint32_t crc32 CRC32 (same as IEEE 802.3, POSIX csum, etc)\n- * CRC32(\"\",0) = ~0, CRC32(\"a\",1) = 0x48C279FE\n- *\n- * If the HWInfo table is in the process of being updated, the low bit of\n- * version will be set.\n- *\n- * HWInfo v1 Key/Value Table\n- * -------------------------\n- *\n- * The key/value table is a set of offsets to ASCIIZ strings which have\n- * been strcmp(3) sorted (yes, please use bsearch(3) on the table).\n- *\n- * All keys are guaranteed to be unique.\n- *\n- * N+0: uint32_t key_1 Offset to the first key\n- * N+4: uint32_t val_1 Offset to the first value\n- * N+8: uint32_t key_2 Offset to the second key\n- * N+c: uint32_t val_2 Offset to the second value\n- * ...\n- *\n- * HWInfo v2 Key/Value Table\n- * -------------------------\n- *\n- * Packed UTF8Z strings, ie 'key1\\000value1\\000key2\\000value2\\000'\n- * Unsorted.\n- *\n- * Note: Only the HwInfo v2 Table be supported now.\n- */\n-\n-#define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)\n-#define NFP_HWINFO_VERSION_2 ('H' << 24 | 'I' << 16 | 2 << 8 | 0 << 1 | 0)\n-#define NFP_HWINFO_VERSION_UPDATING RTE_BIT32(0)\n-\n-struct nfp_hwinfo {\n-\tuint8_t start[0];\n-\n-\tuint32_t version;\n-\tuint32_t size;\n-\n-\t/* v2 specific fields */\n-\tuint32_t limit;\n-\tuint32_t resv;\n-\n-\tchar data[];\n-};\n+struct nfp_hwinfo;\n \n struct nfp_hwinfo *nfp_hwinfo_read(struct nfp_cpp *cpp);\n \n", "prefixes": [ "v3", "12/27" ] }{ "id": 131487, "url": "