get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81459,
    "url": "http://patches.dpdk.org/api/patches/81459/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603183709-23420-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": "<1603183709-23420-21-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603183709-23420-21-git-send-email-arybchenko@solarflare.com",
    "date": "2020-10-20T08:47:47",
    "name": "[20/62] common/sfc_efx/base: support adding DELIVER action to a set",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9a9967daf798d59043d5511ddb3f96db6511e806",
    "submitter": {
        "id": 607,
        "url": "http://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1603183709-23420-21-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 13132,
            "url": "http://patches.dpdk.org/api/series/13132/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13132",
            "date": "2020-10-20T08:47:30",
            "name": "net/sfc: support flow API transfer rules",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/13132/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81459/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/81459/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4E41CA04DD;\n\tTue, 20 Oct 2020 10:54:50 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 69803BCA8;\n\tTue, 20 Oct 2020 10:49:29 +0200 (CEST)",
            "from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com\n [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 38745BBA0\n for <dev@dpdk.org>; Tue, 20 Oct 2020 10:49:01 +0200 (CEST)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.62])\n by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id\n AE5A36006D for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:59 +0000 (UTC)",
            "from us4-mdac16-29.ut7.mdlocal (unknown [10.7.66.139])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id AD98D8009B\n for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:59 +0000 (UTC)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.200])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n 32D64280050\n for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:59 +0000 (UTC)",
            "from webmail.solarflare.com (uk.solarflare.com [193.34.186.16])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))\n (No client certificate requested)\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n DD5FB800058\n for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:58 +0000 (UTC)",
            "from ukex01.SolarFlarecom.com (10.17.10.4) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id\n 15.0.1497.2; Tue, 20 Oct 2020 09:48:50 +0100",
            "from opal.uk.solarflarecom.com (10.17.10.1) by\n ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id\n 15.0.1497.2 via Frontend Transport; Tue, 20 Oct 2020 09:48:50 +0100",
            "from ukv-loginhost.uk.solarflarecom.com\n (ukv-loginhost.uk.solarflarecom.com [10.17.10.39])\n by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09K8mnvS030801;\n Tue, 20 Oct 2020 09:48:49 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id BEA87161A17;\n Tue, 20 Oct 2020 09:48:48 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<y@solarflare.com>",
        "CC": "<dev@dpdk.org>, Ivan Malov <ivan.malov@oktetlabs.ru>",
        "Date": "Tue, 20 Oct 2020 09:47:47 +0100",
        "Message-ID": "<1603183709-23420-21-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1603183709-23420-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1603183709-23420-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.6.1012-25736.003",
        "X-TM-AS-Result": "No-1.032200-8.000000-10",
        "X-TMASE-MatchedRID": "qT3lr2YLwToZbIsB9jb3Y26HurDH4PpP6KbGBEfATCZwkdIrVt8X1VDT\n Kayi2ZF6pVG0HeSt+ryWGRCs++FM0t1RkEnBFAu+nFVnNmvv47uWODD/yzpvd7Zk7gsuflVKFQL\n H9fnGRScEURg1j2RVWB0HR7lIrhJk24NXD3gRmYDN+qWlu2ZxaNi5W7Rf+s6QR2YNIFh+clGGc4\n vJ+XLGs+qdK1begbbxbgyxO8sQKN8K9DOkPuNII7dHEv7sR/OwfglgnB0nDhN7uKMeruD2hrBXu\n d9Ra+w0tk2AwjDNBTuAMuqetGVetnyef22ep6XYxlblqLlYqXIRvQlel5Wbwj2ppL+O5aOxnqxQ\n Z6OEQ8DJibW/yIPDduygLTPX5amJxhj3j1MW6TyUhH8b6j2vAHEu4PVSZXBnayrPn5ppScvw7Jx\n wU0EvZMqEROLb/+yO4/0Jvn0rwAJmtL4Dw+zNb9T2H03zzU1J",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--1.032200-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.6.1012-25736.003",
        "X-MDID": "1603183739-t4XWZJKljOA9",
        "X-PPE-DISP": "1603183739;t4XWZJKljOA9",
        "Subject": "[dpdk-dev] [PATCH 20/62] common/sfc_efx/base: support adding\n\tDELIVER action to a set",
        "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 <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": "From: Ivan Malov <ivan.malov@oktetlabs.ru>\n\nIntroduce a mechanism for adding actions to an action set and\nadd support for DELIVER action.\n\nSigned-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>\nSigned-off-by: Andrew Rybchenko <arybchenko@solarflare.com>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/common/sfc_efx/base/efx.h             |  11 +-\n drivers/common/sfc_efx/base/efx_impl.h        |  11 ++\n drivers/common/sfc_efx/base/efx_mae.c         | 141 ++++++++++++++++++\n .../sfc_efx/rte_common_sfc_efx_version.map    |   1 +\n 4 files changed, 163 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 8d88834c30..6f63a6ecd0 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4094,11 +4094,14 @@ typedef struct efx_mport_sel_s {\n \tuint32_t sel;\n } efx_mport_sel_t;\n \n+#define\tEFX_MPORT_NULL\t\t\t(0U)\n+\n /*\n  * Get MPORT selector of a physical port.\n  *\n  * The resulting MPORT selector is opaque to the caller and can be\n- * passed as an argument to efx_mae_match_spec_mport_set().\n+ * passed as an argument to efx_mae_match_spec_mport_set()\n+ * and efx_mae_action_set_populate_deliver().\n  */\n LIBEFX_API\n extern\t__checkReturn\t\t\tefx_rc_t\n@@ -4163,6 +4166,12 @@ efx_mae_action_set_spec_fini(\n \t__in\t\t\t\tefx_nic_t *enp,\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_deliver(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mport_sel_t *mportp);\n+\n LIBEFX_API\n extern\t__checkReturn\t\t\tboolean_t\n efx_mae_action_set_specs_equal(\ndiff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h\nindex 86ef8e1b92..927324c85c 100644\n--- a/drivers/common/sfc_efx/base/efx_impl.h\n+++ b/drivers/common/sfc_efx/base/efx_impl.h\n@@ -1699,7 +1699,18 @@ struct efx_mae_match_spec_s {\n \t} emms_mask_value_pairs;\n };\n \n+typedef enum efx_mae_action_e {\n+\t/* DELIVER is always the last action. */\n+\tEFX_MAE_ACTION_DELIVER,\n+\n+\tEFX_MAE_NACTIONS\n+} efx_mae_action_t;\n+\n typedef struct efx_mae_actions_s {\n+\t/* Bitmap of actions in spec, indexed by action type */\n+\tuint32_t\t\t\temass_actions;\n+\n+\tefx_mport_sel_t\t\t\temass_deliver_mport;\n } efx_mae_actions_t;\n \n #endif /* EFSYS_OPT_MAE */\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 01b2e311a5..47611c4397 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -641,6 +641,147 @@ efx_mae_action_set_spec_fini(\n \tEFSYS_KMEM_FREE(enp->en_esip, sizeof (*spec), spec);\n }\n \n+static\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_add_deliver(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tsize_t arg_size,\n+\t__in_bcount(arg_size)\t\tconst uint8_t *arg)\n+{\n+\tefx_rc_t rc;\n+\n+\tif (arg_size != sizeof (spec->emass_deliver_mport)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\tif (arg == NULL) {\n+\t\trc = EINVAL;\n+\t\tgoto fail2;\n+\t}\n+\n+\tmemcpy(&spec->emass_deliver_mport, arg, arg_size);\n+\n+\treturn (0);\n+\n+fail2:\n+\tEFSYS_PROBE(fail2);\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n+typedef struct efx_mae_action_desc_s {\n+\t/* Action specific handler */\n+\tefx_rc_t\t(*emad_add)(efx_mae_actions_t *,\n+\t\t\t\t    size_t, const uint8_t *);\n+} efx_mae_action_desc_t;\n+\n+static const efx_mae_action_desc_t efx_mae_actions[EFX_MAE_NACTIONS] = {\n+\t[EFX_MAE_ACTION_DELIVER] = {\n+\t\t.emad_add = efx_mae_action_set_add_deliver\n+\t}\n+};\n+\n+static const uint32_t efx_mae_action_ordered_map =\n+\t(1U << EFX_MAE_ACTION_DELIVER);\n+\n+static const uint32_t efx_mae_action_repeat_map = 0;\n+\n+/*\n+ * Add an action to an action set.\n+ *\n+ * This has to be invoked in the desired action order.\n+ * An out-of-order action request will be turned down.\n+ */\n+static\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_action_set_spec_populate(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tefx_mae_action_t type,\n+\t__in\t\t\t\tsize_t arg_size,\n+\t__in_bcount(arg_size)\t\tconst uint8_t *arg)\n+{\n+\tuint32_t action_mask;\n+\tefx_rc_t rc;\n+\n+\tEFX_STATIC_ASSERT(EFX_MAE_NACTIONS <=\n+\t    (sizeof (efx_mae_action_ordered_map) * 8));\n+\tEFX_STATIC_ASSERT(EFX_MAE_NACTIONS <=\n+\t    (sizeof (efx_mae_action_repeat_map) * 8));\n+\n+\tEFX_STATIC_ASSERT(EFX_MAE_ACTION_DELIVER + 1 == EFX_MAE_NACTIONS);\n+\n+\tif (type >= EFX_ARRAY_SIZE(efx_mae_actions)) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\taction_mask = (1U << type);\n+\n+\tif ((spec->emass_actions & action_mask) != 0) {\n+\t\t/* The action set already contains this action. */\n+\t\tif ((efx_mae_action_repeat_map & action_mask) == 0) {\n+\t\t\t/* Cannot add another non-repeatable action. */\n+\t\t\trc = ENOTSUP;\n+\t\t\tgoto fail2;\n+\t\t}\n+\t}\n+\n+\tif ((efx_mae_action_ordered_map & action_mask) != 0) {\n+\t\tuint32_t later_actions_mask =\n+\t\t\tefx_mae_action_ordered_map &\n+\t\t\t~(action_mask | (action_mask - 1));\n+\n+\t\tif ((spec->emass_actions & later_actions_mask) != 0) {\n+\t\t\t/* Cannot add an action after later ordered actions. */\n+\t\t\trc = ENOTSUP;\n+\t\t\tgoto fail3;\n+\t\t}\n+\t}\n+\n+\tif (efx_mae_actions[type].emad_add != NULL) {\n+\t\trc = efx_mae_actions[type].emad_add(spec, arg_size, arg);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail4;\n+\t}\n+\n+\tspec->emass_actions |= action_mask;\n+\n+\treturn (0);\n+\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_populate_deliver(\n+\t__in\t\t\t\tefx_mae_actions_t *spec,\n+\t__in\t\t\t\tconst efx_mport_sel_t *mportp)\n+{\n+\tconst uint8_t *arg;\n+\tefx_rc_t rc;\n+\n+\tif (mportp == NULL) {\n+\t\trc = EINVAL;\n+\t\tgoto fail1;\n+\t}\n+\n+\targ = (const uint8_t *)&mportp->sel;\n+\n+\treturn (efx_mae_action_set_spec_populate(spec,\n+\t    EFX_MAE_ACTION_DELIVER, sizeof (mportp->sel), arg));\n+\n+fail1:\n+\tEFSYS_PROBE1(fail1, efx_rc_t, rc);\n+\treturn (rc);\n+}\n+\n \t__checkReturn\t\t\tboolean_t\n efx_mae_action_set_specs_equal(\n \t__in\t\t\t\tconst efx_mae_actions_t *left,\ndiff --git a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map\nindex 86ed437e8d..d2a5d58ae8 100644\n--- a/drivers/common/sfc_efx/rte_common_sfc_efx_version.map\n+++ b/drivers/common/sfc_efx/rte_common_sfc_efx_version.map\n@@ -85,6 +85,7 @@ INTERNAL {\n \tefx_mac_stats_upload;\n \tefx_mac_up;\n \n+\tefx_mae_action_set_populate_deliver;\n \tefx_mae_action_set_spec_fini;\n \tefx_mae_action_set_spec_init;\n \tefx_mae_action_set_specs_equal;\n",
    "prefixes": [
        "20/62"
    ]
}