get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 67709,
    "url": "http://patches.dpdk.org/api/patches/67709/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200403024353.24681-2-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-2-wei.zhao1@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200403024353.24681-2-wei.zhao1@intel.com",
    "date": "2020-04-03T02:43:41",
    "name": "[v3,01/13] net/ice: enable switch flow on DCF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7ff872bc2bc1b19a98b5065905564cbfcad2afce",
    "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-2-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/67709/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/67709/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 778A6A0562;\n\tFri,  3 Apr 2020 05:05:09 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C29CE1C068;\n\tFri,  3 Apr 2020 05:05:07 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 139A31C05C\n for <dev@dpdk.org>; Fri,  3 Apr 2020 05:05:05 +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:05 -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:03 -0700"
        ],
        "IronPort-SDR": [
            "\n bZK5YUsn/JbjkHRrjlNrJULf50TcVzxUxMRNL65Guqh2dPxcEoRsq9sTxIwXPUTr2+OseFBrQs\n HdEo9qN2A53A==",
            "\n rFSxJJ5OIUNFpSL0+c1Xm1ibhR/Z2+y9Wb26m9yAU3nS4YYCcdQsX+EyKr0daDGgRU9WpdEyTD\n ELmWXBykOnYg=="
        ],
        "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=\"250034399\"",
        "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, Wei Zhao <wei.zhao1@intel.com>",
        "Date": "Fri,  3 Apr 2020 10:43:41 +0800",
        "Message-Id": "<20200403024353.24681-2-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 01/13] net/ice: enable switch flow on DCF",
        "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": "DCF on CVL is a control plane VF which take the responsibility to\nconfigure all the PF/global resources, this patch add support DCF\non to program forward rule to direct packetS to VFs.\n\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\n---\n doc/guides/rel_notes/release_20_05.rst |  2 +-\n drivers/net/ice/ice_dcf_ethdev.c       | 10 +++++--\n drivers/net/ice/ice_dcf_parent.c       |  8 ++++++\n drivers/net/ice/ice_fdir_filter.c      |  6 ++++\n drivers/net/ice/ice_hash.c             |  6 ++++\n drivers/net/ice/ice_switch_filter.c    | 39 +++++++++++++++++++++++++-\n 6 files changed, 67 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst\nindex 9bc647284..bde7e47fb 100644\n--- a/doc/guides/rel_notes/release_20_05.rst\n+++ b/doc/guides/rel_notes/release_20_05.rst\n@@ -68,7 +68,7 @@ New Features\n   Updated the Intel ice driver with new features and improvements, including:\n \n   * Added support for DCF (Device Config Function) feature.\n-\n+  * Added switch filter support for intel DCF.\n \n Removed Items\n -------------\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex af94caeff..e5ba1a61f 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -115,8 +115,8 @@ ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev)\n static int\n ice_dcf_dev_filter_ctrl(struct rte_eth_dev *dev,\n \t\t\tenum rte_filter_type filter_type,\n-\t\t\t__rte_unused enum rte_filter_op filter_op,\n-\t\t\t__rte_unused void *arg)\n+\t\t\tenum rte_filter_op filter_op,\n+\t\t\tvoid *arg)\n {\n \tint ret = 0;\n \n@@ -124,6 +124,12 @@ ice_dcf_dev_filter_ctrl(struct rte_eth_dev *dev,\n \t\treturn -EINVAL;\n \n \tswitch (filter_type) {\n+\tcase RTE_ETH_FILTER_GENERIC:\n+\t\tif (filter_op != RTE_ETH_FILTER_GET)\n+\t\t\treturn -EINVAL;\n+\t\t*(const void **)arg = &ice_flow_ops;\n+\t\tbreak;\n+\n \tdefault:\n \t\tPMD_DRV_LOG(WARNING, \"Filter type (%d) not supported\",\n \t\t\t    filter_type);\ndiff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c\nindex ff08292a1..37f0e2be2 100644\n--- a/drivers/net/ice/ice_dcf_parent.c\n+++ b/drivers/net/ice/ice_dcf_parent.c\n@@ -9,6 +9,7 @@\n #include <rte_spinlock.h>\n \n #include \"ice_dcf_ethdev.h\"\n+#include \"ice_generic_flow.h\"\n \n #define ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL\t100000 /* us */\n static rte_spinlock_t vsi_update_lock = RTE_SPINLOCK_INITIALIZER;\n@@ -321,6 +322,12 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev)\n \t}\n \tparent_adapter->active_pkg_type = ice_load_pkg_type(parent_hw);\n \n+\terr = ice_flow_init(parent_adapter);\n+\tif (err) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to initialize flow\");\n+\t\tgoto uninit_hw;\n+\t}\n+\n \tice_dcf_update_vf_vsi_map(parent_hw, hw->num_vfs, hw->vf_vsi_map);\n \n \tmac = (const struct rte_ether_addr *)hw->avf.mac.addr;\n@@ -347,5 +354,6 @@ ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev)\n \n \teth_dev->data->mac_addrs = NULL;\n \n+\tice_flow_uninit(parent_adapter);\n \tice_dcf_uninit_parent_hw(parent_hw);\n }\ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex a082a13df..1a85d6cc1 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -1061,6 +1061,9 @@ ice_fdir_init(struct ice_adapter *ad)\n \tstruct ice_flow_parser *parser;\n \tint ret;\n \n+\tif (ad->hw.dcf_enabled)\n+\t\treturn 0;\n+\n \tret = ice_fdir_setup(pf);\n \tif (ret)\n \t\treturn ret;\n@@ -1081,6 +1084,9 @@ ice_fdir_uninit(struct ice_adapter *ad)\n \tstruct ice_pf *pf = &ad->pf;\n \tstruct ice_flow_parser *parser;\n \n+\tif (ad->hw.dcf_enabled)\n+\t\treturn;\n+\n \tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n \t\tparser = &ice_fdir_parser_comms;\n \telse\ndiff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex 0fdd4d68d..72c8ddc9a 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -243,6 +243,9 @@ ice_hash_init(struct ice_adapter *ad)\n {\n \tstruct ice_flow_parser *parser = NULL;\n \n+\tif (ad->hw.dcf_enabled)\n+\t\treturn 0;\n+\n \tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n \t\tparser = &ice_hash_parser_os;\n \telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n@@ -565,6 +568,9 @@ ice_hash_destroy(struct ice_adapter *ad,\n static void\n ice_hash_uninit(struct ice_adapter *ad)\n {\n+\tif (ad->hw.dcf_enabled)\n+\t\treturn;\n+\n \tif (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)\n \t\tice_unregister_parser(&ice_hash_parser_os, ad);\n \telse if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\ndiff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c\nindex 66dc158ef..4db8f1471 100644\n--- a/drivers/net/ice/ice_switch_filter.c\n+++ b/drivers/net/ice/ice_switch_filter.c\n@@ -913,6 +913,39 @@ ice_switch_inset_get(const struct rte_flow_item pattern[],\n \treturn 0;\n }\n \n+static int\n+ice_switch_parse_dcf_action(const struct rte_flow_action *actions,\n+\t\t\t    struct rte_flow_error *error,\n+\t\t\t    struct ice_adv_rule_info *rule_info)\n+{\n+\tconst struct rte_flow_action_vf *act_vf;\n+\tconst struct rte_flow_action *action;\n+\tenum rte_flow_action_type action_type;\n+\n+\tfor (action = actions; action->type !=\n+\t\t\t\tRTE_FLOW_ACTION_TYPE_END; action++) {\n+\t\taction_type = action->type;\n+\t\tswitch (action_type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_VF:\n+\t\t\trule_info->sw_act.fltr_act = ICE_FWD_TO_VSI;\n+\t\t\tact_vf = action->conf;\n+\t\t\trule_info->sw_act.vsi_handle = act_vf->id;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\trte_flow_error_set(error,\n+\t\t\t\t\t   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\t\t   actions,\n+\t\t\t\t\t   \"Invalid action type or queue number\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t}\n+\n+\trule_info->sw_act.src = rule_info->sw_act.vsi_handle;\n+\trule_info->rx = 1;\n+\trule_info->priority = 5;\n+\n+\treturn 0;\n+}\n \n static int\n ice_switch_parse_action(struct ice_pf *pf,\n@@ -1081,7 +1114,11 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,\n \t\tgoto error;\n \t}\n \n-\tret = ice_switch_parse_action(pf, actions, error, &rule_info);\n+\tif (ad->hw.dcf_enabled)\n+\t\tret = ice_switch_parse_dcf_action(actions, error, &rule_info);\n+\telse\n+\t\tret = ice_switch_parse_action(pf, actions, error, &rule_info);\n+\n \tif (ret) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n",
    "prefixes": [
        "v3",
        "01/13"
    ]
}