get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77672,
    "url": "http://patches.dpdk.org/api/patches/77672/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200915052702.3194061-3-zhirun.yan@intel.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": "<20200915052702.3194061-3-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200915052702.3194061-3-zhirun.yan@intel.com",
    "date": "2020-09-15T05:27:02",
    "name": "[v3,2/2] net/ice: merge inner/outer flow seg info for FDIR",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "cb09c28aa1333f92d2d52520f778597a9085c41e",
    "submitter": {
        "id": 1154,
        "url": "http://patches.dpdk.org/api/people/1154/?format=api",
        "name": "Yan, Zhirun",
        "email": "zhirun.yan@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200915052702.3194061-3-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 12215,
            "url": "http://patches.dpdk.org/api/series/12215/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12215",
            "date": "2020-09-15T05:27:00",
            "name": "refactor and clean FDIR",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/12215/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77672/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/77672/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 54B5DA04C7;\n\tTue, 15 Sep 2020 07:31:04 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 358E51C0D0;\n\tTue, 15 Sep 2020 07:30:54 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id 47C561C0C6\n for <dev@dpdk.org>; Tue, 15 Sep 2020 07:30:50 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Sep 2020 22:30:49 -0700",
            "from dpdk-zhirun-dev.sh.intel.com ([10.67.118.201])\n by orsmga005.jf.intel.com with ESMTP; 14 Sep 2020 22:30:47 -0700"
        ],
        "IronPort-SDR": [
            "\n pdQO4p6AV5fzcvw8x+MA/695egHA3r3ysh41bfd8vL1WVTtL1ipEVOmMpk0/hy7fIoW4QQjMkP\n kOsfSQtktHlw==",
            "\n AYMq8S4oQioMyjV6isPW1s3ElGHWACyCv3QDoN23j6Hr+dMmfLWdNpSP+k1mlMzf2CNIQ2CDYE\n TcRMM+gj/klA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9744\"; a=\"244034965\"",
            "E=Sophos;i=\"5.76,428,1592895600\"; d=\"scan'208\";a=\"244034965\"",
            "E=Sophos;i=\"5.76,428,1592895600\"; d=\"scan'208\";a=\"482623829\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Zhirun Yan <zhirun.yan@intel.com>",
        "To": "qi.z.zhang@intel.com,\n\tdev@dpdk.org",
        "Cc": "yahui.cao@intel.com, xiao.w.wang@intel.com, simei.su@intel.com,\n junfeng.guo@intel.com, Zhirun Yan <zhirun.yan@intel.com>",
        "Date": "Tue, 15 Sep 2020 13:27:02 +0800",
        "Message-Id": "<20200915052702.3194061-3-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200915052702.3194061-1-zhirun.yan@intel.com>",
        "References": "<20200908073939.4099976-1-zhirun.yan@intel.com>\n <20200915052702.3194061-1-zhirun.yan@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/2] net/ice: merge inner/outer flow seg info\n\tfor FDIR",
        "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": "For tunnel and non-tunnel packets, it can share the same seg_tun info.\nseg_tun[1] can be used for supporting inner fields with tunnel flow rule\nor for non-tunnel packets, seg_tun[0] only used for tunnel outer part.\nAdd outer_input_set to distinguish inner/outer input set. So we can\nidentify different fields in outer or inner part.\n\nSigned-off-by: Zhirun Yan <zhirun.yan@intel.com>\n---\n drivers/net/ice/ice_ethdev.h      |  1 +\n drivers/net/ice/ice_fdir_filter.c | 59 ++++++++++++++++---------------\n 2 files changed, 31 insertions(+), 29 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex 758caa8b4..243a023e6 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -287,6 +287,7 @@ struct ice_fdir_filter_conf {\n \tstruct rte_flow_action_count act_count;\n \n \tuint64_t input_set;\n+\tuint64_t outer_input_set; /* only for tunnel packets outer fields */\n };\n \n #define ICE_MAX_FDIR_FILTER_NUM\t\t(1024 * 16)\ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex a65523781..e0ce1efb0 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -1021,51 +1021,53 @@ ice_fdir_input_set_hdrs(enum ice_fltr_ptype flow, struct ice_flow_seg_info *seg)\n \n static int\n ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,\n-\t\t\tuint64_t input_set, enum ice_fdir_tunnel_type ttype)\n+\t\t\tuint64_t inner_input_set, uint64_t outer_input_set,\n+\t\t\tenum ice_fdir_tunnel_type ttype)\n {\n \tstruct ice_flow_seg_info *seg;\n \tstruct ice_flow_seg_info *seg_tun = NULL;\n \tenum ice_flow_field field[ICE_FLOW_FIELD_IDX_MAX];\n+\tuint64_t input_set;\n \tbool is_tunnel;\n-\tint i, ret;\n+\tint k, i, ret = 0;\n \n-\tif (!input_set)\n+\tif (!(inner_input_set | outer_input_set))\n \t\treturn -EINVAL;\n \n-\tseg = (struct ice_flow_seg_info *)\n-\t\tice_malloc(hw, sizeof(*seg));\n-\tif (!seg) {\n+\tseg_tun = (struct ice_flow_seg_info *)\n+\t\tice_malloc(hw, sizeof(*seg_tun) * ICE_FD_HW_SEG_MAX);\n+\tif (!seg_tun) {\n \t\tPMD_DRV_LOG(ERR, \"No memory can be allocated\");\n \t\treturn -ENOMEM;\n \t}\n \n-\tfor (i = 0; i < ICE_FLOW_FIELD_IDX_MAX; i++)\n-\t\tfield[i] = ICE_FLOW_FIELD_IDX_MAX;\n+\t/* use seg_tun[1] to record tunnel inner part or non-tunnel */\n+\tfor (k = 0; k <= ICE_FD_HW_SEG_TUN; k++) {\n+\t\tseg = &seg_tun[k];\n+\t\tinput_set = (k == ICE_FD_HW_SEG_TUN) ? inner_input_set : outer_input_set;\n+\t\tif (input_set == 0)\n+\t\t\tcontinue;\n+\n+\t\tfor (i = 0; i < ICE_FLOW_FIELD_IDX_MAX; i++)\n+\t\t\tfield[i] = ICE_FLOW_FIELD_IDX_MAX;\n \n-\tice_fdir_input_set_parse(input_set, field);\n+\t\tice_fdir_input_set_parse(input_set, field);\n \n-\tice_fdir_input_set_hdrs(flow, seg);\n+\t\tice_fdir_input_set_hdrs(flow, seg);\n \n-\tfor (i = 0; field[i] != ICE_FLOW_FIELD_IDX_MAX; i++) {\n-\t\tice_flow_set_fld(seg, field[i],\n-\t\t\t\t ICE_FLOW_FLD_OFF_INVAL,\n-\t\t\t\t ICE_FLOW_FLD_OFF_INVAL,\n-\t\t\t\t ICE_FLOW_FLD_OFF_INVAL, false);\n+\t\tfor (i = 0; field[i] != ICE_FLOW_FIELD_IDX_MAX; i++) {\n+\t\t\tice_flow_set_fld(seg, field[i],\n+\t\t\t\t\t ICE_FLOW_FLD_OFF_INVAL,\n+\t\t\t\t\t ICE_FLOW_FLD_OFF_INVAL,\n+\t\t\t\t\t ICE_FLOW_FLD_OFF_INVAL, false);\n+\t\t}\n \t}\n \n \tis_tunnel = ice_fdir_is_tunnel_profile(ttype);\n \tif (!is_tunnel) {\n \t\tret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi,\n-\t\t\t\t\t   seg, flow, false);\n+\t\t\t\t\t   seg_tun + 1, flow, false);\n \t} else {\n-\t\tseg_tun = (struct ice_flow_seg_info *)\n-\t\t\tice_malloc(hw, sizeof(*seg) * ICE_FD_HW_SEG_MAX);\n-\t\tif (!seg_tun) {\n-\t\t\tPMD_DRV_LOG(ERR, \"No memory can be allocated\");\n-\t\t\trte_free(seg);\n-\t\t\treturn -ENOMEM;\n-\t\t}\n-\t\trte_memcpy(&seg_tun[1], seg, sizeof(*seg));\n \t\tret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi,\n \t\t\t\t\t   seg_tun, flow, true);\n \t}\n@@ -1073,9 +1075,7 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,\n \tif (!ret) {\n \t\treturn ret;\n \t} else if (ret < 0) {\n-\t\trte_free(seg);\n-\t\tif (is_tunnel)\n-\t\t\trte_free(seg_tun);\n+\t\trte_free(seg_tun);\n \t\treturn (ret == -EEXIST) ? 0 : ret;\n \t} else {\n \t\treturn ret;\n@@ -1285,7 +1285,8 @@ ice_fdir_create_filter(struct ice_adapter *ad,\n \tis_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type);\n \n \tret = ice_fdir_input_set_conf(pf, filter->input.flow_type,\n-\t\t\tfilter->input_set, filter->tunnel_type);\n+\t\t\t\t      filter->input_set, filter->outer_input_set,\n+\t\t\t\t      filter->tunnel_type);\n \tif (ret) {\n \t\trte_flow_error_set(error, -ret,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n@@ -2038,7 +2039,7 @@ ice_fdir_parse(struct ice_adapter *ad,\n \tret = ice_fdir_parse_pattern(ad, pattern, error, filter);\n \tif (ret)\n \t\tgoto error;\n-\tinput_set = filter->input_set;\n+\tinput_set = filter->input_set | filter->outer_input_set;\n \tif (!input_set || input_set & ~item->input_set_mask) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM_SPEC,\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}