Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/89000/?format=api
http://patchwork.dpdk.org/api/patches/89000/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210312093143.28186-5-ivan.malov@oktetlabs.ru/", "project": { "id": 1, "url": "http://patchwork.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": "<20210312093143.28186-5-ivan.malov@oktetlabs.ru>", "list_archive_url": "https://inbox.dpdk.org/dev/20210312093143.28186-5-ivan.malov@oktetlabs.ru", "date": "2021-03-12T09:31:38", "name": "[05/10] common/sfc_efx/base: support encap. header provisioning", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "24f609f87dc855f7a330c93d92ea4f0f0213a200", "submitter": { "id": 869, "url": "http://patchwork.dpdk.org/api/people/869/?format=api", "name": "Ivan Malov", "email": "Ivan.Malov@oktetlabs.ru" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210312093143.28186-5-ivan.malov@oktetlabs.ru/mbox/", "series": [ { "id": 15630, "url": "http://patchwork.dpdk.org/api/series/15630/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=15630", "date": "2021-03-12T09:31:34", "name": "[01/10] ethdev: reuse header definition in flow pattern item ETH", "version": 1, "mbox": "http://patchwork.dpdk.org/series/15630/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/89000/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/89000/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 C6F0FA0547;\n\tFri, 12 Mar 2021 10:32:17 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 47CA0160873;\n\tFri, 12 Mar 2021 10:31:55 +0100 (CET)", "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 1DD0F4067E\n for <dev@dpdk.org>; Fri, 12 Mar 2021 10:31:50 +0100 (CET)", "from localhost.localdomain (unknown [188.242.7.54])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by shelob.oktetlabs.ru (Postfix) with ESMTPSA id C5D5E7F5AA;\n Fri, 12 Mar 2021 12:31:49 +0300 (MSK)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru C5D5E7F5AA", "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1615541509;\n bh=YQH7nHiEa4z0tFavWNtLIcJ0gJKdYBL6Axw/gdPbdks=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=puwEfCQIgvC1k4IEx2gtTs6JCV4KGj06jeWmmLkJ9mSYU6CG6Uo7ORuIdQZWYgqt5\n yojFWpN03MOEnSg9RiAL3NXdWqXWBt/kqGM9I+pKNbp9jtrPypb1R3MAnxtYaerHSk\n MiVz41xACCN/XxnzZ0LlZd+p5Ql3LtSD6XwvWXjs=", "From": "Ivan Malov <ivan.malov@oktetlabs.ru>", "To": "dev@dpdk.org", "Cc": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Andy Moreton <amoreton@xilinx.com>, Ray Kinsella <mdr@ashroe.eu>,\n Neil Horman <nhorman@tuxdriver.com>", "Date": "Fri, 12 Mar 2021 12:31:38 +0300", "Message-Id": "<20210312093143.28186-5-ivan.malov@oktetlabs.ru>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20210312093143.28186-1-ivan.malov@oktetlabs.ru>", "References": "<20210312093143.28186-1-ivan.malov@oktetlabs.ru>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 05/10] common/sfc_efx/base: support encap. header\n provisioning", "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": "Let the client allocate / free encap. headers.\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\nReviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/efx.h | 21 ++++\n drivers/common/sfc_efx/base/efx_mae.c | 155 ++++++++++++++++++++++++++\n drivers/common/sfc_efx/version.map | 2 +\n 3 files changed, 178 insertions(+)", "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex ccf9c7ab8..4a738e589 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4070,6 +4070,7 @@ typedef struct efx_mae_limits_s {\n \tuint32_t\t\t\teml_max_n_action_prios;\n \tuint32_t\t\t\teml_max_n_outer_prios;\n \tuint32_t\t\t\teml_encap_types_supported;\n+\tuint32_t\t\t\teml_encap_header_size_limit;\n } efx_mae_limits_t;\n \n LIBEFX_API\n@@ -4324,6 +4325,26 @@ efx_mae_match_spec_outer_rule_id_set(\n \t__in\t\t\t\tefx_mae_match_spec_t *spec,\n \t__in\t\t\t\tconst efx_mae_rule_id_t *or_idp);\n \n+/* Encap. header ID */\n+typedef struct efx_mae_eh_id_s {\n+\tuint32_t id;\n+} efx_mae_eh_id_t;\n+\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_encap_header_alloc(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tefx_tunnel_protocol_t encap_type,\n+\t__in_bcount(header_size)\tuint8_t *header_data,\n+\t__in\t\t\t\tsize_t header_size,\n+\t__out\t\t\t\tefx_mae_eh_id_t *eh_idp);\n+\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_encap_header_free(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tconst efx_mae_eh_id_t *eh_idp);\n+\n /* Action set ID */\n typedef struct efx_mae_aset_id_s {\n \tuint32_t id;\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 338a0013f..798867963 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -353,6 +353,8 @@ efx_mae_get_limits(\n \temlp->eml_max_n_outer_prios = maep->em_max_n_outer_prios;\n \temlp->eml_max_n_action_prios = maep->em_max_n_action_prios;\n \temlp->eml_encap_types_supported = maep->em_encap_types_supported;\n+\temlp->eml_encap_header_size_limit =\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_HDR_DATA_MAXNUM_MCDI2;\n \n \treturn (0);\n \n@@ -1691,6 +1693,159 @@ efx_mae_match_spec_outer_rule_id_set(\n \n \treturn (0);\n \n+fail3:\n+\tEFSYS_PROBE(fail3);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n+\t __checkReturn\t\t\tefx_rc_t\n+efx_mae_encap_header_alloc(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tefx_tunnel_protocol_t encap_type,\n+\t__in_bcount(header_size)\tuint8_t *header_data,\n+\t__in\t\t\t\tsize_t header_size,\n+\t__out\t\t\t\tefx_mae_eh_id_t *eh_idp)\n+{\n+\tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);\n+\tefx_mcdi_req_t req;\n+\tEFX_MCDI_DECLARE_BUF(payload,\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_LENMAX_MCDI2,\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_OUT_LEN);\n+\tuint32_t encap_type_mcdi;\n+\tefx_mae_eh_id_t eh_id;\n+\tefx_rc_t rc;\n+\n+\tEFX_STATIC_ASSERT(sizeof (eh_idp->id) ==\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_OUT_ENCAP_HEADER_ID_LEN);\n+\n+\tEFX_STATIC_ASSERT(EFX_MAE_RSRC_ID_INVALID ==\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_OUT_ENCAP_HEADER_ID_NULL);\n+\n+\tif (encp->enc_mae_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\tswitch (encap_type) {\n+\tcase EFX_TUNNEL_PROTOCOL_NONE:\n+\t\tencap_type_mcdi = MAE_MCDI_ENCAP_TYPE_NONE;\n+\t\tbreak;\n+\tcase EFX_TUNNEL_PROTOCOL_VXLAN:\n+\t\tencap_type_mcdi = MAE_MCDI_ENCAP_TYPE_VXLAN;\n+\t\tbreak;\n+\tcase EFX_TUNNEL_PROTOCOL_GENEVE:\n+\t\tencap_type_mcdi = MAE_MCDI_ENCAP_TYPE_GENEVE;\n+\t\tbreak;\n+\tcase EFX_TUNNEL_PROTOCOL_NVGRE:\n+\t\tencap_type_mcdi = MAE_MCDI_ENCAP_TYPE_NVGRE;\n+\t\tbreak;\n+\tdefault:\n+\t\trc = ENOTSUP;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (header_size >\n+\t MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_HDR_DATA_MAXNUM_MCDI2) {\n+\t\trc = EINVAL;\n+\t\tgoto fail3;\n+\t}\n+\n+\treq.emr_cmd = MC_CMD_MAE_ENCAP_HEADER_ALLOC;\n+\treq.emr_in_buf = payload;\n+\treq.emr_in_length = MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_LEN(header_size);\n+\treq.emr_out_buf = payload;\n+\treq.emr_out_length = MC_CMD_MAE_ENCAP_HEADER_ALLOC_OUT_LEN;\n+\n+\tMCDI_IN_SET_DWORD(req,\n+\t MAE_ENCAP_HEADER_ALLOC_IN_ENCAP_TYPE, encap_type_mcdi);\n+\n+\tmemcpy(payload + MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_HDR_DATA_OFST,\n+\t header_data, header_size);\n+\n+\tefx_mcdi_execute(enp, &req);\n+\n+\tif (req.emr_rc != 0) {\n+\t\trc = req.emr_rc;\n+\t\tgoto fail4;\n+\t}\n+\n+\tif (req.emr_out_length_used < MC_CMD_MAE_ENCAP_HEADER_ALLOC_OUT_LEN) {\n+\t\trc = EMSGSIZE;\n+\t\tgoto fail5;\n+\t}\n+\n+\teh_id.id = MCDI_OUT_DWORD(req,\n+\t MAE_ENCAP_HEADER_ALLOC_OUT_ENCAP_HEADER_ID);\n+\n+\tif (eh_id.id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = ENOENT;\n+\t\tgoto fail6;\n+\t}\n+\n+\teh_idp->id = eh_id.id;\n+\n+\treturn (0);\n+\n+fail6:\n+\tEFSYS_PROBE(fail6);\n+fail5:\n+\tEFSYS_PROBE(fail5);\n+fail4:\n+\tEFSYS_PROBE(fail4);\n+fail3:\n+\tEFSYS_PROBE(fail3);\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n+\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_encap_header_free(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tconst efx_mae_eh_id_t *eh_idp)\n+{\n+\tconst efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);\n+\tefx_mcdi_req_t req;\n+\tEFX_MCDI_DECLARE_BUF(payload,\n+\t MC_CMD_MAE_ENCAP_HEADER_FREE_IN_LEN(1),\n+\t MC_CMD_MAE_ENCAP_HEADER_FREE_OUT_LEN(1));\n+\tefx_rc_t rc;\n+\n+\tif (encp->enc_mae_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\treq.emr_cmd = MC_CMD_MAE_ENCAP_HEADER_FREE;\n+\treq.emr_in_buf = payload;\n+\treq.emr_in_length = MC_CMD_MAE_ENCAP_HEADER_FREE_IN_LEN(1);\n+\treq.emr_out_buf = payload;\n+\treq.emr_out_length = MC_CMD_MAE_ENCAP_HEADER_FREE_OUT_LEN(1);\n+\n+\tMCDI_IN_SET_DWORD(req, MAE_ENCAP_HEADER_FREE_IN_EH_ID, eh_idp->id);\n+\n+\tefx_mcdi_execute(enp, &req);\n+\n+\tif (req.emr_rc != 0) {\n+\t\trc = req.emr_rc;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (MCDI_OUT_DWORD(req, MAE_ENCAP_HEADER_FREE_OUT_FREED_EH_ID) !=\n+\t eh_idp->id) {\n+\t\t/* Firmware failed to remove the encap. header. */\n+\t\trc = EAGAIN;\n+\t\tgoto fail3;\n+\t}\n+\n+\treturn (0);\n+\n fail3:\n \tEFSYS_PROBE(fail3);\n fail2:\ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex 403feeaf1..168899d51 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -98,6 +98,8 @@ INTERNAL {\n \tefx_mae_action_set_spec_fini;\n \tefx_mae_action_set_spec_init;\n \tefx_mae_action_set_specs_equal;\n+\tefx_mae_encap_header_alloc;\n+\tefx_mae_encap_header_free;\n \tefx_mae_fini;\n \tefx_mae_get_limits;\n \tefx_mae_init;\n", "prefixes": [ "05/10" ] }{ "id": 89000, "url": "