get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104473,
    "url": "http://patchwork.dpdk.org/api/patches/104473/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211117114438.8347-4-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": "<20211117114438.8347-4-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211117114438.8347-4-ivan.malov@oktetlabs.ru",
    "date": "2021-11-17T11:44:37",
    "name": "[3/4] common/sfc_efx/base: support MAC address edit actions in MAE",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ed34674070e506d9b906497206ccd0d2a447546e",
    "submitter": {
        "id": 869,
        "url": "http://patchwork.dpdk.org/api/people/869/?format=api",
        "name": "Ivan Malov",
        "email": "Ivan.Malov@oktetlabs.ru"
    },
    "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/20211117114438.8347-4-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 20619,
            "url": "http://patchwork.dpdk.org/api/series/20619/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20619",
            "date": "2021-11-17T11:44:34",
            "name": "net/sfc: support MAC address edits in transfer flows",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20619/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104473/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/104473/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 CE6A8A0C41;\n\tWed, 17 Nov 2021 12:44:56 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 416BF411EE;\n\tWed, 17 Nov 2021 12:44:44 +0100 (CET)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 2422740040\n for <dev@dpdk.org>; Wed, 17 Nov 2021 12:44:41 +0100 (CET)",
            "from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5])\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 ESMTPS id B80C47F4C4;\n Wed, 17 Nov 2021 14:44:40 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B80C47F4C4",
        "Authentication-Results": "shelob.oktetlabs.ru/B80C47F4C4; dkim=none;\n dkim-atps=neutral",
        "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>",
        "Subject": "[PATCH 3/4] common/sfc_efx/base: support MAC address edit actions in\n MAE",
        "Date": "Wed, 17 Nov 2021 14:44:37 +0300",
        "Message-Id": "<20211117114438.8347-4-ivan.malov@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211117114438.8347-1-ivan.malov@oktetlabs.ru>",
        "References": "<20211117114438.8347-1-ivan.malov@oktetlabs.ru>",
        "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": "In a tunnel packet, these actions affect the inner header if\naction DECAP is set; otherwise, they affect the outer header.\n\nAdding these actions is done in two steps: add the action to\nthe action mask and indicate the MAC address entry ID to use.\nThis allows the user to check the order of actions first and\nallocate resources when time comes to enable the action rule.\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      |  60 +++++\n drivers/common/sfc_efx/base/efx_impl.h |   4 +\n drivers/common/sfc_efx/base/efx_mae.c  | 303 ++++++++++++++++++++++++-\n drivers/common/sfc_efx/version.map     |   6 +\n 4 files changed, 363 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex f08a004536..62eead638a 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4437,6 +4437,34 @@ extern\t__checkReturn\t\t\tefx_rc_t\n efx_mae_action_set_populate_vlan_pop(\n \t__in\t\t\t\tefx_mae_actions_t *spec);\n \n+/*\n+ * This always amends the outermost header. This way, for a tunnel\n+ * packet, if action DECAP is not requested, this will affect the\n+ * outer header; otherwise, the inner header will be updated.\n+ *\n+ * Use efx_mae_action_set_fill_in_dst_mac_id() to set ID of\n+ * the allocated MAC address entry in the specification\n+ * prior to action set allocation.\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_populate_set_dst_mac(\n+\t__in\t\t\t\tefx_mae_actions_t *spec);\n+\n+/*\n+ * This always amends the outermost header. This way, for a tunnel\n+ * packet, if action DECAP is not requested, this will affect the\n+ * outer header; otherwise, the inner header will be updated.\n+ *\n+ * Use efx_mae_action_set_fill_in_src_mac_id() to set ID of\n+ * the allocated MAC address entry in the specification\n+ * prior to action set allocation.\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_populate_set_src_mac(\n+\t__in\t\t\t\tefx_mae_actions_t *spec);\n+\n /*\n  * This always amends the outermost header. This way, for a tunnel\n  * packet, if action DECAP is not requested, this will affect the\n@@ -4570,6 +4598,38 @@ 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+/* MAC address entry ID */\n+typedef struct efx_mae_mac_id_s {\n+\tuint32_t id;\n+} efx_mae_mac_id_t;\n+\n+LIBEFX_API\n+extern\t__checkReturn\tefx_rc_t\n+efx_mae_mac_addr_alloc(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tuint8_t addr_bytes[EFX_MAC_ADDR_LEN],\n+\t__out\t\tefx_mae_mac_id_t *mac_idp);\n+\n+LIBEFX_API\n+extern\t__checkReturn\tefx_rc_t\n+efx_mae_mac_addr_free(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tconst efx_mae_mac_id_t *mac_idp);\n+\n+/* See description before efx_mae_action_set_populate_set_dst_mac(). */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_fill_in_dst_mac_id(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mae_mac_id_t *mac_idp);\n+\n+/* See description before efx_mae_action_set_populate_set_src_mac(). */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_fill_in_src_mac_id(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mae_mac_id_t *mac_idp);\n+\n /* Encap. header ID */\n typedef struct efx_mae_eh_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 eda41b4be0..d181040186 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1740,6 +1740,8 @@ typedef enum efx_mae_action_e {\n \t/* These actions are strictly ordered. */\n \tEFX_MAE_ACTION_DECAP,\n \tEFX_MAE_ACTION_VLAN_POP,\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_VLAN_PUSH,\n \tEFX_MAE_ACTION_COUNT,\n@@ -1772,6 +1774,8 @@ typedef struct efx_mae_action_vlan_push_s {\n } efx_mae_action_vlan_push_t;\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;\n \tefx_mae_eh_id_t\t\t\temar_eh_id;\n \tefx_counter_t\t\t\temar_counter_id;\n } efx_mae_actions_rsrc_t;\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 756c35788e..7b24e3fee4 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -1386,6 +1386,8 @@ 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 \n@@ -1633,6 +1635,12 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {\n \t[EFX_MAE_ACTION_VLAN_POP] = {\n \t\t.emad_add = efx_mae_action_set_add_vlan_pop\n \t},\n+\t[EFX_MAE_ACTION_SET_DST_MAC] = {\n+\t\t.emad_add = efx_mae_action_set_no_op\n+\t},\n+\t[EFX_MAE_ACTION_SET_SRC_MAC] = {\n+\t\t.emad_add = efx_mae_action_set_no_op\n+\t},\n \t[EFX_MAE_ACTION_DECR_IP_TTL] = {\n \t\t.emad_add = efx_mae_action_set_no_op\n \t},\n@@ -1659,6 +1667,8 @@ static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {\n static const uint32_t efx_mae_action_ordered_map =\n \t(1U << EFX_MAE_ACTION_DECAP) |\n \t(1U << EFX_MAE_ACTION_VLAN_POP) |\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_VLAN_PUSH) |\n \t/*\n@@ -1778,6 +1788,44 @@ efx_mae_action_set_populate_vlan_pop(\n \t    EFX_MAE_ACTION_VLAN_POP, 0, NULL));\n }\n \n+\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_populate_set_dst_mac(\n+\t__in\t\t\t\tefx_mae_actions_t *spec)\n+{\n+\tefx_rc_t rc;\n+\n+\tif (spec->ema_v2_is_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\treturn (efx_mae_action_set_spec_populate(spec,\n+\t    EFX_MAE_ACTION_SET_DST_MAC, 0, NULL));\n+\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_action_set_populate_set_src_mac(\n+\t__in\t\t\t\tefx_mae_actions_t *spec)\n+{\n+\tefx_rc_t rc;\n+\n+\tif (spec->ema_v2_is_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\treturn (efx_mae_action_set_spec_populate(spec,\n+\t    EFX_MAE_ACTION_SET_SRC_MAC, 0, NULL));\n+\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_action_set_populate_decr_ip_ttl(\n \t__in\t\t\t\tefx_mae_actions_t *spec)\n@@ -2317,6 +2365,224 @@ 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\tefx_rc_t\n+efx_mae_mac_addr_alloc(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tuint8_t addr_bytes[EFX_MAC_ADDR_LEN],\n+\t__out\t\tefx_mae_mac_id_t *mac_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_MAC_ADDR_ALLOC_IN_LEN,\n+\t    MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_LEN);\n+\tefx_mae_mac_id_t mac_id;\n+\tefx_rc_t rc;\n+\n+\tEFX_STATIC_ASSERT(sizeof (mac_idp->id) ==\n+\t    MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_MAC_ID_LEN);\n+\n+\tEFX_STATIC_ASSERT(EFX_MAE_RSRC_ID_INVALID ==\n+\t    MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_MAC_ID_NULL);\n+\n+\tif (encp->enc_mae_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\tif (encp->enc_mae_aset_v2_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail2;\n+\t}\n+\n+\treq.emr_cmd = MC_CMD_MAE_MAC_ADDR_ALLOC;\n+\treq.emr_in_buf = payload;\n+\treq.emr_in_length = MC_CMD_MAE_MAC_ADDR_ALLOC_IN_LEN;\n+\treq.emr_out_buf = payload;\n+\treq.emr_out_length = MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_LEN;\n+\n+\tmemcpy(payload + MC_CMD_MAE_MAC_ADDR_ALLOC_IN_MAC_ADDR_OFST,\n+\t    addr_bytes, EFX_MAC_ADDR_LEN);\n+\n+\tefx_mcdi_execute(enp, &req);\n+\n+\tif (req.emr_rc != 0) {\n+\t\trc = req.emr_rc;\n+\t\tgoto fail3;\n+\t}\n+\n+\tif (req.emr_out_length_used < MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_LEN) {\n+\t\trc = EMSGSIZE;\n+\t\tgoto fail4;\n+\t}\n+\n+\tmac_id.id = MCDI_OUT_DWORD(req, MAE_MAC_ADDR_ALLOC_OUT_MAC_ID);\n+\tif (mac_id.id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = ENOENT;\n+\t\tgoto fail5;\n+\t}\n+\n+\tmac_idp->id = mac_id.id;\n+\n+\treturn (0);\n+\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\tefx_rc_t\n+efx_mae_mac_addr_free(\n+\t__in\t\tefx_nic_t *enp,\n+\t__in\t\tconst efx_mae_mac_id_t *mac_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_MAC_ADDR_FREE_IN_LEN(1),\n+\t    MC_CMD_MAE_MAC_ADDR_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+\tif (encp->enc_mae_aset_v2_supported == B_FALSE) {\n+\t\trc = ENOTSUP;\n+\t\tgoto fail2;\n+\t}\n+\n+\treq.emr_cmd = MC_CMD_MAE_MAC_ADDR_FREE;\n+\treq.emr_in_buf = payload;\n+\treq.emr_in_length = MC_CMD_MAE_MAC_ADDR_FREE_IN_LEN(1);\n+\treq.emr_out_buf = payload;\n+\treq.emr_out_length = MC_CMD_MAE_MAC_ADDR_FREE_OUT_LEN(1);\n+\n+\tMCDI_IN_SET_DWORD(req, MAE_MAC_ADDR_FREE_IN_MAC_ID, mac_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 fail3;\n+\t}\n+\n+\tif (req.emr_out_length_used < MC_CMD_MAE_MAC_ADDR_FREE_OUT_LEN(1)) {\n+\t\trc = EMSGSIZE;\n+\t\tgoto fail4;\n+\t}\n+\n+\tif (MCDI_OUT_DWORD(req, MAE_MAC_ADDR_FREE_OUT_FREED_MAC_ID) !=\n+\t    mac_idp->id) {\n+\t\t/* Firmware failed to remove the MAC address entry. */\n+\t\trc = EAGAIN;\n+\t\tgoto fail5;\n+\t}\n+\n+\treturn (0);\n+\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_action_set_fill_in_dst_mac_id(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mae_mac_id_t *mac_idp)\n+{\n+\tefx_rc_t rc;\n+\n+\tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_SET_DST_MAC)) == 0) {\n+\t\t/*\n+\t\t * The caller has not intended to have this action originally,\n+\t\t * hence, they cannot indicate the MAC address entry ID.\n+\t\t */\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\tif (spec->ema_rsrc.emar_dst_mac_id.id != EFX_MAE_RSRC_ID_INVALID) {\n+\t\t/* An attempt to indicate the MAC address entry ID twice. */\n+\t\trc = EINVAL;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (mac_idp->id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = EINVAL;\n+\t\tgoto fail3;\n+\t}\n+\n+\tspec->ema_rsrc.emar_dst_mac_id.id = mac_idp->id;\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_action_set_fill_in_src_mac_id(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mae_mac_id_t *mac_idp)\n+{\n+\tefx_rc_t rc;\n+\n+\tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_SET_SRC_MAC)) == 0) {\n+\t\t/*\n+\t\t * The caller has not intended to have this action originally,\n+\t\t * hence, they cannot indicate the MAC address entry ID.\n+\t\t */\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\tif (spec->ema_rsrc.emar_src_mac_id.id != EFX_MAE_RSRC_ID_INVALID) {\n+\t\t/* An attempt to indicate the MAC address entry ID twice. */\n+\t\trc = EINVAL;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (mac_idp->id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = EINVAL;\n+\t\tgoto fail3;\n+\t}\n+\n+\tspec->ema_rsrc.emar_src_mac_id.id = mac_idp->id;\n+\n+\treturn (0);\n+\n fail3:\n \tEFSYS_PROBE(fail3);\n fail2:\n@@ -2538,16 +2804,28 @@ efx_mae_action_set_alloc(\n \t\tgoto fail1;\n \t}\n \n+\tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_SET_DST_MAC)) != 0 &&\n+\t    spec->ema_rsrc.emar_dst_mac_id.id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = EINVAL;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_SET_SRC_MAC)) != 0 &&\n+\t    spec->ema_rsrc.emar_src_mac_id.id == EFX_MAE_RSRC_ID_INVALID) {\n+\t\trc = EINVAL;\n+\t\tgoto fail3;\n+\t}\n+\n \tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_ENCAP)) != 0 &&\n \t    spec->ema_rsrc.emar_eh_id.id == EFX_MAE_RSRC_ID_INVALID) {\n \t\trc = EINVAL;\n-\t\tgoto fail2;\n+\t\tgoto fail4;\n \t}\n \n \tif (spec->ema_n_count_actions == 1 &&\n \t    spec->ema_rsrc.emar_counter_id.id == EFX_MAE_RSRC_ID_INVALID) {\n \t\trc = EINVAL;\n-\t\tgoto fail3;\n+\t\tgoto fail5;\n \t}\n \n \treq.emr_cmd = MC_CMD_MAE_ACTION_SET_ALLOC;\n@@ -2572,6 +2850,12 @@ efx_mae_action_set_alloc(\n \tMCDI_IN_SET_DWORD_FIELD(req, MAE_ACTION_SET_ALLOC_IN_FLAGS,\n \t    MAE_ACTION_SET_ALLOC_IN_VLAN_POP, spec->ema_n_vlan_tags_to_pop);\n \n+\tMCDI_IN_SET_DWORD(req, MAE_ACTION_SET_ALLOC_IN_DST_MAC_ID,\n+\t    spec->ema_rsrc.emar_dst_mac_id.id);\n+\n+\tMCDI_IN_SET_DWORD(req, MAE_ACTION_SET_ALLOC_IN_SRC_MAC_ID,\n+\t    spec->ema_rsrc.emar_src_mac_id.id);\n+\n \tif ((spec->ema_actions & (1U << EFX_MAE_ACTION_DECR_IP_TTL)) != 0) {\n \t\tMCDI_IN_SET_DWORD_FIELD(req, MAE_ACTION_SET_ALLOC_IN_FLAGS,\n \t\t    MAE_ACTION_SET_ALLOC_IN_DO_DECR_IP_TTL, 1);\n@@ -2623,33 +2907,32 @@ efx_mae_action_set_alloc(\n \tMCDI_IN_SET_DWORD(req,\n \t    MAE_ACTION_SET_ALLOC_IN_DELIVER, spec->ema_deliver_mport.sel);\n \n-\tMCDI_IN_SET_DWORD(req, MAE_ACTION_SET_ALLOC_IN_SRC_MAC_ID,\n-\t    MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_MAC_ID_NULL);\n-\tMCDI_IN_SET_DWORD(req, MAE_ACTION_SET_ALLOC_IN_DST_MAC_ID,\n-\t    MC_CMD_MAE_MAC_ADDR_ALLOC_OUT_MAC_ID_NULL);\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\tgoto fail6;\n \t}\n \n \tif (req.emr_out_length_used < MC_CMD_MAE_ACTION_SET_ALLOC_OUT_LEN) {\n \t\trc = EMSGSIZE;\n-\t\tgoto fail5;\n+\t\tgoto fail7;\n \t}\n \n \taset_id.id = MCDI_OUT_DWORD(req, MAE_ACTION_SET_ALLOC_OUT_AS_ID);\n \tif (aset_id.id == EFX_MAE_RSRC_ID_INVALID) {\n \t\trc = ENOENT;\n-\t\tgoto fail6;\n+\t\tgoto fail8;\n \t}\n \n \taset_idp->id = aset_id.id;\n \n \treturn (0);\n \n+fail8:\n+\tEFSYS_PROBE(fail8);\n+fail7:\n+\tEFSYS_PROBE(fail7);\n fail6:\n \tEFSYS_PROBE(fail6);\n fail5:\ndiff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map\nindex 765ca39332..1471aad2c4 100644\n--- a/drivers/common/sfc_efx/version.map\n+++ b/drivers/common/sfc_efx/version.map\n@@ -90,7 +90,9 @@ INTERNAL {\n \tefx_mae_action_rule_remove;\n \tefx_mae_action_set_alloc;\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+\tefx_mae_action_set_fill_in_src_mac_id;\n \tefx_mae_action_set_free;\n \tefx_mae_action_set_get_nb_count;\n \tefx_mae_action_set_populate_count;\n@@ -101,6 +103,8 @@ INTERNAL {\n \tefx_mae_action_set_populate_encap;\n \tefx_mae_action_set_populate_flag;\n \tefx_mae_action_set_populate_mark;\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 \tefx_mae_action_set_populate_vlan_push;\n \tefx_mae_action_set_spec_fini;\n@@ -116,6 +120,8 @@ INTERNAL {\n \tefx_mae_fini;\n \tefx_mae_get_limits;\n \tefx_mae_init;\n+\tefx_mae_mac_addr_alloc;\n+\tefx_mae_mac_addr_free;\n \tefx_mae_match_spec_bit_set;\n \tefx_mae_match_spec_field_set;\n \tefx_mae_match_spec_fini;\n",
    "prefixes": [
        "3/4"
    ]
}