get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 127899,
    "url": "http://patches.dpdk.org/api/patches/127899/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230601195538.8265-27-ivan.malov@arknetworks.am/",
    "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": "<20230601195538.8265-27-ivan.malov@arknetworks.am>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230601195538.8265-27-ivan.malov@arknetworks.am",
    "date": "2023-06-01T19:55:30",
    "name": "[26/34] common/sfc_efx/base: support NAT edits in MAE",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "31ea45a6924a51608b6bf8a4466091ada934b009",
    "submitter": {
        "id": 2962,
        "url": "http://patches.dpdk.org/api/people/2962/?format=api",
        "name": "Ivan Malov",
        "email": "ivan.malov@arknetworks.am"
    },
    "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/20230601195538.8265-27-ivan.malov@arknetworks.am/mbox/",
    "series": [
        {
            "id": 28307,
            "url": "http://patches.dpdk.org/api/series/28307/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28307",
            "date": "2023-06-01T19:55:04",
            "name": "net/sfc: support HW conntrack assistance",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/28307/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/127899/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/127899/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 E7AC642C07;\n\tThu,  1 Jun 2023 21:58:32 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EB07A42FD2;\n\tThu,  1 Jun 2023 21:56:13 +0200 (CEST)",
            "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id 7D77A42D7C\n for <dev@dpdk.org>; Thu,  1 Jun 2023 21:55:55 +0200 (CEST)",
            "from localhost.localdomain (unknown [78.109.69.146])\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 agw.arknetworks.am (Postfix) with ESMTPSA id 10081E1435;\n Thu,  1 Jun 2023 23:55:54 +0400 (+04)"
        ],
        "From": "Ivan Malov <ivan.malov@arknetworks.am>",
        "To": "dev@dpdk.org",
        "Cc": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ferruh Yigit <ferruh.yigit@amd.com>, Andy Moreton <amoreton@xilinx.com>",
        "Subject": "[PATCH 26/34] common/sfc_efx/base: support NAT edits in MAE",
        "Date": "Thu,  1 Jun 2023 23:55:30 +0400",
        "Message-Id": "<20230601195538.8265-27-ivan.malov@arknetworks.am>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20230601195538.8265-1-ivan.malov@arknetworks.am>",
        "References": "<20230601195538.8265-1-ivan.malov@arknetworks.am>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "NAT goes after IP TTL decrement. It can operate\non the outermost frame only. In the case of\nprior decapsulation, that maps to the frame\nwhich was (originally) the inner one. Input\ndata for the action comes from the response\nof the HW conntrack assistance table hit.\n\nSigned-off-by: Ivan Malov <ivan.malov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/efx.h      | 13 +++++++++++++\n drivers/common/sfc_efx/base/efx_impl.h |  1 +\n drivers/common/sfc_efx/base/efx_mae.c  | 17 +++++++++++++++++\n drivers/common/sfc_efx/version.map     |  1 +\n 4 files changed, 32 insertions(+)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 141481372c..abde5fea2e 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4560,6 +4560,19 @@ extern\t__checkReturn\t\t\tefx_rc_t\n efx_mae_action_set_populate_decr_ip_ttl(\n \t__in\t\t\t\tefx_mae_actions_t *spec);\n \n+/*\n+ * This only requests NAT action. The replacement IP address and\n+ * L4 port number, as well as the edit direction (DST/SRC), come\n+ * from the response to a hit in the conntrack assistance table.\n+ *\n+ * The action amends the outermost frame. In the case of prior\n+ * decapsulation, that maps to the (originally) inner frame.\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_populate_nat(\n+\t__in\t\t\t\tefx_mae_actions_t *spec);\n+\n LIBEFX_API\n extern\t__checkReturn\t\t\tefx_rc_t\n efx_mae_action_set_populate_vlan_push(\ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 34e25ef990..f9d60b9eb9 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1771,6 +1771,7 @@ typedef enum efx_mae_action_e {\n \tEFX_MAE_ACTION_SET_DST_MAC,\n \tEFX_MAE_ACTION_SET_SRC_MAC,\n \tEFX_MAE_ACTION_DECR_IP_TTL,\n+\tEFX_MAE_ACTION_NAT,\n \tEFX_MAE_ACTION_VLAN_PUSH,\n \tEFX_MAE_ACTION_COUNT,\n \tEFX_MAE_ACTION_ENCAP,\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex b3127b6db8..154d2f1942 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -1834,6 +1834,9 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {\n \t[EFX_MAE_ACTION_DECR_IP_TTL] = {\n \t\t.emad_add = efx_mae_action_set_no_op\n \t},\n+\t[EFX_MAE_ACTION_NAT] = {\n+\t\t.emad_add = efx_mae_action_set_no_op\n+\t},\n \t[EFX_MAE_ACTION_VLAN_PUSH] = {\n \t\t.emad_add = efx_mae_action_set_add_vlan_push\n \t},\n@@ -1860,6 +1863,7 @@ static const uint32_t efx_mae_action_ordered_map =\n \t(1U << EFX_MAE_ACTION_SET_DST_MAC) |\n \t(1U << EFX_MAE_ACTION_SET_SRC_MAC) |\n \t(1U << EFX_MAE_ACTION_DECR_IP_TTL) |\n+\t(1U << EFX_MAE_ACTION_NAT) |\n \t(1U << EFX_MAE_ACTION_VLAN_PUSH) |\n \t/*\n \t * HW will conduct action COUNT after\n@@ -2035,6 +2039,14 @@ efx_mae_action_set_populate_decr_ip_ttl(\n \treturn (rc);\n }\n \n+\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_populate_nat(\n+\t__in\t\t\t\tefx_mae_actions_t *spec)\n+{\n+\treturn (efx_mae_action_set_spec_populate(spec,\n+\t    EFX_MAE_ACTION_NAT, 0, NULL));\n+}\n+\n \t__checkReturn\t\t\tefx_rc_t\n efx_mae_action_set_populate_vlan_push(\n \t__in\t\t\t\tefx_mae_actions_t *spec,\n@@ -3090,6 +3102,11 @@ efx_mae_action_set_alloc(\n \t\t    MAE_ACTION_SET_ALLOC_IN_DO_DECR_IP_TTL, 1);\n \t}\n \n+\tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_NAT)) != 0) {\n+\t\tMCDI_IN_SET_DWORD_FIELD(req, MAE_ACTION_SET_ALLOC_IN_FLAGS,\n+\t\t    MAE_ACTION_SET_ALLOC_IN_DO_NAT, 1);\n+\t}\n+\n \tif (spec->ema_n_vlan_tags_to_push > 0) {\n \t\tunsigned int outer_tag_idx;\n \ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex f567f667b5..f601110f84 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -105,6 +105,7 @@ INTERNAL {\n \tefx_mae_action_set_populate_flag;\n \tefx_mae_action_set_populate_mark;\n \tefx_mae_action_set_populate_mark_reset;\n+\tefx_mae_action_set_populate_nat;\n \tefx_mae_action_set_populate_set_dst_mac;\n \tefx_mae_action_set_populate_set_src_mac;\n \tefx_mae_action_set_populate_vlan_pop;\n",
    "prefixes": [
        "26/34"
    ]
}