Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/54685/?format=api
http://patches.dpdk.org/api/patches/54685/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190611155221.2703-27-leyi.rong@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": "<20190611155221.2703-27-leyi.rong@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190611155221.2703-27-leyi.rong@intel.com", "date": "2019-06-11T15:51:41", "name": "[v2,26/66] net/ice/base: forbid VSI to remove unassociated ucast filter", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ab6387edeaf459969c09faedbeb090559a5c068c", "submitter": { "id": 1204, "url": "http://patches.dpdk.org/api/people/1204/?format=api", "name": "Leyi Rong", "email": "leyi.rong@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/20190611155221.2703-27-leyi.rong@intel.com/mbox/", "series": [ { "id": 4981, "url": "http://patches.dpdk.org/api/series/4981/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4981", "date": "2019-06-11T15:51:15", "name": "shared code update", "version": 2, "mbox": "http://patches.dpdk.org/series/4981/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/54685/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/54685/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B222C1C545;\n\tTue, 11 Jun 2019 17:54:44 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id A9FD91C4CB\n\tfor <dev@dpdk.org>; Tue, 11 Jun 2019 17:54:10 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jun 2019 08:54:10 -0700", "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Jun 2019 08:54:09 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Leyi Rong <leyi.rong@intel.com>", "To": "qi.z.zhang@intel.com", "Cc": "dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>,\n\tAkeem G Abodunrin <akeem.g.abodunrin@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>", "Date": "Tue, 11 Jun 2019 23:51:41 +0800", "Message-Id": "<20190611155221.2703-27-leyi.rong@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190611155221.2703-1-leyi.rong@intel.com>", "References": "<20190604054248.68510-1-leyi.rong@intel.com>\n\t<20190611155221.2703-1-leyi.rong@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 26/66] net/ice/base: forbid VSI to remove\n\tunassociated ucast filter", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "If a VSI is not using a unicast filter or did not configure that\nparticular unicast filter, driver should not allow it to be removed\nby the rogue VSI.\n\nSigned-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\n---\n drivers/net/ice/base/ice_switch.c | 57 +++++++++++++++++++++++++++++++\n 1 file changed, 57 insertions(+)", "diff": "diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex 7cccaf4d3..faaedd4c8 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -3180,6 +3180,39 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set,\n \treturn status;\n }\n \n+/**\n+ * ice_find_ucast_rule_entry - Search for a unicast MAC filter rule entry\n+ * @hw: pointer to the hardware structure\n+ * @recp_id: lookup type for which the specified rule needs to be searched\n+ * @f_info: rule information\n+ *\n+ * Helper function to search for a unicast rule entry - this is to be used\n+ * to remove unicast MAC filter that is not shared with other VSIs on the\n+ * PF switch.\n+ *\n+ * Returns pointer to entry storing the rule if found\n+ */\n+static struct ice_fltr_mgmt_list_entry *\n+ice_find_ucast_rule_entry(struct ice_hw *hw, u8 recp_id,\n+\t\t\t struct ice_fltr_info *f_info)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tstruct ice_fltr_mgmt_list_entry *list_itr;\n+\tstruct LIST_HEAD_TYPE *list_head;\n+\n+\tlist_head = &sw->recp_list[recp_id].filt_rules;\n+\tLIST_FOR_EACH_ENTRY(list_itr, list_head, ice_fltr_mgmt_list_entry,\n+\t\t\t list_entry) {\n+\t\tif (!memcmp(&f_info->l_data, &list_itr->fltr_info.l_data,\n+\t\t\t sizeof(f_info->l_data)) &&\n+\t\t f_info->fwd_id.hw_vsi_id ==\n+\t\t list_itr->fltr_info.fwd_id.hw_vsi_id &&\n+\t\t f_info->flag == list_itr->fltr_info.flag)\n+\t\t\treturn list_itr;\n+\t}\n+\treturn NULL;\n+}\n+\n /**\n * ice_remove_mac - remove a MAC address based filter rule\n * @hw: pointer to the hardware structure\n@@ -3197,16 +3230,40 @@ enum ice_status\n ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)\n {\n \tstruct ice_fltr_list_entry *list_itr, *tmp;\n+\tstruct ice_lock *rule_lock; /* Lock to protect filter rule list */\n \n \tif (!m_list)\n \t\treturn ICE_ERR_PARAM;\n \n+\trule_lock = &hw->switch_info->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;\n \tLIST_FOR_EACH_ENTRY_SAFE(list_itr, tmp, m_list, ice_fltr_list_entry,\n \t\t\t\t list_entry) {\n \t\tenum ice_sw_lkup_type l_type = list_itr->fltr_info.lkup_type;\n+\t\tu8 *add = &list_itr->fltr_info.l_data.mac.mac_addr[0];\n+\t\tu16 vsi_handle;\n \n \t\tif (l_type != ICE_SW_LKUP_MAC)\n \t\t\treturn ICE_ERR_PARAM;\n+\n+\t\tvsi_handle = list_itr->fltr_info.vsi_handle;\n+\t\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\t\treturn ICE_ERR_PARAM;\n+\n+\t\tlist_itr->fltr_info.fwd_id.hw_vsi_id =\n+\t\t\t\t\tice_get_hw_vsi_num(hw, vsi_handle);\n+\t\tif (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {\n+\t\t\t/* Don't remove the unicast address that belongs to\n+\t\t\t * another VSI on the switch, since it is not being\n+\t\t\t * shared...\n+\t\t\t */\n+\t\t\tice_acquire_lock(rule_lock);\n+\t\t\tif (!ice_find_ucast_rule_entry(hw, ICE_SW_LKUP_MAC,\n+\t\t\t\t\t\t &list_itr->fltr_info)) {\n+\t\t\t\tice_release_lock(rule_lock);\n+\t\t\t\treturn ICE_ERR_DOES_NOT_EXIST;\n+\t\t\t}\n+\t\t\tice_release_lock(rule_lock);\n+\t\t}\n \t\tlist_itr->status = ice_remove_rule_internal(hw,\n \t\t\t\t\t\t\t ICE_SW_LKUP_MAC,\n \t\t\t\t\t\t\t list_itr);\n", "prefixes": [ "v2", "26/66" ] }{ "id": 54685, "url": "