Show a patch.

GET /api/patches/74477/
Content-Type: application/json
Vary: Accept

    "id": 74477,
    "url": "",
    "web_url": "",
    "project": {
        "id": 1,
        "url": "",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "",
        "list_email": "",
        "web_url": "",
        "scm_url": "git://",
        "webscm_url": ""
    "msgid": "<>",
    "date": "2020-07-20T09:03:42",
    "name": "net/mlx5: fix the compatibility with MISC4",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b1743b663e6c1ce6745a3e10d307f1463a4db7a5",
    "submitter": {
        "id": 1357,
        "url": "",
        "name": "Bing Zhao",
        "email": ""
    "delegate": {
        "id": 3268,
        "url": "",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": ""
    "mbox": "",
    "series": [
            "id": 11163,
            "url": "",
            "web_url": "",
            "date": "2020-07-20T09:03:42",
            "name": "net/mlx5: fix the compatibility with MISC4",
            "version": 1,
            "mbox": ""
    "comments": "",
    "check": "fail",
    "checks": "",
    "tags": {},
    "headers": {
        "List-Subscribe": "<>,\n <>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Original-To": "",
        "List-Post": "<>",
        "X-BeenThere": "",
        "List-Id": "DPDK patches and discussions <>",
        "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix the compatibility with MISC4",
        "Sender": "\"dev\" <>",
        "From": "Bing Zhao <>",
        "Received": [
            "from ( [])\n\tby (Postfix) with ESMTP id 73EE5A0540;\n\tMon, 20 Jul 2020 11:03:56 +0200 (CEST)",
            "from [] (localhost [])\n\tby (Postfix) with ESMTP id 2BEEB2B9C;\n\tMon, 20 Jul 2020 11:03:55 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [])\n by (Postfix) with ESMTP id 853382AA6\n for <>; Mon, 20 Jul 2020 11:03:53 +0200 (CEST)"
        "To": ",\n\",
        "X-Mailer": "git-send-email",
        "List-Unsubscribe": "<>,\n <>",
        "Date": "Mon, 20 Jul 2020 17:03:42 +0800",
        "List-Archive": "<>",
        "Delivered-To": "",
        "Errors-To": "",
        "Cc": ",\n\,\n\",
        "List-Help": "<>",
        "Message-Id": "<>",
        "Return-Path": "<>"
    "content": "When eCPRI offloading is introduced, the support for misc parameters\n4 of flow table entry (FTE) match set is needed. The structure of\n\"mlx5_ifc_fte_match_param_bits\" is extended with\n\"mlx5_ifc_fte_match_set_misc4_bits\" at the end of it. The total size\nof the FTE match set will be changed into 384 bytes from 320 bytes.\nLow level user space driver (rdma-core) will have the validation of\nthe length of FTE match set. In the old release that no MISC4\nsupported in the rdma-core, the validation will fail, and this will\nbreak the backward compatibility, even if the MISC4 is not used in\nmost cases.\nIn order to make new mlx5 PMD work well with old rdma-core, the\nlength adjustment needs to be done. When creating a flow, the lengths\nof the matcher and value are both set to 320 without MISC4. There is\nno need to change the structure definition, all bytes of the MISC4\nwill be discarded if it is not needed. Or else, like in eCPRI\nmatching, the lengths will be adjusted to 384 for matcher creation\nand value matching.\n\nFixes: afa8556c873c (\"net/mlx5: add flow translation of eCPRI header\")\n\nSigned-off-by: Bing Zhao <>\nAcked-by: Viacheslav Ovsiienko <>\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 17 +++++++++++++++--\n 1 file changed, 15 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex ee66a44..778a766 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -5765,7 +5765,15 @@ struct field_modify_info modify_tcp[] = {\n \tdev_flow = &((struct mlx5_flow *)priv->inter_flows)[priv->flow_idx++];\n \tdev_flow->handle = dev_handle;\n \tdev_flow->handle_idx = handle_idx;\n-\tdev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param);\n+\t/*\n+\t * In some old rdma-core releases, before continuing, a check of the\n+\t * length of matching parameter will be done at first. It needs to use\n+\t * the length without misc4 param. If the flow has misc4 support, then\n+\t * the length needs to be adjusted accordingly. Each param member is\n+\t * aligned with a 64B boundary naturally.\n+\t */\n+\tdev_flow->dv.value.size = MLX5_ST_SZ_BYTES(fte_match_param) -\n+\t\t\t\t  MLX5_ST_SZ_BYTES(fte_match_set_misc4);\n \t/*\n \t * The matching value needs to be cleared to 0 before using. In the\n \t * past, it will be automatically cleared when using rte_*alloc\n@@ -7986,7 +7994,8 @@ struct field_modify_info modify_tcp[] = {\n \tuint64_t priority = attr->priority;\n \tstruct mlx5_flow_dv_matcher matcher = {\n \t\t.mask = {\n-\t\t\t.size = sizeof(matcher.mask.buf),\n+\t\t\t.size = sizeof(matcher.mask.buf) -\n+\t\t\t\tMLX5_ST_SZ_BYTES(fte_match_set_misc4),\n \t\t},\n \t};\n \tint actions_n = 0;\n@@ -8678,6 +8687,10 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t\tNULL,\n \t\t\t\t\t\t\"cannot create eCPRI parser\");\n \t\t\t}\n+\t\t\t/* Adjust the length matcher and device flow value. */\n+\t\t\tmatcher.mask.size = MLX5_ST_SZ_BYTES(fte_match_param);\n+\t\t\tdev_flow->dv.value.size =\n+\t\t\t\t\tMLX5_ST_SZ_BYTES(fte_match_param);\n \t\t\tflow_dv_translate_item_ecpri(dev, match_mask,\n \t\t\t\t\t\t     match_value, items);\n \t\t\t/* No other protocol should follow eCPRI layer. */\n",
    "prefixes": []