get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1288147,
    "url": "http://patchwork.ozlabs.org/api/patches/1288147/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200512010146.41303-6-anthony.l.nguyen@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200512010146.41303-6-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-05-12T01:01:45",
    "name": "[S42,6/7] ice: Restore filters following reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "ff2b5fbcee91d884c8ae43a86895632854757028",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200512010146.41303-6-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 176248,
            "url": "http://patchwork.ozlabs.org/api/series/176248/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=176248",
            "date": "2020-05-12T01:01:45",
            "name": "[S42,1/7] ice: Initialize Flow Director resources",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/176248/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1288147/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1288147/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49Lfhs1kyCz9sRf\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 12 May 2020 11:04:26 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 67B67875C0;\n\tTue, 12 May 2020 01:04:24 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id hxQsIoDBXZbX; Tue, 12 May 2020 01:04:23 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7D535875C4;\n\tTue, 12 May 2020 01:04:23 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 6BCAC1BF841\n for <intel-wired-lan@lists.osuosl.org>; Tue, 12 May 2020 01:04:22 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id 678F6875C4\n for <intel-wired-lan@lists.osuosl.org>; Tue, 12 May 2020 01:04:22 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 7wKLvkQbc3Un for <intel-wired-lan@lists.osuosl.org>;\n Tue, 12 May 2020 01:04:21 +0000 (UTC)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id 5D819875C0\n for <intel-wired-lan@lists.osuosl.org>; Tue, 12 May 2020 01:04:21 +0000 (UTC)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 May 2020 18:04:20 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga004.jf.intel.com with ESMTP; 11 May 2020 18:04:19 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n Mzj6c7p41/yP0RfFeeHEC+qhU02vHGWF4Wnpkluvx665pN6bSv48WTe56C8GvvtEE7s9e6wLuO\n FKsyPDrGeJGQ==",
            "\n aOSmS/99GBmxJvnR8jdox7e2eTK4yMcLAEGffudkLryeojhio3lJQKrMVw1VS1btDtchrEuhZQ\n Q/u8FKTxqyzg=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,381,1583222400\"; d=\"scan'208\";a=\"409116469\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 11 May 2020 18:01:45 -0700",
        "Message-Id": "<20200512010146.41303-6-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200512010146.41303-1-anthony.l.nguyen@intel.com>",
        "References": "<20200512010146.41303-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S42 6/7] ice: Restore filters following\n reset",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Henry Tieman <henry.w.tieman@intel.com>\n\nFollowing a reset, Flow Director filters are cleared from the hardware.\nRebuild the filters using the software structures containing the filter\nrules.\n\nSigned-off-by: Henry Tieman <henry.w.tieman@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h          |  2 +\n .../net/ethernet/intel/ice/ice_ethtool_fdir.c | 65 +++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_lib.c      | 17 +++--\n drivers/net/ethernet/intel/ice/ice_main.c     | 31 +++++++++\n 4 files changed, 109 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 97f95822fee1..4d011def973a 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -580,6 +580,8 @@ int\n ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd,\n \t\t      u32 *rule_locs);\n void ice_fdir_release_flows(struct ice_hw *hw);\n+void ice_fdir_replay_flows(struct ice_hw *hw);\n+void ice_fdir_replay_fltrs(struct ice_pf *pf);\n int ice_fdir_create_dflt_rules(struct ice_pf *pf);\n int ice_open(struct net_device *netdev);\n int ice_stop(struct net_device *netdev);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c\nindex 223a883f7796..aa353e96b30f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c\n@@ -348,6 +348,53 @@ void ice_fdir_release_flows(struct ice_hw *hw)\n \t\tice_fdir_erase_flow_from_hw(hw, ICE_BLK_FD, flow);\n }\n \n+/**\n+ * ice_fdir_replay_flows - replay HW Flow Director filter info\n+ * @hw: pointer to HW instance\n+ */\n+void ice_fdir_replay_flows(struct ice_hw *hw)\n+{\n+\tint flow;\n+\n+\tfor (flow = 0; flow < ICE_FLTR_PTYPE_MAX; flow++) {\n+\t\tint tun;\n+\n+\t\tif (!hw->fdir_prof[flow] || !hw->fdir_prof[flow]->cnt)\n+\t\t\tcontinue;\n+\t\tfor (tun = 0; tun < ICE_FD_HW_SEG_MAX; tun++) {\n+\t\t\tstruct ice_flow_prof *hw_prof;\n+\t\t\tstruct ice_fd_hw_prof *prof;\n+\t\t\tu64 prof_id;\n+\t\t\tint j;\n+\n+\t\t\tprof = hw->fdir_prof[flow];\n+\t\t\tprof_id = flow + tun * ICE_FLTR_PTYPE_MAX;\n+\t\t\tice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id,\n+\t\t\t\t\t  prof->fdir_seg[tun], TNL_SEG_CNT(tun),\n+\t\t\t\t\t  &hw_prof);\n+\t\t\tfor (j = 0; j < prof->cnt; j++) {\n+\t\t\t\tenum ice_flow_priority prio;\n+\t\t\t\tu64 entry_h = 0;\n+\t\t\t\tint err;\n+\n+\t\t\t\tprio = ICE_FLOW_PRIO_NORMAL;\n+\t\t\t\terr = ice_flow_add_entry(hw, ICE_BLK_FD,\n+\t\t\t\t\t\t\t prof_id,\n+\t\t\t\t\t\t\t prof->vsi_h[0],\n+\t\t\t\t\t\t\t prof->vsi_h[j],\n+\t\t\t\t\t\t\t prio, prof->fdir_seg,\n+\t\t\t\t\t\t\t &entry_h);\n+\t\t\t\tif (err) {\n+\t\t\t\t\tdev_err(ice_hw_to_dev(hw), \"Could not replay Flow Director, flow type %d\\n\",\n+\t\t\t\t\t\tflow);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t\tprof->entry_h[j][tun] = entry_h;\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n /**\n  * ice_parse_rx_flow_user_data - deconstruct user-defined data\n  * @fsp: pointer to ethtool Rx flow specification\n@@ -1225,6 +1272,24 @@ ice_fdir_write_all_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input,\n \treturn 0;\n }\n \n+/**\n+ * ice_fdir_replay_fltrs - replay filters from the HW filter list\n+ * @pf: board private structure\n+ */\n+void ice_fdir_replay_fltrs(struct ice_pf *pf)\n+{\n+\tstruct ice_fdir_fltr *f_rule;\n+\tstruct ice_hw *hw = &pf->hw;\n+\n+\tlist_for_each_entry(f_rule, &hw->fdir_list_head, fltr_node) {\n+\t\tint err = ice_fdir_write_all_fltr(pf, f_rule, true);\n+\n+\t\tif (err)\n+\t\t\tdev_dbg(ice_pf_to_dev(pf), \"Flow Director error %d, could not reprogram filter %d\\n\",\n+\t\t\t\terr, f_rule->fltr_id);\n+\t}\n+}\n+\n /**\n  * ice_fdir_create_dflt_rules - create default perfect filters\n  * @pf: PF data structure\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 7649ff2bf3e1..2bc260092f47 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2798,6 +2798,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n \t\tgoto err_vsi;\n \n \tice_vsi_get_qs(vsi);\n+\n+\tice_alloc_fd_res(vsi);\n \tice_vsi_set_tc_cfg(vsi);\n \n \t/* Initialize VSI struct elements and create VSI in FW */\n@@ -2806,6 +2808,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n \t\tgoto err_vsi;\n \n \tswitch (vsi->type) {\n+\tcase ICE_VSI_CTRL:\n \tcase ICE_VSI_PF:\n \t\tret = ice_vsi_alloc_q_vectors(vsi);\n \t\tif (ret)\n@@ -2830,12 +2833,14 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)\n \t\t\tif (ret)\n \t\t\t\tgoto err_vectors;\n \t\t}\n-\t\t/* Do not exit if configuring RSS had an issue, at least\n-\t\t * receive traffic on first queue. Hence no need to capture\n-\t\t * return value\n-\t\t */\n-\t\tif (test_bit(ICE_FLAG_RSS_ENA, pf->flags))\n-\t\t\tice_vsi_cfg_rss_lut_key(vsi);\n+\t\t/* ICE_VSI_CTRL does not need RSS so skip RSS processing */\n+\t\tif (vsi->type != ICE_VSI_CTRL)\n+\t\t\t/* Do not exit if configuring RSS had an issue, at\n+\t\t\t * least receive traffic on first queue. Hence no\n+\t\t\t * need to capture return value\n+\t\t\t */\n+\t\t\tif (test_bit(ICE_FLAG_RSS_ENA, pf->flags))\n+\t\t\t\tice_vsi_cfg_rss_lut_key(vsi);\n \t\tbreak;\n \tcase ICE_VSI_VF:\n \t\tret = ice_vsi_alloc_q_vectors(vsi);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex bf7d070eaba1..0eca14a1702e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -4957,6 +4957,21 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n \t\tgoto err_sched_init_port;\n \t}\n \n+\tif (test_bit(ICE_FLAG_FD_ENA, pf->flags)) {\n+\t\twr32(hw, PFQF_FD_ENA, PFQF_FD_ENA_FD_ENA_M);\n+\t\tif (!rd32(hw, PFQF_FD_SIZE)) {\n+\t\t\tu16 unused, guar, b_effort;\n+\n+\t\t\tguar = hw->func_caps.fd_fltr_guar;\n+\t\t\tb_effort = hw->func_caps.fd_fltr_best_effort;\n+\n+\t\t\t/* force guaranteed filter pool for PF */\n+\t\t\tice_alloc_fd_guar_item(hw, &unused, guar);\n+\t\t\t/* force shared filter pool for PF */\n+\t\t\tice_alloc_fd_shrd_item(hw, &unused, b_effort);\n+\t\t}\n+\t}\n+\n \tif (test_bit(ICE_FLAG_DCB_ENA, pf->flags))\n \t\tice_dcb_rebuild(pf);\n \n@@ -4983,6 +4998,22 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n \t\t}\n \t}\n \n+\t/* If Flow Director is active */\n+\tif (test_bit(ICE_FLAG_FD_ENA, pf->flags)) {\n+\t\terr = ice_vsi_rebuild_by_type(pf, ICE_VSI_CTRL);\n+\t\tif (err) {\n+\t\t\tdev_err(dev, \"control VSI rebuild failed: %d\\n\", err);\n+\t\t\tgoto err_vsi_rebuild;\n+\t\t}\n+\n+\t\t/* replay HW Flow Director recipes */\n+\t\tif (hw->fdir_prof)\n+\t\t\tice_fdir_replay_flows(hw);\n+\n+\t\t/* replay Flow Director filters */\n+\t\tice_fdir_replay_fltrs(pf);\n+\t}\n+\n \tice_update_pf_netdev_link(pf);\n \n \t/* tell the firmware we are up */\n",
    "prefixes": [
        "S42",
        "6/7"
    ]
}