get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81463,
    "url": "http://patches.dpdk.org/api/patches/81463/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603183709-23420-13-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-13-git-send-email-arybchenko@solarflare.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603183709-23420-13-git-send-email-arybchenko@solarflare.com",
    "date": "2020-10-20T08:47:39",
    "name": "[12/62] common/sfc_efx/base: add a match specs class comparison API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7aa06ea1a342a26a1f26668983cdfc38e898fe2e",
    "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-13-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/81463/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/81463/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 A82DDA04DD;\n\tTue, 20 Oct 2020 10:56:21 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2EFA3BCE0;\n\tTue, 20 Oct 2020 10:49:35 +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 4B012BBA2\n for <dev@dpdk.org>; Tue, 20 Oct 2020 10:49:01 +0200 (CEST)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.65.64])\n by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id\n BBFAA60081 for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:59 +0000 (UTC)",
            "from us4-mdac16-10.ut7.mdlocal (unknown [10.7.65.180])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id BB8CC2009B\n for <dev@dpdk.org>; Tue, 20 Oct 2020 08:48:59 +0000 (UTC)",
            "from mx1-us1.ppe-hosted.com (unknown [10.7.66.33])\n by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id\n 47AEE220052\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 F2F19A80061\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 09K8mnWF030802;\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 52823161789;\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:39 +0100",
        "Message-ID": "<1603183709-23420-13-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-2.975200-8.000000-10",
        "X-TMASE-MatchedRID": "fPU3ZRMebCv5s5ZGHFKFGDQ60lWQoG0rKVrLOZD1BXQOkJQR4QWbsLBZ\n szSz1qeiqucwHXTsrX/cJxdWvjKQ3yiq3P159fwpqg0gbtLVIa96i696PjRPiNWO4MK8ycTFH8M\n UR/9vnkerO5PmBFOASkDTw9uN2GLZHVikQ9YmLLOInASnzB5VfFJAsn89ih94Bph69XjMbdlSkV\n 47LHGpi2b7tdoOCN42itqmw2mRWTOiwCaYPn5sJltTO+xodboGAp+UH372RZVHZg0gWH5yUdNVR\n hry6jgeuW0lBjgUk+dW1Uyf/vuKAOcYCqaThQZTt0cS/uxH87CWGk93C/VnSuy9vsxhLmzehnOL\n yflyxrMf9OAqZEL+UoAy6p60ZV62fJ5/bZ6npdiujVRFkkVsm5pFQJ/p5Nu32//BiXwu3rJ2HkB\n h36F2JFsU/6sZL7aV6S6RqbiHkfMf1hYTrHRVsdQGB+u1ogfeLXpd6HTgbX6DlWNaESsm5/DsnH\n BTQS9kyoRE4tv/7I7j/Qm+fSvAAma0vgPD7M1vmFd/HOChTo8=",
        "X-TM-AS-User-Approved-Sender": "Yes",
        "X-TM-AS-User-Blocked-Sender": "No",
        "X-TMASE-Result": "10--2.975200-8.000000",
        "X-TMASE-Version": "SMEX-12.5.0.1300-8.6.1012-25736.003",
        "X-MDID": "1603183739-ELDCZJ3UCZLe",
        "X-PPE-DISP": "1603183739;ELDCZJ3UCZLe",
        "Subject": "[dpdk-dev] [PATCH 12/62] common/sfc_efx/base: add a match specs\n\tclass comparison API",
        "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\nFrom MAE standpoint, a flow rule belongs to some class. Field capabilities\nadvertised by the FW provide a hint on whether changing a particular match\nfield value or its mask will affect the class of the rule. A client driver\ncan make use of the concept of a class by comparing a rule being validated\nwith already inserted ones so that if an existing rule with the same class\nis encountered, it will become possible to skip making an explicit request\nto the FW because the class of an already inserted rule is wittingly valid.\n\nImplement an API for client drivers to carry out the said class comparison.\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             | 13 +++\n drivers/common/sfc_efx/base/efx_mae.c         | 96 +++++++++++++++++++\n .../sfc_efx/rte_common_sfc_efx_version.map    |  1 +\n 3 files changed, 110 insertions(+)",
    "diff": "diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h\nindex 094fad6367..c91f7948a0 100644\n--- a/drivers/common/sfc_efx/base/efx.h\n+++ b/drivers/common/sfc_efx/base/efx.h\n@@ -4098,6 +4098,19 @@ efx_mae_match_spec_is_valid(\n \t__in\t\t\t\tefx_nic_t *enp,\n \t__in\t\t\t\tconst efx_mae_match_spec_t *spec);\n \n+/*\n+ * Conduct a comparison to check whether two match specifications\n+ * of equal rule type (action / outer) and priority would map to\n+ * the very same rule class from the firmware's standpoint.\n+ */\n+LIBEFX_API\n+extern\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_match_specs_class_cmp(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tconst efx_mae_match_spec_t *left,\n+\t__in\t\t\t\tconst efx_mae_match_spec_t *right,\n+\t__out\t\t\t\tboolean_t *have_same_classp);\n+\n #endif /* EFSYS_OPT_MAE */\n \n #ifdef\t__cplusplus\ndiff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c\nindex 9e22c3d507..a126cba37f 100644\n--- a/drivers/common/sfc_efx/base/efx_mae.c\n+++ b/drivers/common/sfc_efx/base/efx_mae.c\n@@ -434,4 +434,100 @@ efx_mae_match_spec_is_valid(\n \treturn (is_valid);\n }\n \n+\t__checkReturn\t\t\tefx_rc_t\n+efx_mae_match_specs_class_cmp(\n+\t__in\t\t\t\tefx_nic_t *enp,\n+\t__in\t\t\t\tconst efx_mae_match_spec_t *left,\n+\t__in\t\t\t\tconst efx_mae_match_spec_t *right,\n+\t__out\t\t\t\tboolean_t *have_same_classp)\n+{\n+\tefx_mae_t *maep = enp->en_maep;\n+\tunsigned int field_ncaps = maep->em_max_nfields;\n+\tconst efx_mae_field_cap_t *field_caps;\n+\tconst efx_mae_mv_desc_t *desc_setp;\n+\tunsigned int desc_set_nentries;\n+\tboolean_t have_same_class = B_TRUE;\n+\tefx_mae_field_id_t field_id;\n+\tconst uint8_t *mvpl;\n+\tconst uint8_t *mvpr;\n+\tefx_rc_t rc;\n+\n+\tswitch (left->emms_type) {\n+\tcase EFX_MAE_RULE_ACTION:\n+\t\tfield_caps = maep->em_action_rule_field_caps;\n+\t\tdesc_setp = __efx_mae_action_rule_mv_desc_set;\n+\t\tdesc_set_nentries =\n+\t\t    EFX_ARRAY_SIZE(__efx_mae_action_rule_mv_desc_set);\n+\t\tmvpl = left->emms_mask_value_pairs.action;\n+\t\tmvpr = right->emms_mask_value_pairs.action;\n+\t\tbreak;\n+\tdefault:\n+\t\trc = ENOTSUP;\n+\t\tgoto fail1;\n+\t}\n+\n+\tif (field_caps == NULL) {\n+\t\trc = EAGAIN;\n+\t\tgoto fail2;\n+\t}\n+\n+\tif (left->emms_type != right->emms_type ||\n+\t    left->emms_prio != right->emms_prio) {\n+\t\t/*\n+\t\t * Rules of different types can never map to the same class.\n+\t\t *\n+\t\t * The FW can support some set of match criteria for one\n+\t\t * priority and not support the very same set for\n+\t\t * another priority. Thus, two rules which have\n+\t\t * different priorities can never map to\n+\t\t * the same class.\n+\t\t */\n+\t\t*have_same_classp = B_FALSE;\n+\t\treturn (0);\n+\t}\n+\n+\tfor (field_id = 0; field_id < desc_set_nentries; ++field_id) {\n+\t\tconst efx_mae_mv_desc_t *descp = &desc_setp[field_id];\n+\t\tefx_mae_field_cap_id_t field_cap_id = descp->emmd_field_cap_id;\n+\n+\t\tif (descp->emmd_mask_size == 0)\n+\t\t\tcontinue; /* Skip array gap */\n+\n+\t\tif (field_cap_id >= field_ncaps)\n+\t\t\tbreak;\n+\n+\t\tif (field_caps[field_cap_id].emfc_mask_affects_class) {\n+\t\t\tconst uint8_t *lmaskp = mvpl + descp->emmd_mask_offset;\n+\t\t\tconst uint8_t *rmaskp = mvpr + descp->emmd_mask_offset;\n+\t\t\tsize_t mask_size = descp->emmd_mask_size;\n+\n+\t\t\tif (memcmp(lmaskp, rmaskp, mask_size) != 0) {\n+\t\t\t\thave_same_class = B_FALSE;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (field_caps[field_cap_id].emfc_match_affects_class) {\n+\t\t\tconst uint8_t *lvalp = mvpl + descp->emmd_value_offset;\n+\t\t\tconst uint8_t *rvalp = mvpr + descp->emmd_value_offset;\n+\t\t\tsize_t value_size = descp->emmd_value_size;\n+\n+\t\t\tif (memcmp(lvalp, rvalp, value_size) != 0) {\n+\t\t\t\thave_same_class = B_FALSE;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t*have_same_classp = have_same_class;\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 #endif /* EFSYS_OPT_MAE */\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 0e6d44b6dc..aeb6f4d134 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@@ -91,6 +91,7 @@ INTERNAL {\n \tefx_mae_match_spec_fini;\n \tefx_mae_match_spec_init;\n \tefx_mae_match_spec_is_valid;\n+\tefx_mae_match_specs_class_cmp;\n \n \tefx_mcdi_fini;\n \tefx_mcdi_get_proxy_handle;\n",
    "prefixes": [
        "12/62"
    ]
}