get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 67720,
    "url": "http://patches.dpdk.org/api/patches/67720/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200403024353.24681-13-wei.zhao1@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": "<20200403024353.24681-13-wei.zhao1@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200403024353.24681-13-wei.zhao1@intel.com",
    "date": "2020-04-03T02:43:52",
    "name": "[v3,12/13] net/ice: enable flow redirect on switch",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "52142b45917d4bbd677ee8b05a82ea4707db6d7d",
    "submitter": {
        "id": 495,
        "url": "http://patches.dpdk.org/api/people/495/?format=api",
        "name": "Zhao1, Wei",
        "email": "wei.zhao1@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200403024353.24681-13-wei.zhao1@intel.com/mbox/",
    "series": [
        {
            "id": 9180,
            "url": "http://patches.dpdk.org/api/series/9180/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9180",
            "date": "2020-04-03T02:43:40",
            "name": "add switch filter support for intel DCF",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/9180/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/67720/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/67720/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 91F37A0562;\n\tFri,  3 Apr 2020 05:07:04 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 07E061C134;\n\tFri,  3 Apr 2020 05:05:30 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id A84A81C0DC\n for <dev@dpdk.org>; Fri,  3 Apr 2020 05:05:28 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Apr 2020 20:05:28 -0700",
            "from unknown (HELO localhost.localdomain.bj.intel.com)\n ([172.16.182.123])\n by orsmga003.jf.intel.com with ESMTP; 02 Apr 2020 20:05:26 -0700"
        ],
        "IronPort-SDR": [
            "\n Ailoc1fOVRA557by2bn1NY1Wgt051qCxk3vBp8Wrczr0qVRo8ZcN5clOqYAiIQDf3s7O8nAauI\n 3HjHPJUX5kHw==",
            "\n wfkx8qqfEyJ0CzImockAJyj26kkPYtQpkpE+oCifHKKMRcE3EzdOLqV/1k/FM6tlaWyHVAk2OF\n KwkQwKUDLtUQ=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.72,337,1580803200\"; d=\"scan'208\";a=\"250034503\"",
        "From": "Wei Zhao <wei.zhao1@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com, nannan.lu@intel.com, qi.fu@intel.com,\n yuan.peng@intel.com, Beilei Xing <beilei.xing@intel.com>",
        "Date": "Fri,  3 Apr 2020 10:43:52 +0800",
        "Message-Id": "<20200403024353.24681-13-wei.zhao1@intel.com>",
        "X-Mailer": "git-send-email 2.19.1",
        "In-Reply-To": "<20200403024353.24681-1-wei.zhao1@intel.com>",
        "References": "<20200402064620.47668-1-wei.zhao1@intel.com>\n <20200403024353.24681-1-wei.zhao1@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 12/13] net/ice: enable flow redirect on switch",
        "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": "Enable flow redirect on switch, currently only\nsupport VSI redirect.\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n drivers/net/ice/ice_switch_filter.c | 73 +++++++++++++++++++++++++++++\n 1 file changed, 73 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c\nindex 686f9c3e3..55a5618a7 100644\n--- a/drivers/net/ice/ice_switch_filter.c\n+++ b/drivers/net/ice/ice_switch_filter.c\n@@ -1420,6 +1420,78 @@ ice_switch_query(struct ice_adapter *ad __rte_unused,\n \treturn -rte_errno;\n }\n \n+static int\n+ice_switch_redirect(struct ice_adapter *ad,\n+\t\t    struct rte_flow *flow,\n+\t\t    struct ice_flow_redirect *rd)\n+{\n+\tstruct ice_rule_query_data *rdata = flow->rule;\n+\tstruct ice_adv_fltr_mgmt_list_entry *list_itr;\n+\tstruct ice_adv_lkup_elem *lkups_dp = NULL;\n+\tstruct LIST_HEAD_TYPE *list_head;\n+\tstruct ice_adv_rule_info rinfo;\n+\tstruct ice_hw *hw = &ad->hw;\n+\tstruct ice_switch_info *sw;\n+\tuint16_t lkups_cnt;\n+\tint ret;\n+\n+\tsw = hw->switch_info;\n+\tif (!sw->recp_list[rdata->rid].recp_created)\n+\t\treturn -EINVAL;\n+\n+\tif (rd->type != ICE_FLOW_REDIRECT_VSI)\n+\t\treturn -ENOTSUP;\n+\n+\tlist_head = &sw->recp_list[rdata->rid].filt_rules;\n+\tLIST_FOR_EACH_ENTRY(list_itr, list_head, ice_adv_fltr_mgmt_list_entry,\n+\t\t\t    list_entry) {\n+\t\trinfo = list_itr->rule_info;\n+\t\tif (rinfo.fltr_rule_id == rdata->rule_id &&\n+\t\t    rinfo.sw_act.fltr_act == ICE_FWD_TO_VSI &&\n+\t\t    rinfo.sw_act.vsi_handle == rd->vsi_handle) {\n+\t\t\tlkups_cnt = list_itr->lkups_cnt;\n+\t\t\tlkups_dp = (struct ice_adv_lkup_elem *)\n+\t\t\t\tice_memdup(hw, list_itr->lkups,\n+\t\t\t\t\t   sizeof(*list_itr->lkups) *\n+\t\t\t\t\t   lkups_cnt, ICE_NONDMA_TO_NONDMA);\n+\t\t\tif (!lkups_dp) {\n+\t\t\t\tPMD_DRV_LOG(ERR, \"Failed to allocate memory.\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tif (!lkups_dp)\n+\t\treturn 0;\n+\n+\t/* Remove the old rule */\n+\tret = ice_rem_adv_rule(hw, list_itr->lkups,\n+\t\t\t       lkups_cnt, &rinfo);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to delete the old rule %d\",\n+\t\t\t    rdata->rule_id);\n+\t\tret = -EINVAL;\n+\t\tgoto out;\n+\t}\n+\n+\t/* Update VSI context */\n+\thw->vsi_ctx[rd->vsi_handle]->vsi_num = rd->new_vsi_num;\n+\n+\t/* Replay the rule */\n+\tret = ice_add_adv_rule(hw, lkups_dp, lkups_cnt,\n+\t\t\t       &rinfo, rdata);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to replay the rule\");\n+\t\tret = -EINVAL;\n+\t}\n+\n+out:\n+\tice_free(hw, lkups_dp);\n+\treturn ret;\n+}\n+\n static int\n ice_switch_init(struct ice_adapter *ad)\n {\n@@ -1465,6 +1537,7 @@ ice_flow_engine ice_switch_engine = {\n \t.create = ice_switch_create,\n \t.destroy = ice_switch_destroy,\n \t.query_count = ice_switch_query,\n+\t.redirect = ice_switch_redirect,\n \t.free = ice_switch_filter_rule_free,\n \t.type = ICE_FLOW_ENGINE_SWITCH,\n };\n",
    "prefixes": [
        "v3",
        "12/13"
    ]
}