get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44489,
    "url": "http://patches.dpdk.org/api/patches/44489/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1536572016-18134-21-git-send-email-arybchenko@solarflare.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": "<1536572016-18134-21-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1536572016-18134-21-git-send-email-arybchenko@solarflare.com",
    "date": "2018-09-10T09:33:19",
    "name": "[20/37] net/sfc/base: generalise EF10 NVRAM buffer interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5983294a6d12a054c2a9df0368010c3b36d7b11f",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.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/1536572016-18134-21-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 1244,
            "url": "http://patches.dpdk.org/api/series/1244/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1244",
            "date": "2018-09-10T09:33:01",
            "name": "net/sfc: update base driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1244/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44489/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/44489/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8C4927CD2;\n\tMon, 10 Sep 2018 11:34:32 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n\t[67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 29FA34CA0\n\tfor <dev@dpdk.org>; Mon, 10 Sep 2018 11:33:53 +0200 (CEST)",
            "from webmail.solarflare.com (webmail.solarflare.com\n\t[12.187.104.26])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with\n\tESMTPS id\n\t3C16B780055 for <dev@dpdk.org>; Mon, 10 Sep 2018 09:33:52 +0000 (UTC)",
            "from ocex03.SolarFlarecom.com (10.20.40.36) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id 15.0.1395.4; Mon, 10 Sep 2018 02:33:48 -0700",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n\tocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server\n\t(TLS) id\n\t15.0.1395.4 via Frontend Transport; Mon, 10 Sep 2018 02:33:47 -0700",
            "from ukv-loginhost.uk.solarflarecom.com\n\t(ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n\tby opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id\n\tw8A9XkVU023826; Mon, 10 Sep 2018 10:33:46 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n\tby ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id\n\t309E11626D1; Mon, 10 Sep 2018 10:33:46 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Richard Houldsworth <rhouldsworth@solarflare.com>",
        "Date": "Mon, 10 Sep 2018 10:33:19 +0100",
        "Message-ID": "<1536572016-18134-21-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1536572016-18134-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1536572016-18134-1-git-send-email-arybchenko@solarflare.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-TM-AS-Product-Ver": "SMEX-12.5.0.1300-8.5.1010-24084.005",
        "X-TM-AS-Result": "No-11.629800-4.000000-10",
        "X-TMASE-MatchedRID": "HysFsDIA8KUHzljm8jkYRa9SgVZ49rQMNNuh+5zmS6/4JyR+b5tvoJgC\n\tMlq+sZ+f09NQNrxIpFYWHIQM6TbbEycVIubyY3TBV6iWWmDPLEAEa8g1x8eqF01KG1YrOQW/giZ\n\txW8zUgARWlc57tPvBh9p6csyQFWRl09vybq2Rj84ZexXWjVVC3O3+iQEtoSj4C/+dM49Ci+zuiC\n\tUIlEPtPoXPY1ZbD5ttpMYpDvSAN3e38c8lYsE6JI7Su3QulAZ5Xs5nqGvDCfNmLpOIgdTrI8CNh\n\tEKV8if7Hw5LL3LXbxTvQ2Bqev8ml3kKrmquboXXo4427PDKC0b1LHylaO51H5soi2XrUn/Jn6Kd\n\tMrRsL14qtq5d3cxkNX84T32miX9fVW3+WNYXUYEGBFUpKjXIStpZYXkzOJ932vPV4vHEVMo=",
        "X-TM-AS-User-Approved-Sender": "No",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--11.629800-4.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.5.1010-24084.005",
        "X-MDID": "1536572032-Qj17X2XB-mEE",
        "Subject": "[dpdk-dev] [PATCH 20/37] net/sfc/base: generalise EF10 NVRAM buffer\n\tinterface",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Richard Houldsworth <rhouldsworth@solarflare.com>\n\nThe SFN driver's PartitionControl WMI object requires an API to parse\nand filter partition data in TLV format, particularly for the Dynamic\nConfig partition. The ef10_nvram_buffer functions provide this\nfunctionality but are tied to use with license partition only.\nModify functions so they are applicable to all TLV partitions and add\nfunctions to support in-place tag modification.\n\nSigned-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/sfc/base/ef10_impl.h  |  43 +++++++--\n drivers/net/sfc/base/ef10_nvram.c | 153 ++++++++++++++++++++++++------\n drivers/net/sfc/base/efx_impl.h   |   2 +-\n drivers/net/sfc/base/efx_lic.c    |  15 ++-\n drivers/net/sfc/base/efx_nvram.c  |   2 +-\n 5 files changed, 174 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/base/ef10_impl.h b/drivers/net/sfc/base/ef10_impl.h\nindex 2abd699a0..503f02362 100644\n--- a/drivers/net/sfc/base/ef10_impl.h\n+++ b/drivers/net/sfc/base/ef10_impl.h\n@@ -477,17 +477,21 @@ ef10_nvram_partn_set_version(\n \n extern\t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_validate(\n-\t__in\t\t\tefx_nic_t *enp,\n \t__in\t\t\tuint32_t partn,\n \t__in_bcount(buffer_size)\n \t\t\t\tcaddr_t bufferp,\n \t__in\t\t\tsize_t buffer_size);\n \n+extern\t\t\tvoid\n+ef10_nvram_buffer_init(\n+\t__out_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size);\n+\n extern\t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_create(\n-\t__in\t\t\tefx_nic_t *enp,\n-\t__in\t\t\tuint16_t partn_type,\n-\t__in_bcount(buffer_size)\n+\t__in\t\t\tuint32_t partn_type,\n+\t__out_bcount(buffer_size)\n \t\t\t\tcaddr_t bufferp,\n \t__in\t\t\tsize_t buffer_size);\n \n@@ -515,6 +519,16 @@ ef10_nvram_buffer_find_item(\n \t__out\t\t\tuint32_t *startp,\n \t__out\t\t\tuint32_t *lengthp);\n \n+extern\t__checkReturn\t\tefx_rc_t\n+ef10_nvram_buffer_peek_item(\n+\t__in_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size,\n+\t__in\t\t\tuint32_t offset,\n+\t__out\t\t\tuint32_t *tagp,\n+\t__out\t\t\tuint32_t *lengthp,\n+\t__out\t\t\tuint32_t *value_offsetp);\n+\n extern\t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_get_item(\n \t__in_bcount(buffer_size)\n@@ -522,9 +536,10 @@ ef10_nvram_buffer_get_item(\n \t__in\t\t\tsize_t buffer_size,\n \t__in\t\t\tuint32_t offset,\n \t__in\t\t\tuint32_t length,\n-\t__out_bcount_part(item_max_size, *lengthp)\n-\t\t\t\tcaddr_t itemp,\n-\t__in\t\t\tsize_t item_max_size,\n+\t__out\t\t\tuint32_t *tagp,\n+\t__out_bcount_part(value_max_size, *lengthp)\n+\t\t\t\tcaddr_t valuep,\n+\t__in\t\t\tsize_t value_max_size,\n \t__out\t\t\tuint32_t *lengthp);\n \n extern\t__checkReturn\t\tefx_rc_t\n@@ -533,7 +548,19 @@ ef10_nvram_buffer_insert_item(\n \t\t\t\tcaddr_t bufferp,\n \t__in\t\t\tsize_t buffer_size,\n \t__in\t\t\tuint32_t offset,\n-\t__in_bcount(length)\tcaddr_t keyp,\n+\t__in\t\t\tuint32_t tag,\n+\t__in_bcount(length)\tcaddr_t valuep,\n+\t__in\t\t\tuint32_t length,\n+\t__out\t\t\tuint32_t *lengthp);\n+\n+extern\t__checkReturn\t\tefx_rc_t\n+ef10_nvram_buffer_modify_item(\n+\t__in_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size,\n+\t__in\t\t\tuint32_t offset,\n+\t__in\t\t\tuint32_t tag,\n+\t__in_bcount(length)\tcaddr_t valuep,\n \t__in\t\t\tuint32_t length,\n \t__out\t\t\tuint32_t *lengthp);\n \ndiff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/net/sfc/base/ef10_nvram.c\nindex 96ea5624a..8d1b64f25 100644\n--- a/drivers/net/sfc/base/ef10_nvram.c\n+++ b/drivers/net/sfc/base/ef10_nvram.c\n@@ -203,14 +203,14 @@ tlv_validate_state(\n \n \tif (tlv_tag(cursor) != TLV_TAG_END) {\n \t\t/* Check current item has space for tag and length */\n-\t\tif (cursor->current > (cursor->limit - 2)) {\n+\t\tif (cursor->current > (cursor->limit - 1)) {\n \t\t\tcursor->current = NULL;\n \t\t\trc = EFAULT;\n \t\t\tgoto fail3;\n \t\t}\n \n-\t\t/* Check we have value data for current item and another tag */\n-\t\tif (tlv_next_item_ptr(cursor) > (cursor->limit - 1)) {\n+\t\t/* Check we have value data for current item and an END tag */\n+\t\tif (tlv_next_item_ptr(cursor) > cursor->limit) {\n \t\t\tcursor->current = NULL;\n \t\t\trc = EFAULT;\n \t\t\tgoto fail4;\n@@ -635,7 +635,6 @@ tlv_update_partition_len_and_cks(\n /* Validate buffer contents (before writing to flash) */\n \t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_validate(\n-\t__in\t\t\tefx_nic_t *enp,\n \t__in\t\t\tuint32_t partn,\n \t__in_bcount(partn_size)\tcaddr_t partn_data,\n \t__in\t\t\tsize_t partn_size)\n@@ -648,7 +647,6 @@ ef10_nvram_buffer_validate(\n \tint pos;\n \tefx_rc_t rc;\n \n-\t_NOTE(ARGUNUSED(enp, partn))\n \tEFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK);\n \n \tif ((partn_data == NULL) || (partn_size == 0)) {\n@@ -675,26 +673,32 @@ ef10_nvram_buffer_validate(\n \t\tgoto fail4;\n \t}\n \n+\t/* Check partition header matches partn */\n+\tif (__LE_TO_CPU_16(header->type_id) != partn) {\n+\t\trc = EINVAL;\n+\t\tgoto fail5;\n+\t}\n+\n \t/* Check partition ends with PARTITION_TRAILER and END tags */\n \tif ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {\n \t\trc = EINVAL;\n-\t\tgoto fail5;\n+\t\tgoto fail6;\n \t}\n \ttrailer = (struct tlv_partition_trailer *)tlv_item(&cursor);\n \n \tif ((rc = tlv_advance(&cursor)) != 0) {\n \t\trc = EINVAL;\n-\t\tgoto fail6;\n+\t\tgoto fail7;\n \t}\n \tif (tlv_tag(&cursor) != TLV_TAG_END) {\n \t\trc = EINVAL;\n-\t\tgoto fail7;\n+\t\tgoto fail8;\n \t}\n \n \t/* Check generation counts are consistent */\n \tif (trailer->generation != header->generation) {\n \t\trc = EINVAL;\n-\t\tgoto fail8;\n+\t\tgoto fail9;\n \t}\n \n \t/* Verify partition checksum */\n@@ -704,11 +708,13 @@ ef10_nvram_buffer_validate(\n \t}\n \tif (cksum != 0) {\n \t\trc = EINVAL;\n-\t\tgoto fail9;\n+\t\tgoto fail10;\n \t}\n \n \treturn (0);\n \n+fail10:\n+\tEFSYS_PROBE(fail10);\n fail9:\n \tEFSYS_PROBE(fail9);\n fail8:\n@@ -731,13 +737,24 @@ ef10_nvram_buffer_validate(\n \treturn (rc);\n }\n \n+\t\t\tvoid\n+ef10_nvram_buffer_init(\n+\t__out_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size)\n+{\n+\tuint32_t *buf = (uint32_t *)bufferp;\n+\n+\tmemset(buf, 0xff, buffer_size);\n \n+\ttlv_init_block(buf);\n+}\n \n \t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_create(\n-\t__in\t\t\tefx_nic_t *enp,\n-\t__in\t\t\tuint16_t partn_type,\n-\t__in_bcount(partn_size)\tcaddr_t partn_data,\n+\t__in\t\t\tuint32_t partn_type,\n+\t__out_bcount(partn_size)\n+\t\t\t\tcaddr_t partn_data,\n \t__in\t\t\tsize_t partn_size)\n {\n \tuint32_t *buf = (uint32_t *)partn_data;\n@@ -753,9 +770,8 @@ ef10_nvram_buffer_create(\n \t\tgoto fail1;\n \t}\n \n-\tmemset(buf, 0xff, partn_size);\n+\tef10_nvram_buffer_init(partn_data, partn_size);\n \n-\ttlv_init_block(buf);\n \tif ((rc = tlv_init_cursor(&cursor, buf,\n \t    (uint32_t *)((uint8_t *)buf + partn_size),\n \t    buf)) != 0) {\n@@ -787,7 +803,7 @@ ef10_nvram_buffer_create(\n \t\tgoto fail6;\n \n \t/* Check that the partition is valid. */\n-\tif ((rc = ef10_nvram_buffer_validate(enp, partn_type,\n+\tif ((rc = ef10_nvram_buffer_validate(partn_type,\n \t    partn_data, partn_size)) != 0)\n \t\tgoto fail7;\n \n@@ -958,6 +974,48 @@ ef10_nvram_buffer_find_item(\n \treturn (B_FALSE);\n }\n \n+\t__checkReturn\t\tefx_rc_t\n+ef10_nvram_buffer_peek_item(\n+\t__in_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size,\n+\t__in\t\t\tuint32_t offset,\n+\t__out\t\t\tuint32_t *tagp,\n+\t__out\t\t\tuint32_t *lengthp,\n+\t__out\t\t\tuint32_t *value_offsetp)\n+{\n+\tefx_rc_t rc;\n+\ttlv_cursor_t cursor;\n+\tuint32_t tag;\n+\n+\tif ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,\n+\t\t\tbuffer_size, offset)) != 0) {\n+\t\tgoto fail1;\n+\t}\n+\n+\ttag = tlv_tag(&cursor);\n+\t*tagp = tag;\n+\tif (tag == TLV_TAG_END) {\n+\t\t/*\n+\t\t * To allow stepping over the END tag, report the full tag\n+\t\t * length and a zero length value.\n+\t\t */\n+\t\t*lengthp = sizeof (tag);\n+\t\t*value_offsetp = sizeof (tag);\n+\t} else {\n+\t\t*lengthp = byte_offset(tlv_next_item_ptr(&cursor),\n+\t\t\t    cursor.current);\n+\t\t*value_offsetp = byte_offset((uint32_t *)tlv_value(&cursor),\n+\t\t\t    cursor.current);\n+\t}\n+\treturn (0);\n+\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n \t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_get_item(\n \t__in_bcount(buffer_size)\n@@ -965,16 +1023,17 @@ ef10_nvram_buffer_get_item(\n \t__in\t\t\tsize_t buffer_size,\n \t__in\t\t\tuint32_t offset,\n \t__in\t\t\tuint32_t length,\n-\t__out_bcount_part(item_max_size, *lengthp)\n-\t\t\t\tcaddr_t itemp,\n-\t__in\t\t\tsize_t item_max_size,\n+\t__out\t\t\tuint32_t *tagp,\n+\t__out_bcount_part(value_max_size, *lengthp)\n+\t\t\t\tcaddr_t valuep,\n+\t__in\t\t\tsize_t value_max_size,\n \t__out\t\t\tuint32_t *lengthp)\n {\n \tefx_rc_t rc;\n \ttlv_cursor_t cursor;\n-\tuint32_t item_length;\n+\tuint32_t value_length;\n \n-\tif (item_max_size < length) {\n+\tif (buffer_size < (offset + length)) {\n \t\trc = ENOSPC;\n \t\tgoto fail1;\n \t}\n@@ -984,14 +1043,15 @@ ef10_nvram_buffer_get_item(\n \t\tgoto fail2;\n \t}\n \n-\titem_length = tlv_length(&cursor);\n-\tif (length < item_length) {\n+\tvalue_length = tlv_length(&cursor);\n+\tif (value_max_size < value_length) {\n \t\trc = ENOSPC;\n \t\tgoto fail3;\n \t}\n-\tmemcpy(itemp, tlv_value(&cursor), item_length);\n+\tmemcpy(valuep, tlv_value(&cursor), value_length);\n \n-\t*lengthp = item_length;\n+\t*tagp = tlv_tag(&cursor);\n+\t*lengthp = value_length;\n \n \treturn (0);\n \n@@ -1011,7 +1071,8 @@ ef10_nvram_buffer_insert_item(\n \t\t\t\tcaddr_t bufferp,\n \t__in\t\t\tsize_t buffer_size,\n \t__in\t\t\tuint32_t offset,\n-\t__in_bcount(length)\tcaddr_t keyp,\n+\t__in\t\t\tuint32_t tag,\n+\t__in_bcount(length)\tcaddr_t valuep,\n \t__in\t\t\tuint32_t length,\n \t__out\t\t\tuint32_t *lengthp)\n {\n@@ -1023,7 +1084,44 @@ ef10_nvram_buffer_insert_item(\n \t\tgoto fail1;\n \t}\n \n-\trc = tlv_insert(&cursor, TLV_TAG_LICENSE, (uint8_t *)keyp, length);\n+\trc = tlv_insert(&cursor, tag, (uint8_t *)valuep, length);\n+\n+\tif (rc != 0)\n+\t\tgoto fail2;\n+\n+\t*lengthp = byte_offset(tlv_next_item_ptr(&cursor),\n+\t\t    cursor.current);\n+\n+\treturn (0);\n+\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\n+\treturn (rc);\n+}\n+\n+\t__checkReturn\t\tefx_rc_t\n+ef10_nvram_buffer_modify_item(\n+\t__in_bcount(buffer_size)\n+\t\t\t\tcaddr_t bufferp,\n+\t__in\t\t\tsize_t buffer_size,\n+\t__in\t\t\tuint32_t offset,\n+\t__in\t\t\tuint32_t tag,\n+\t__in_bcount(length)\tcaddr_t valuep,\n+\t__in\t\t\tuint32_t length,\n+\t__out\t\t\tuint32_t *lengthp)\n+{\n+\tefx_rc_t rc;\n+\ttlv_cursor_t cursor;\n+\n+\tif ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,\n+\t\t\tbuffer_size, offset)) != 0) {\n+\t\tgoto fail1;\n+\t}\n+\n+\trc = tlv_modify(&cursor, tag, (uint8_t *)valuep, length);\n \n \tif (rc != 0) {\n \t\tgoto fail2;\n@@ -1042,6 +1140,7 @@ ef10_nvram_buffer_insert_item(\n \treturn (rc);\n }\n \n+\n \t__checkReturn\t\tefx_rc_t\n ef10_nvram_buffer_delete_item(\n \t__in_bcount(buffer_size)\ndiff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/net/sfc/base/efx_impl.h\nindex 0764df5de..78df43018 100644\n--- a/drivers/net/sfc/base/efx_impl.h\n+++ b/drivers/net/sfc/base/efx_impl.h\n@@ -509,7 +509,7 @@ typedef struct efx_nvram_ops_s {\n \t\t\t\t\t    uint32_t *, uint16_t *);\n \tefx_rc_t\t(*envo_partn_set_version)(efx_nic_t *, uint32_t,\n \t\t\t\t\t    uint16_t *);\n-\tefx_rc_t\t(*envo_buffer_validate)(efx_nic_t *, uint32_t,\n+\tefx_rc_t\t(*envo_buffer_validate)(uint32_t,\n \t\t\t\t\t    caddr_t, size_t);\n } efx_nvram_ops_t;\n #endif /* EFSYS_OPT_NVRAM */\ndiff --git a/drivers/net/sfc/base/efx_lic.c b/drivers/net/sfc/base/efx_lic.c\nindex 49c00347f..2b06e2d1e 100644\n--- a/drivers/net/sfc/base/efx_lic.c\n+++ b/drivers/net/sfc/base/efx_lic.c\n@@ -1158,10 +1158,12 @@ efx_lic_v3_read_key(\n \t__in\t\t\tsize_t key_max_size,\n \t__out\t\t\tuint32_t *lengthp)\n {\n+\tuint32_t tag;\n+\n \t_NOTE(ARGUNUSED(enp))\n \n \treturn ef10_nvram_buffer_get_item(bufferp, buffer_size,\n-\t\t    offset, length, keyp, key_max_size, lengthp);\n+\t\t    offset, length, &tag, keyp, key_max_size, lengthp);\n }\n \n \t__checkReturn\t\tefx_rc_t\n@@ -1179,7 +1181,7 @@ efx_lic_v3_write_key(\n \tEFSYS_ASSERT(length <= EFX_LICENSE_V3_KEY_LENGTH_MAX);\n \n \treturn ef10_nvram_buffer_insert_item(bufferp, buffer_size,\n-\t\t    offset, keyp, length, lengthp);\n+\t\t    offset, TLV_TAG_LICENSE, keyp, length, lengthp);\n }\n \n \t__checkReturn\t\tefx_rc_t\n@@ -1221,8 +1223,10 @@ efx_lic_v3_create_partition(\n {\n \tefx_rc_t rc;\n \n+\t_NOTE(ARGUNUSED(enp))\n+\n \t/* Construct empty partition */\n-\tif ((rc = ef10_nvram_buffer_create(enp,\n+\tif ((rc = ef10_nvram_buffer_create(\n \t    NVRAM_PARTITION_TYPE_LICENSE,\n \t    bufferp, buffer_size)) != 0) {\n \t\trc = EFAULT;\n@@ -1246,13 +1250,16 @@ efx_lic_v3_finish_partition(\n {\n \tefx_rc_t rc;\n \n+\t_NOTE(ARGUNUSED(enp))\n+\n \tif ((rc = ef10_nvram_buffer_finish(bufferp,\n \t\t\tbuffer_size)) != 0) {\n \t\tgoto fail1;\n \t}\n \n \t/* Validate completed partition */\n-\tif ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE,\n+\tif ((rc = ef10_nvram_buffer_validate(\n+\t\t\t\t\tNVRAM_PARTITION_TYPE_LICENSE,\n \t\t\t\t\tbufferp, buffer_size)) != 0) {\n \t\tgoto fail2;\n \t}\ndiff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c\nindex f3107bbb5..9000fe886 100644\n--- a/drivers/net/sfc/base/efx_nvram.c\n+++ b/drivers/net/sfc/base/efx_nvram.c\n@@ -468,7 +468,7 @@ efx_nvram_validate(\n \t\tgoto fail1;\n \n \tif (envop->envo_buffer_validate != NULL) {\n-\t\tif ((rc = envop->envo_buffer_validate(enp, partn,\n+\t\tif ((rc = envop->envo_buffer_validate(partn,\n \t\t\t    partn_data, partn_size)) != 0)\n \t\t\tgoto fail2;\n \t}\n",
    "prefixes": [
        "20/37"
    ]
}