get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71015,
    "url": "https://patches.dpdk.org/api/patches/71015/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200609120001.35110-9-qi.z.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20200609120001.35110-9-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200609120001.35110-9-qi.z.zhang@intel.com",
    "date": "2020-06-09T11:59:17",
    "name": "[v2,08/52] net/ice/base: improve VSI filters rebuild",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cd76b17540c8a5171024b139e039aab0e36635ed",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "https://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200609120001.35110-9-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 10359,
            "url": "https://patches.dpdk.org/api/series/10359/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10359",
            "date": "2020-06-09T11:59:09",
            "name": "net/ice: base code update",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10359/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/71015/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/71015/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 738C4A0516;\n\tTue,  9 Jun 2020 13:57:20 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 61BA72C57;\n\tTue,  9 Jun 2020 13:56:21 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id B1FA9288C\n for <dev@dpdk.org>; Tue,  9 Jun 2020 13:56:19 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jun 2020 04:56:19 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.82])\n by fmsmga005.fm.intel.com with ESMTP; 09 Jun 2020 04:56:17 -0700"
        ],
        "IronPort-SDR": [
            "\n UQP7THDe2yvA1ZtO2E8yk8M+eC3/aoHjG5bGrKYVeKF1jFdlbVPVhAWAFJDQDPXBOy6aRYmPS4\n CmkkX6sAvCow==",
            "\n 20iBsv7p1976mN47JdyJYMaxc1dVqmRNBW3b4xC+Knrv2z0JlWWPn5wESZZTRkWDcKSglr17vR\n oKmEggaPEYjg=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,491,1583222400\"; d=\"scan'208\";a=\"473043978\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Grzegorz Nitka <grzegorz.nitka@intel.com>,\n \"Paul M . Stillwell Jr\" <paul.m.stillwell.jr@intel.com>",
        "Date": "Tue,  9 Jun 2020 19:59:17 +0800",
        "Message-Id": "<20200609120001.35110-9-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200609120001.35110-1-qi.z.zhang@intel.com>",
        "References": "<20200603024016.30636-1-qi.z.zhang@intel.com>\n <20200609120001.35110-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 08/52] net/ice/base: improve VSI filters\n\trebuild",
        "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": "This change improve VSI filter configuration rebuild for\nmultiport configuration, ie. where 1 PF includes more than\none logical port. For some functions, association between\nport and corresponding switch_info or port_info structure\nhas been lost because by default the pointer to the first\nelement of array (switch, port etc.) is passed as function\nargument. With this change, pointer to proper element is\nadded an extra argument in relevant functions.\n\nSigned-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>\nSigned-off-by: Paul M. Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 59 +++++++++++++++++++++++++++++++--------\n drivers/net/ice/base/ice_switch.c | 38 ++++++++++++++++++-------\n drivers/net/ice/base/ice_switch.h |  5 +++-\n 3 files changed, 79 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 499653c21..aab560504 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -493,6 +493,7 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd)\n enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)\n {\n \tstruct ice_switch_info *sw;\n+\tenum ice_status status;\n \n \thw->switch_info = (struct ice_switch_info *)\n \t\t\t  ice_malloc(hw, sizeof(*hw->switch_info));\n@@ -504,27 +505,36 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)\n \n \tINIT_LIST_HEAD(&sw->vsi_list_map_head);\n \n-\treturn ice_init_def_sw_recp(hw, &hw->switch_info->recp_list);\n+\tstatus = ice_init_def_sw_recp(hw, &hw->switch_info->recp_list);\n+\tif (status) {\n+\t\tice_free(hw, hw->switch_info);\n+\t\treturn status;\n+\t}\n+\treturn ICE_SUCCESS;\n }\n \n /**\n- * ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks\n+ * ice_cleanup_fltr_mgmt_single - clears single filter mngt struct\n  * @hw: pointer to the HW struct\n+ * @sw: pointer to switch info struct for which function clears filters\n  */\n-void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)\n+static void\n+ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tstruct ice_vsi_list_map_info *v_pos_map;\n \tstruct ice_vsi_list_map_info *v_tmp_map;\n \tstruct ice_sw_recipe *recps;\n \tu8 i;\n \n+\tif (!sw)\n+\t\treturn;\n+\n \tLIST_FOR_EACH_ENTRY_SAFE(v_pos_map, v_tmp_map, &sw->vsi_list_map_head,\n \t\t\t\t ice_vsi_list_map_info, list_entry) {\n \t\tLIST_DEL(&v_pos_map->list_entry);\n \t\tice_free(hw, v_pos_map);\n \t}\n-\trecps = hw->switch_info->recp_list;\n+\trecps = sw->recp_list;\n \tfor (i = 0; i < ICE_MAX_NUM_RECIPES; i++) {\n \t\tstruct ice_recp_grp_entry *rg_entry, *tmprg_entry;\n \n@@ -564,12 +574,21 @@ void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)\n \t\tif (recps[i].root_buf)\n \t\t\tice_free(hw, recps[i].root_buf);\n \t}\n-\tice_rm_all_sw_replay_rule_info(hw);\n+\tice_rm_sw_replay_rule_info(hw, sw);\n \tice_free(hw, sw->recp_list);\n \tice_free(hw, sw);\n }\n \n /**\n+ * ice_cleanup_all_fltr_mgmt - cleanup filter management list and locks\n+ * @hw: pointer to the HW struct\n+ */\n+void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)\n+{\n+\tice_cleanup_fltr_mgmt_single(hw, hw->switch_info);\n+}\n+\n+/**\n  * ice_get_itr_intrl_gran\n  * @hw: pointer to the HW struct\n  *\n@@ -4104,18 +4123,32 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u16 tc_bitmap,\n }\n \n /**\n+ * ice_is_main_vsi - checks whether the VSI is main VSI\n+ * @hw: pointer to the HW struct\n+ * @vsi_handle: VSI handle\n+ *\n+ * Checks whether the VSI is the main VSI (the first PF VSI created on\n+ * given PF).\n+ */\n+static bool ice_is_main_vsi(struct ice_hw *hw, u16 vsi_handle)\n+{\n+\treturn vsi_handle == ICE_MAIN_VSI_HANDLE && hw->vsi_ctx[vsi_handle];\n+}\n+\n+/**\n  * ice_replay_pre_init - replay pre initialization\n  * @hw: pointer to the HW struct\n+ * @sw: pointer to switch info struct for which function initializes filters\n  *\n  * Initializes required config data for VSI, FD, ACL, and RSS before replay.\n  */\n-static enum ice_status ice_replay_pre_init(struct ice_hw *hw)\n+static enum ice_status\n+ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tu8 i;\n \n \t/* Delete old entries from replay filter list head if there is any */\n-\tice_rm_all_sw_replay_rule_info(hw);\n+\tice_rm_sw_replay_rule_info(hw, sw);\n \t/* In start of replay, move entries into replay_rules list, it\n \t * will allow adding rules entries back to filt_rules list,\n \t * which is operational list.\n@@ -4138,14 +4171,16 @@ static enum ice_status ice_replay_pre_init(struct ice_hw *hw)\n  */\n enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle)\n {\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tstruct ice_port_info *pi = hw->port_info;\n \tenum ice_status status;\n \n \tif (!ice_is_vsi_valid(hw, vsi_handle))\n \t\treturn ICE_ERR_PARAM;\n \n \t/* Replay pre-initialization if there is any */\n-\tif (vsi_handle == ICE_MAIN_VSI_HANDLE) {\n-\t\tstatus = ice_replay_pre_init(hw);\n+\tif (ice_is_main_vsi(hw, vsi_handle)) {\n+\t\tstatus = ice_replay_pre_init(hw, sw);\n \t\tif (status)\n \t\t\treturn status;\n \t}\n@@ -4154,7 +4189,7 @@ enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle)\n \tif (status)\n \t\treturn status;\n \t/* Replay per VSI all filters */\n-\tstatus = ice_replay_vsi_all_fltr(hw, vsi_handle);\n+\tstatus = ice_replay_vsi_all_fltr(hw, pi, vsi_handle);\n \tif (!status)\n \t\tstatus = ice_replay_vsi_agg(hw, vsi_handle);\n \treturn status;\ndiff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex 5b968b7ce..910fb5236 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -7460,6 +7460,8 @@ enum ice_status ice_replay_all_fltr(struct ice_hw *hw)\n /**\n  * ice_replay_vsi_fltr - Replay filters for requested VSI\n  * @hw: pointer to the hardware structure\n+ * @pi: pointer to port information structure\n+ * @sw: pointer to switch info struct for which function replays filters\n  * @vsi_handle: driver VSI handle\n  * @recp_id: Recipe ID for which rules need to be replayed\n  * @list_head: list for which filters need to be replayed\n@@ -7468,7 +7470,8 @@ enum ice_status ice_replay_all_fltr(struct ice_hw *hw)\n  * It is required to pass valid VSI handle.\n  */\n static enum ice_status\n-ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n+ice_replay_vsi_fltr(struct ice_hw *hw, struct ice_port_info *pi,\n+\t\t    struct ice_switch_info *sw, u16 vsi_handle, u8 recp_id,\n \t\t    struct LIST_HEAD_TYPE *list_head)\n {\n \tstruct ice_fltr_mgmt_list_entry *itr;\n@@ -7478,7 +7481,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n \n \tif (LIST_EMPTY(list_head))\n \t\treturn status;\n-\trecp_list = &hw->switch_info->recp_list[recp_id];\n+\trecp_list = &sw->recp_list[recp_id];\n \thw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);\n \n \tLIST_FOR_EACH_ENTRY(itr, list_head, ice_fltr_mgmt_list_entry,\n@@ -7492,7 +7495,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n \t\t\tif (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI)\n \t\t\t\tf_entry.fltr_info.src = hw_vsi_id;\n \t\t\tstatus = ice_add_rule_internal(hw, recp_list,\n-\t\t\t\t\t\t       hw->port_info->lport,\n+\t\t\t\t\t\t       pi->lport,\n \t\t\t\t\t\t       &f_entry);\n \t\t\tif (status != ICE_SUCCESS)\n \t\t\t\tgoto end;\n@@ -7512,7 +7515,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,\n \t\t\tstatus = ice_add_vlan_internal(hw, recp_list, &f_entry);\n \t\telse\n \t\t\tstatus = ice_add_rule_internal(hw, recp_list,\n-\t\t\t\t\t\t       hw->port_info->lport,\n+\t\t\t\t\t\t       pi->lport,\n \t\t\t\t\t\t       &f_entry);\n \t\tif (status != ICE_SUCCESS)\n \t\t\tgoto end;\n@@ -7557,11 +7560,14 @@ ice_replay_vsi_adv_rule(struct ice_hw *hw, u16 vsi_handle,\n /**\n  * ice_replay_vsi_all_fltr - replay all filters stored in bookkeeping lists\n  * @hw: pointer to the hardware structure\n+ * @pi: pointer to port information structure\n  * @vsi_handle: driver VSI handle\n  *\n  * Replays filters for requested VSI via vsi_handle.\n  */\n-enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle)\n+enum ice_status\n+ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi,\n+\t\t\tu16 vsi_handle)\n {\n \tstruct ice_switch_info *sw = hw->switch_info;\n \tenum ice_status status;\n@@ -7573,7 +7579,8 @@ enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle)\n \n \t\thead = &sw->recp_list[i].filt_replay_rules;\n \t\tif (!sw->recp_list[i].adv_rule)\n-\t\t\tstatus = ice_replay_vsi_fltr(hw, vsi_handle, i, head);\n+\t\t\tstatus = ice_replay_vsi_fltr(hw, pi, sw, vsi_handle, i,\n+\t\t\t\t\t\t     head);\n \t\telse\n \t\t\tstatus = ice_replay_vsi_adv_rule(hw, vsi_handle, head);\n \t\tif (status != ICE_SUCCESS)\n@@ -7584,14 +7591,14 @@ enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle)\n }\n \n /**\n- * ice_rm_all_sw_replay_rule_info - deletes filter replay rules\n+ * ice_rm_all_sw_replay_rule - helper function to delete filter replay rules\n  * @hw: pointer to the HW struct\n+ * @sw: pointer to switch info struct for which function removes filters\n  *\n- * Deletes the filter replay rules.\n+ * Deletes the filter replay rules for given switch\n  */\n-void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw)\n+void ice_rm_sw_replay_rule_info(struct ice_hw *hw, struct ice_switch_info *sw)\n {\n-\tstruct ice_switch_info *sw = hw->switch_info;\n \tu8 i;\n \n \tif (!sw)\n@@ -7609,3 +7616,14 @@ void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw)\n \t\t}\n \t}\n }\n+\n+/**\n+ * ice_rm_all_sw_replay_rule_info - deletes filter replay rules\n+ * @hw: pointer to the HW struct\n+ *\n+ * Deletes the filter replay rules.\n+ */\n+void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw)\n+{\n+\tice_rm_sw_replay_rule_info(hw, hw->switch_info);\n+}\ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex 6bd50518f..ba7c56f44 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -485,7 +485,10 @@ ice_init_def_sw_recp(struct ice_hw *hw, struct ice_sw_recipe **recp_list);\n u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle);\n bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle);\n \n-enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle);\n+enum ice_status\n+ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi,\n+\t\t\tu16 vsi_handle);\n+void ice_rm_sw_replay_rule_info(struct ice_hw *hw, struct ice_switch_info *sw);\n void ice_rm_all_sw_replay_rule_info(struct ice_hw *hw);\n bool ice_is_prof_rule(enum ice_sw_tunnel_type type);\n \n",
    "prefixes": [
        "v2",
        "08/52"
    ]
}