get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126484,
    "url": "http://patchwork.dpdk.org/api/patches/126484/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230424143046.6487-1-ivan.malov@arknetworks.am/",
    "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": "<20230424143046.6487-1-ivan.malov@arknetworks.am>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230424143046.6487-1-ivan.malov@arknetworks.am",
    "date": "2023-04-24T14:30:45",
    "name": "[1/2] common/sfc_efx/base: add API to drop MAE action resource IDs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ffa0dd8836f7faf1e7bbf0c336750b2170fc80b5",
    "submitter": {
        "id": 2962,
        "url": "http://patchwork.dpdk.org/api/people/2962/?format=api",
        "name": "Ivan Malov",
        "email": "ivan.malov@arknetworks.am"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230424143046.6487-1-ivan.malov@arknetworks.am/mbox/",
    "series": [
        {
            "id": 27851,
            "url": "http://patchwork.dpdk.org/api/series/27851/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27851",
            "date": "2023-04-24T14:30:45",
            "name": "[1/2] common/sfc_efx/base: add API to drop MAE action resource IDs",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/27851/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/126484/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/126484/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 B846F429DC;\n\tMon, 24 Apr 2023 16:30:15 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5A150427EE;\n\tMon, 24 Apr 2023 16:30:15 +0200 (CEST)",
            "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id 0AE1C40FAE;\n Mon, 24 Apr 2023 16:30:14 +0200 (CEST)",
            "from localhost.localdomain (unknown [78.109.78.86])\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 2E068E0EE8;\n Mon, 24 Apr 2023 18:30:13 +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>, stable@dpdk.org,\n Andy Moreton <amoreton@xilinx.com>,\n Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>",
        "Subject": "[PATCH 1/2] common/sfc_efx/base: add API to drop MAE action resource\n IDs",
        "Date": "Mon, 24 Apr 2023 18:30:45 +0400",
        "Message-Id": "<20230424143046.6487-1-ivan.malov@arknetworks.am>",
        "X-Mailer": "git-send-email 2.30.2",
        "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": "When the client driver (the DPDK one, for instance) parses user flow\nactions, it ends up with an action set specification. Next, in case\nthere are any FW resource-backed actions, like COUNT or SET_DST_MAC,\nthe driver allocates these resources and indicates their IDs in the\naction set specification. The API used to set these IDs checks that\nthe current value of the target ID is INVALID, prior to the call.\n\nThe latter check, however, prevents the driver from updating the\nIDs on port restart. When the port goes down, the driver frees\nthe resources. When the port goes up, the driver reallocates\nthem, tries to set the IDs in the specification and fails.\n\nIn order to address the problem, add an API to drop the\ncurrent resource IDs in the actions set specification.\n\nFixes: 3907defa5bf0 (\"common/sfc_efx/base: support adding encap action to a set\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ivan Malov <ivan.malov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\nTested-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>\n---\n drivers/common/sfc_efx/base/efx.h      | 14 ++++++++++++++\n drivers/common/sfc_efx/base/efx_impl.h |  4 ++++\n drivers/common/sfc_efx/base/efx_mae.c  | 15 +++++++++++----\n drivers/common/sfc_efx/version.map     |  1 +\n 4 files changed, 30 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 6028e08eb6..e4a5694ae2 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4774,6 +4774,20 @@ efx_mae_action_set_fill_in_counter_id(\n \t__in\t\t\t\tefx_mae_actions_t *spec,\n \t__in\t\t\t\tconst efx_counter_t *counter_idp);\n \n+/*\n+ * Clears dangling FW object IDs (counter ID, for instance) in\n+ * the action set specification. Useful for adapter restarts,\n+ * when all MAE objects need to be reallocated by the driver.\n+ *\n+ * This method only clears the IDs in the specification.\n+ * The driver is still responsible for keeping the IDs\n+ * separately and freeing them when stopping the port.\n+ */\n+LIBEFX_API\n+extern\t\t\t\t\tvoid\n+efx_mae_action_set_clear_fw_rsrc_ids(\n+\t__in\t\t\t\tefx_mae_actions_t *spec);\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_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex a48d4f6e04..bed4601715 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1802,6 +1802,10 @@ typedef struct efx_mae_action_vlan_push_s {\n \tuint16_t\t\t\temavp_tci_be;\n } efx_mae_action_vlan_push_t;\n \n+/*\n+ * Helper efx_mae_action_set_clear_fw_rsrc_ids() is responsible\n+ * to initialise every field in this structure to INVALID value.\n+ */\n typedef struct efx_mae_actions_rsrc_s {\n \tefx_mae_mac_id_t\t\temar_dst_mac_id;\n \tefx_mae_mac_id_t\t\temar_src_mac_id;\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 7732d99992..4c33471f28 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -1394,10 +1394,7 @@ efx_mae_action_set_spec_init(\n \t\tgoto fail1;\n \t}\n \n-\tspec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID;\n-\tspec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID;\n-\tspec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID;\n-\tspec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID;\n+\tefx_mae_action_set_clear_fw_rsrc_ids(spec);\n \n \t/*\n \t * Helpers which populate v2 actions must reject them when v2 is not\n@@ -3027,6 +3024,16 @@ efx_mae_action_set_fill_in_counter_id(\n \treturn (rc);\n }\n \n+\t\t\t\t\tvoid\n+efx_mae_action_set_clear_fw_rsrc_ids(\n+\t__in\t\t\t\tefx_mae_actions_t *spec)\n+{\n+\tspec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID;\n+\tspec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID;\n+\tspec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID;\n+\tspec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID;\n+}\n+\n \t__checkReturn\t\t\tefx_rc_t\n efx_mae_counters_alloc(\n \t__in\t\t\t\tefx_nic_t *enp,\ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex d36c3786fc..070de3ba54 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -90,6 +90,7 @@ INTERNAL {\n \tefx_mae_action_rule_insert;\n \tefx_mae_action_rule_remove;\n \tefx_mae_action_set_alloc;\n+\tefx_mae_action_set_clear_fw_rsrc_ids;\n \tefx_mae_action_set_fill_in_counter_id;\n \tefx_mae_action_set_fill_in_dst_mac_id;\n \tefx_mae_action_set_fill_in_eh_id;\n",
    "prefixes": [
        "1/2"
    ]
}