get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129040,
    "url": "http://patchwork.dpdk.org/api/patches/129040/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230628070022.410127-3-artemii.morozov@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": "<20230628070022.410127-3-artemii.morozov@arknetworks.am>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230628070022.410127-3-artemii.morozov@arknetworks.am",
    "date": "2023-06-28T07:00:22",
    "name": "[v2,2/2] net/sfc: support IPv4 fragment matching in transfer rules",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f3fc4cfffdedc2a00e4085ec5a89676b3b37e043",
    "submitter": {
        "id": 3083,
        "url": "http://patchwork.dpdk.org/api/people/3083/?format=api",
        "name": "Artemii Morozov",
        "email": "Artemii.Morozov@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/20230628070022.410127-3-artemii.morozov@arknetworks.am/mbox/",
    "series": [
        {
            "id": 28680,
            "url": "http://patchwork.dpdk.org/api/series/28680/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28680",
            "date": "2023-06-28T07:00:20",
            "name": "support IPv4 fragment matching in transfer rules",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/28680/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129040/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129040/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 AC19A42D7C;\n\tWed, 28 Jun 2023 09:00:40 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A25B442D0C;\n\tWed, 28 Jun 2023 09:00:32 +0200 (CEST)",
            "from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80])\n by mails.dpdk.org (Postfix) with ESMTP id DAF7841138\n for <dev@dpdk.org>; Wed, 28 Jun 2023 09:00:29 +0200 (CEST)",
            "from angrod.. (unknown [141.136.89.94])\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 F0D14E1300;\n Wed, 28 Jun 2023 11:00:28 +0400 (+04)"
        ],
        "From": "Artemii Morozov <artemii.morozov@arknetworks.am>",
        "To": "dev@dpdk.org",
        "Cc": "Ivan Malov <ivan.malov@arknetworks.am>,\n Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,\n Andy Moreton <amoreton@xilinx.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ferruh Yigit <ferruh.yigit@amd.com>",
        "Subject": "[PATCH v2 2/2] net/sfc: support IPv4 fragment matching in transfer\n rules",
        "Date": "Wed, 28 Jun 2023 11:00:22 +0400",
        "Message-Id": "<20230628070022.410127-3-artemii.morozov@arknetworks.am>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230628070022.410127-1-artemii.morozov@arknetworks.am>",
        "References": "<20230623165824.51908-1-artemii.morozov@arknetworks.am>\n <20230628070022.410127-1-artemii.morozov@arknetworks.am>",
        "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": "This patch adds the support for IPv4 fragmented packets, but with\nsome limitations: for non-zero fragment offset an exact match is not\nallowed, but ranges are allowed.\n\nSigned-off-by: Artemii Morozov <artemii.morozov@arknetworks.am>\nReviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>\nReviewed-by: Andy Moreton <amoreton@xilinx.com>\n---\n drivers/net/sfc/sfc_mae.c | 110 +++++++++++++++++++++++++++++++++++++-\n drivers/net/sfc/sfc_mae.h |   4 ++\n 2 files changed, 113 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c\nindex a3131c244d..63f6536243 100644\n--- a/drivers/net/sfc/sfc_mae.c\n+++ b/drivers/net/sfc/sfc_mae.c\n@@ -1700,6 +1700,80 @@ sfc_mae_rule_process_pattern_data(struct sfc_mae_parse_ctx *ctx,\n \tif (rc != 0)\n \t\tgoto fail;\n \n+\tif (pdata->l3_frag_ofst_mask != 0) {\n+\t\tconst rte_be16_t hdr_mask = RTE_BE16(RTE_IPV4_HDR_OFFSET_MASK);\n+\t\trte_be16_t value;\n+\t\trte_be16_t last;\n+\t\tboolean_t first_frag;\n+\t\tboolean_t is_ip_frag;\n+\t\tboolean_t any_frag;\n+\n+\t\tif (pdata->l3_frag_ofst_mask & RTE_BE16(RTE_IPV4_HDR_DF_FLAG)) {\n+\t\t\tsfc_err(ctx->sa, \"Don't fragment flag is not supported.\");\n+\t\t\trc = ENOTSUP;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\tif ((pdata->l3_frag_ofst_mask & hdr_mask) != hdr_mask) {\n+\t\t\tsfc_err(ctx->sa, \"Invalid value for fragment offset mask.\");\n+\t\t\trc = EINVAL;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\tvalue = pdata->l3_frag_ofst_mask & pdata->l3_frag_ofst_value;\n+\t\tlast = pdata->l3_frag_ofst_mask & pdata->l3_frag_ofst_last;\n+\n+\t\t/*\n+\t\t *  value:  last:       matches:\n+\t\t *  0       0           Non-fragmented packet\n+\t\t *  1       0x1fff      Non-first fragment\n+\t\t *  1       0x1fff+MF   Any fragment\n+\t\t *  MF      0           First fragment\n+\t\t */\n+\t\tif (last == 0 &&\n+\t\t    (pdata->l3_frag_ofst_value & hdr_mask) != 0) {\n+\t\t\tsfc_err(ctx->sa,\n+\t\t\t\t\"Exact matching is prohibited for non-zero offsets, but ranges are allowed.\");\n+\t\t\trc = EINVAL;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\tif (value == 0 && last == 0) {\n+\t\t\tis_ip_frag = false;\n+\t\t\tany_frag = true;\n+\t\t} else if (value == RTE_BE16(1) && (last & hdr_mask) == hdr_mask) {\n+\t\t\tif (last & RTE_BE16(RTE_IPV4_HDR_MF_FLAG)) {\n+\t\t\t\tis_ip_frag = true;\n+\t\t\t\tany_frag = true;\n+\t\t\t} else {\n+\t\t\t\tis_ip_frag = true;\n+\t\t\t\tany_frag = false;\n+\t\t\t\tfirst_frag = false;\n+\t\t\t}\n+\t\t} else if (value == RTE_BE16(RTE_IPV4_HDR_MF_FLAG) && last == 0) {\n+\t\t\tis_ip_frag = true;\n+\t\t\tany_frag = false;\n+\t\t\tfirst_frag = true;\n+\t\t} else {\n+\t\t\tsfc_err(ctx->sa, \"Invalid value for fragment offset.\");\n+\t\t\trc = EINVAL;\n+\t\t\tgoto fail;\n+\t\t}\n+\n+\t\trc = efx_mae_match_spec_bit_set(ctx->match_spec,\n+\t\t\t\t\t\tfremap[EFX_MAE_FIELD_IS_IP_FRAG], is_ip_frag);\n+\t\tif (rc != 0)\n+\t\t\tgoto fail;\n+\n+\t\tif (!any_frag) {\n+\t\t\trc = efx_mae_match_spec_bit_set(ctx->match_spec,\n+\t\t\t\t\t\t\tfremap[EFX_MAE_FIELD_IP_FIRST_FRAG],\n+\t\t\t\t\t\t\tfirst_frag);\n+\t\t\tif (rc != 0)\n+\t\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n \treturn 0;\n \n fail:\n@@ -2208,6 +2282,15 @@ static const struct sfc_mae_field_locator flocs_ipv4[] = {\n \t\tRTE_SIZEOF_FIELD(struct rte_flow_item_ipv4, hdr.next_proto_id),\n \t\toffsetof(struct rte_flow_item_ipv4, hdr.next_proto_id),\n \t},\n+\t{\n+\t\t/*\n+\t\t * This locator is used only for building supported fields mask.\n+\t\t * The field is handled by sfc_mae_rule_process_pattern_data().\n+\t\t */\n+\t\tSFC_MAE_FIELD_HANDLING_DEFERRED,\n+\t\tRTE_SIZEOF_FIELD(struct rte_flow_item_ipv4, hdr.fragment_offset),\n+\t\toffsetof(struct rte_flow_item_ipv4, hdr.fragment_offset),\n+\t},\n \t{\n \t\tEFX_MAE_FIELD_IP_TOS,\n \t\tRTE_SIZEOF_FIELD(struct rte_flow_item_ipv4,\n@@ -2230,14 +2313,30 @@ sfc_mae_rule_parse_item_ipv4(const struct rte_flow_item *item,\n \tstruct sfc_mae_parse_ctx *ctx_mae = ctx->mae;\n \tstruct sfc_mae_pattern_data *pdata = &ctx_mae->pattern_data;\n \tstruct rte_flow_item_ipv4 supp_mask;\n+\tstruct rte_flow_item item_dup;\n \tconst uint8_t *spec = NULL;\n \tconst uint8_t *mask = NULL;\n+\tconst uint8_t *last = NULL;\n \tint rc;\n \n+\titem_dup.spec = item->spec;\n+\titem_dup.mask = item->mask;\n+\titem_dup.last = item->last;\n+\titem_dup.type = item->type;\n+\n \tsfc_mae_item_build_supp_mask(flocs_ipv4, RTE_DIM(flocs_ipv4),\n \t\t\t\t     &supp_mask, sizeof(supp_mask));\n \n-\trc = sfc_flow_parse_init(item,\n+\t/* We don't support IPv4 fragmentation in the outer frames. */\n+\tif (ctx_mae->match_spec != ctx_mae->match_spec_action)\n+\t\tsupp_mask.hdr.fragment_offset = 0;\n+\n+\tif (item != NULL && item->last != NULL) {\n+\t\tlast = item->last;\n+\t\titem_dup.last = NULL;\n+\t}\n+\n+\trc = sfc_flow_parse_init(&item_dup,\n \t\t\t\t (const void **)&spec, (const void **)&mask,\n \t\t\t\t (const void *)&supp_mask,\n \t\t\t\t &rte_flow_item_ipv4_mask,\n@@ -2251,12 +2350,19 @@ sfc_mae_rule_parse_item_ipv4(const struct rte_flow_item *item,\n \tif (spec != NULL) {\n \t\tconst struct rte_flow_item_ipv4 *item_spec;\n \t\tconst struct rte_flow_item_ipv4 *item_mask;\n+\t\tconst struct rte_flow_item_ipv4 *item_last;\n \n \t\titem_spec = (const struct rte_flow_item_ipv4 *)spec;\n \t\titem_mask = (const struct rte_flow_item_ipv4 *)mask;\n+\t\tif (last != NULL)\n+\t\t\titem_last = (const struct rte_flow_item_ipv4 *)last;\n \n \t\tpdata->l3_next_proto_value = item_spec->hdr.next_proto_id;\n \t\tpdata->l3_next_proto_mask = item_mask->hdr.next_proto_id;\n+\t\tpdata->l3_frag_ofst_mask = item_mask->hdr.fragment_offset;\n+\t\tpdata->l3_frag_ofst_value = item_spec->hdr.fragment_offset;\n+\t\tif (last != NULL)\n+\t\t\tpdata->l3_frag_ofst_last = item_last->hdr.fragment_offset;\n \t} else {\n \t\treturn 0;\n \t}\n@@ -2518,6 +2624,8 @@ static const efx_mae_field_id_t field_ids_no_remap[] = {\n \tFIELD_ID_NO_REMAP(TCP_FLAGS_BE),\n \tFIELD_ID_NO_REMAP(HAS_OVLAN),\n \tFIELD_ID_NO_REMAP(HAS_IVLAN),\n+\tFIELD_ID_NO_REMAP(IS_IP_FRAG),\n+\tFIELD_ID_NO_REMAP(IP_FIRST_FRAG),\n \n #undef FIELD_ID_NO_REMAP\n };\ndiff --git a/drivers/net/sfc/sfc_mae.h b/drivers/net/sfc/sfc_mae.h\nindex 80585c0e93..059718e383 100644\n--- a/drivers/net/sfc/sfc_mae.h\n+++ b/drivers/net/sfc/sfc_mae.h\n@@ -334,6 +334,10 @@ struct sfc_mae_pattern_data {\n \tuint8_t\t\t\t\tl3_next_proto_restriction_value;\n \tuint8_t\t\t\t\tl3_next_proto_restriction_mask;\n \n+\trte_be16_t\t\t\tl3_frag_ofst_value;\n+\trte_be16_t\t\t\tl3_frag_ofst_mask;\n+\trte_be16_t\t\t\tl3_frag_ofst_last;\n+\n \t/* Projected state of EFX_MAE_FIELD_HAS_OVLAN match bit */\n \tbool\t\t\t\thas_ovlan_value;\n \tbool\t\t\t\thas_ovlan_mask;\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}