get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81540,
    "url": "https://patches.dpdk.org/api/patches/81540/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1603185222-14831-29-git-send-email-arybchenko@solarflare.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1603185222-14831-29-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603185222-14831-29-git-send-email-arybchenko@solarflare.com",
    "date": "2020-10-20T09:13:08",
    "name": "[v2,28/62] net/sfc: add facilities to handle bundles of actions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f66166cd72a73f474688fc632e157a4db2c1c6bc",
    "submitter": {
        "id": 607,
        "url": "https://patches.dpdk.org/api/people/607/?format=api",
        "name": "Andrew Rybchenko",
        "email": "arybchenko@solarflare.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1603185222-14831-29-git-send-email-arybchenko@solarflare.com/mbox/",
    "series": [
        {
            "id": 13137,
            "url": "https://patches.dpdk.org/api/series/13137/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13137",
            "date": "2020-10-20T09:12:44",
            "name": "net/sfc: support flow API transfer rules",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/13137/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/81540/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/81540/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 E267BA04DD;\n\tTue, 20 Oct 2020 11:30:31 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 70C7FE2AC;\n\tTue, 20 Oct 2020 11:15:05 +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 D65D5C81A\n for <dev@dpdk.org>; Tue, 20 Oct 2020 11:14:12 +0200 (CEST)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.61])\n by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id\n A520B60085 for <dev@dpdk.org>; Tue, 20 Oct 2020 09:14:12 +0000 (UTC)",
            "from us4-mdac16-49.ut7.mdlocal (unknown [10.7.66.16])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A435D8009E\n for <dev@dpdk.org>; Tue, 20 Oct 2020 09:14:12 +0000 (UTC)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.66.34])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2974980056\n for <dev@dpdk.org>; Tue, 20 Oct 2020 09:14:12 +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 CFF29600053\n for <dev@dpdk.org>; Tue, 20 Oct 2020 09:14:11 +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 10:14:00 +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 10:14:00 +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 09K9E08h028421;\n Tue, 20 Oct 2020 10:14:00 +0100",
            "from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1])\n by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 541D71613A9;\n Tue, 20 Oct 2020 10:14:00 +0100 (BST)"
        ],
        "X-Virus-Scanned": "Proofpoint Essentials engine",
        "From": "Andrew Rybchenko <arybchenko@solarflare.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Ivan Malov <ivan.malov@oktetlabs.ru>",
        "Date": "Tue, 20 Oct 2020 10:13:08 +0100",
        "Message-ID": "<1603185222-14831-29-git-send-email-arybchenko@solarflare.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1603185222-14831-1-git-send-email-arybchenko@solarflare.com>",
        "References": "<1603183709-23420-1-git-send-email-arybchenko@solarflare.com>\n <1603185222-14831-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-6.694700-8.000000-10",
        "X-TMASE-MatchedRID": "06MbsPpyjR8jNucrJ/Da40Qiyd+xo4asAPiR4btCEeaRoQLwUmtov+Z5\n Gn23AeDZ8XVI39JCRnRuL3ESIrARlyHhSBQfglfsA9lly13c/gFe392/7zQs4B//bz4/xYKAg7l\n N9LOvFDvbKZq4ZwZRTVeJGcgaXvUTKjPlgWuJZGx0+657dxGJGFm0RpxOMxmR5lhx0mBJyPG9DD\n 1najpyL0FLaJMiMk4ci/W2oLMQ0YUEGNruDgdTzb09KAokwDFUBtG6netTkaWudK6ZkaOfBPyqd\n p7+4Qj9KexaoH99e/Qwg/gpNb2sRwXa2B9iG+md+4Fj9EzRyxxgRHGPNVoqHYpc3JtqeiRPeKaj\n vO6uWnCCukcfrdcoGfibKkET0a8ctLD+nJjWKTgjRwcsjqWGAgEFZ4PF7UrQbRmE6L06upYlXnw\n 1RqSfcI3FtUIcHUfM/vt4tYKcjeI6NBdUxznZvZCB65RjRY3sjlaPgQwpjaybKItl61J/yZ+inT\n K0bC9eKrauXd3MZDWg42+KMinH0UFnvntw+nrLyXgwBKCerXIGQ9s44ZGcccCdJ4a5sUpK",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--6.694700-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.6.1012-25736.003",
        "X-MDID": "1603185252-UQ11uoLhXOIA",
        "X-PPE-DISP": "1603185252;UQ11uoLhXOIA",
        "Subject": "[dpdk-dev] [PATCH v2 28/62] net/sfc: add facilities to handle\n\tbundles of actions",
        "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\nThere are MAE actions which do not have uniform counterparts\nin terms of RTE flow. However, there are bundles of RTE flow\nactions which can be considered as such counterparts.\n\nImplement facilities to handle related RTE flow actions as\nparts of a whole. These facilities will be used by a later\npatch to add support for VLAN PUSH actions bundle.\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/net/sfc/sfc_flow.c |   4 --\n drivers/net/sfc/sfc_flow.h |   4 ++\n drivers/net/sfc/sfc_mae.c  | 112 ++++++++++++++++++++++++++++++++++++-\n 3 files changed, 115 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c\nindex 3af95ac8ee..6ccefef477 100644\n--- a/drivers/net/sfc/sfc_flow.c\n+++ b/drivers/net/sfc/sfc_flow.c\n@@ -1679,9 +1679,6 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \t\treturn -rte_errno;\n \t}\n \n-#define SFC_BUILD_SET_OVERFLOW(_action, _set) \\\n-\tRTE_BUILD_BUG_ON(_action >= sizeof(_set) * CHAR_BIT)\n-\n \tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n \t\tswitch (actions->type) {\n \t\tcase RTE_FLOW_ACTION_TYPE_VOID:\n@@ -1777,7 +1774,6 @@ sfc_flow_parse_actions(struct sfc_adapter *sa,\n \n \t\tactions_set |= (1UL << actions->type);\n \t}\n-#undef SFC_BUILD_SET_OVERFLOW\n \n \t/* When fate is unknown, drop traffic. */\n \tif ((actions_set & fate_actions_mask) == 0) {\ndiff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h\nindex d3bdbd5f75..e991ae132c 100644\n--- a/drivers/net/sfc/sfc_flow.h\n+++ b/drivers/net/sfc/sfc_flow.h\n@@ -26,6 +26,10 @@ extern \"C\" {\n  */\n #define SF_FLOW_SPEC_NB_FILTERS_MAX 8\n \n+/* Used to guard action masks */\n+#define SFC_BUILD_SET_OVERFLOW(_action, _set) \\\n+\tRTE_BUILD_BUG_ON((_action) >= sizeof(_set) * CHAR_BIT)\n+\n /* RSS configuration storage */\n struct sfc_flow_rss {\n \tunsigned int\trxq_hw_index_min;\ndiff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c\nindex a86a22ad8f..5fbf627f0a 100644\n--- a/drivers/net/sfc/sfc_mae.c\n+++ b/drivers/net/sfc/sfc_mae.c\n@@ -445,6 +445,99 @@ sfc_mae_rule_parse_pattern(struct sfc_adapter *sa,\n \treturn rc;\n }\n \n+/*\n+ * An action supported by MAE may correspond to a bundle of RTE flow actions,\n+ * in example, VLAN_PUSH = OF_PUSH_VLAN + OF_VLAN_SET_VID + OF_VLAN_SET_PCP.\n+ * That is, related RTE flow actions need to be tracked as parts of a whole\n+ * so that they can be combined into a single action and submitted to MAE\n+ * representation of a given rule's action set.\n+ *\n+ * Each RTE flow action provided by an application gets classified as\n+ * one belonging to some bundle type. If an action is not supposed to\n+ * belong to any bundle, or if this action is END, it is described as\n+ * one belonging to a dummy bundle of type EMPTY.\n+ *\n+ * A currently tracked bundle will be submitted if a repeating\n+ * action or an action of different bundle type follows.\n+ */\n+\n+enum sfc_mae_actions_bundle_type {\n+\tSFC_MAE_ACTIONS_BUNDLE_EMPTY = 0,\n+};\n+\n+struct sfc_mae_actions_bundle {\n+\tenum sfc_mae_actions_bundle_type\ttype;\n+\n+\t/* Indicates actions already tracked by the current bundle */\n+\tuint64_t\t\t\t\tactions_mask;\n+};\n+\n+/*\n+ * Combine configuration of RTE flow actions tracked by the bundle into a\n+ * single action and submit the result to MAE action set specification.\n+ * Do nothing in the case of dummy action bundle.\n+ */\n+static int\n+sfc_mae_actions_bundle_submit(const struct sfc_mae_actions_bundle *bundle,\n+\t\t\t      __rte_unused efx_mae_actions_t *spec)\n+{\n+\tint rc = 0;\n+\n+\tswitch (bundle->type) {\n+\tcase SFC_MAE_ACTIONS_BUNDLE_EMPTY:\n+\t\tbreak;\n+\tdefault:\n+\t\tSFC_ASSERT(B_FALSE);\n+\t\tbreak;\n+\t}\n+\n+\treturn rc;\n+}\n+\n+/*\n+ * Given the type of the next RTE flow action in the line, decide\n+ * whether a new bundle is about to start, and, if this is the case,\n+ * submit and reset the current bundle.\n+ */\n+static int\n+sfc_mae_actions_bundle_sync(const struct rte_flow_action *action,\n+\t\t\t    struct sfc_mae_actions_bundle *bundle,\n+\t\t\t    efx_mae_actions_t *spec,\n+\t\t\t    struct rte_flow_error *error)\n+{\n+\tenum sfc_mae_actions_bundle_type bundle_type_new;\n+\tint rc;\n+\n+\tswitch (action->type) {\n+\tdefault:\n+\t\t/*\n+\t\t * Self-sufficient actions, including END, are handled in this\n+\t\t * case. No checks for unsupported actions are needed here\n+\t\t * because parsing doesn't occur at this point.\n+\t\t */\n+\t\tbundle_type_new = SFC_MAE_ACTIONS_BUNDLE_EMPTY;\n+\t\tbreak;\n+\t}\n+\n+\tif (bundle_type_new != bundle->type ||\n+\t    (bundle->actions_mask & (1ULL << action->type)) != 0) {\n+\t\trc = sfc_mae_actions_bundle_submit(bundle, spec);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail_submit;\n+\n+\t\tmemset(bundle, 0, sizeof(*bundle));\n+\t}\n+\n+\tbundle->type = bundle_type_new;\n+\n+\treturn 0;\n+\n+fail_submit:\n+\treturn rte_flow_error_set(error, rc,\n+\t\t\tRTE_FLOW_ERROR_TYPE_ACTION, NULL,\n+\t\t\t\"Failed to request the (group of) action(s)\");\n+}\n+\n static int\n sfc_mae_rule_parse_action_phy_port(struct sfc_adapter *sa,\n \t\t\t\t   const struct rte_flow_action_phy_port *conf,\n@@ -469,6 +562,7 @@ sfc_mae_rule_parse_action_phy_port(struct sfc_adapter *sa,\n static int\n sfc_mae_rule_parse_action(struct sfc_adapter *sa,\n \t\t\t  const struct rte_flow_action *action,\n+\t\t\t  struct sfc_mae_actions_bundle *bundle,\n \t\t\t  efx_mae_actions_t *spec,\n \t\t\t  struct rte_flow_error *error)\n {\n@@ -476,9 +570,13 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa,\n \n \tswitch (action->type) {\n \tcase RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:\n+\t\tSFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_OF_POP_VLAN,\n+\t\t\t\t       bundle->actions_mask);\n \t\trc = efx_mae_action_set_populate_vlan_pop(spec);\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_PHY_PORT:\n+\t\tSFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_PHY_PORT,\n+\t\t\t\t       bundle->actions_mask);\n \t\trc = sfc_mae_rule_parse_action_phy_port(sa, action->conf, spec);\n \t\tbreak;\n \tdefault:\n@@ -490,6 +588,8 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa,\n \tif (rc != 0) {\n \t\trc = rte_flow_error_set(error, rc, RTE_FLOW_ERROR_TYPE_ACTION,\n \t\t\t\tNULL, \"Failed to request the action\");\n+\t} else {\n+\t\tbundle->actions_mask |= (1ULL << action->type);\n \t}\n \n \treturn rc;\n@@ -501,6 +601,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,\n \t\t\t   struct sfc_mae_action_set **action_setp,\n \t\t\t   struct rte_flow_error *error)\n {\n+\tstruct sfc_mae_actions_bundle bundle = {0};\n \tconst struct rte_flow_action *action;\n \tefx_mae_actions_t *spec;\n \tint rc;\n@@ -517,11 +618,20 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,\n \n \tfor (action = actions;\n \t     action->type != RTE_FLOW_ACTION_TYPE_END; ++action) {\n-\t\trc = sfc_mae_rule_parse_action(sa, action, spec, error);\n+\t\trc = sfc_mae_actions_bundle_sync(action, &bundle, spec, error);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail_rule_parse_action;\n+\n+\t\trc = sfc_mae_rule_parse_action(sa, action, &bundle, spec,\n+\t\t\t\t\t       error);\n \t\tif (rc != 0)\n \t\t\tgoto fail_rule_parse_action;\n \t}\n \n+\trc = sfc_mae_actions_bundle_sync(action, &bundle, spec, error);\n+\tif (rc != 0)\n+\t\tgoto fail_rule_parse_action;\n+\n \t*action_setp = sfc_mae_action_set_attach(sa, spec);\n \tif (*action_setp != NULL) {\n \t\tefx_mae_action_set_spec_fini(sa->nic, spec);\n",
    "prefixes": [
        "v2",
        "28/62"
    ]
}