From: Shannon Nelson <shannon.nelson@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [RFC 05/13] ice: Refactor switch rule management structures and functions
Date: Mon, 23 Jul 2018 10:54:42 -0700 [thread overview]
Message-ID: <b18032ce-4e58-a5df-0935-371fa1ea0573@oracle.com> (raw)
In-Reply-To: <20180720205353.13296-6-anirudh.venkataramanan@intel.com>
On 7/20/2018 1:53 PM, Anirudh Venkataramanan wrote:
> This patch is an adaptation of the work originally done by Grishma
> Kotecha <grishma.kotecha@intel.com> that in summary refactors the
> switch filtering logic in the driver. More specifically,
> - Update the recipe structure to also store list of rules
> - Update the existing code for recipes like mac, vlan, ethtype etc to
> use list head that is attached to switch recipe structure
> - Add a common function to search for a rule entry and add a new rule
> entry. Update the code to use this new function.
> - Refactor the rem_handle_vsi_list function to simplify the logic
>
> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
> ---
[...]
> @@ -1822,42 +1766,40 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_id,
> struct ice_switch_info *sw = hw->switch_info;
> struct ice_fltr_list_entry *fm_entry;
> struct list_head remove_list_head;
> + struct list_head *rule_head;
> struct ice_fltr_list_entry *tmp;
> + struct mutex *rule_lock; /* Lock to protect filter rule list */
> enum ice_status status;
>
> INIT_LIST_HEAD(&remove_list_head);
> + rule_lock = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rule_lock;
> + rule_head = &sw->recp_list[ICE_SW_LKUP_MAC].filt_rules;
> + mutex_lock(rule_lock);
> + status = ice_add_to_vsi_fltr_list(hw, vsi_id, rule_head,
> + &remove_list_head);
> + mutex_unlock(rule_lock);
> + if (status)
> + goto free_fltr_list;
> +
> switch (lkup) {
> case ICE_SW_LKUP_MAC:
> - mutex_lock(&sw->mac_list_lock);
> - status = ice_add_to_vsi_fltr_list(hw, vsi_id,
> - &sw->mac_list_head,
> - &remove_list_head);
> - mutex_unlock(&sw->mac_list_lock);
> - if (!status) {
> - ice_remove_mac(hw, &remove_list_head);
> - goto free_fltr_list;
> - }
> + ice_remove_mac(hw, &remove_list_head);
> break;
> case ICE_SW_LKUP_VLAN:
> - mutex_lock(&sw->vlan_list_lock);
> - status = ice_add_to_vsi_fltr_list(hw, vsi_id,
> - &sw->vlan_list_head,
> - &remove_list_head);
> - mutex_unlock(&sw->vlan_list_lock);
> - if (!status) {
> - ice_remove_vlan(hw, &remove_list_head);
> - goto free_fltr_list;
> - }
> + ice_remove_vlan(hw, &remove_list_head);
> break;
> case ICE_SW_LKUP_MAC_VLAN:
> case ICE_SW_LKUP_ETHERTYPE:
> case ICE_SW_LKUP_ETHERTYPE_MAC:
> case ICE_SW_LKUP_PROMISC:
> - case ICE_SW_LKUP_PROMISC_VLAN:
> case ICE_SW_LKUP_DFLT:
> ice_debug(hw, ICE_DBG_SW,
> "Remove filters for this lookup type hasn't been implemented yet\n");
You should put the lookup type number in this message to make it a
little easier to debug and know what got you here.
> break;
> + case ICE_SW_LKUP_PROMISC_VLAN:
> + case ICE_SW_LKUP_LAST:
add a "default:" label to catch any unexpected types
> + ice_debug(hw, ICE_DBG_SW, "Unsupported lookup type\n");
Add lookup type number that got you here.
> + break;
> }
>
> return;
next prev parent reply other threads:[~2018-07-23 17:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 20:53 [Intel-wired-lan] [RFC 00/13] Feature updates for ice Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 01/13] ice: Minor updates to Tx scheduler code Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 02/13] ice: Get both device and function capabilities Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 03/13] ice: Prevent control queue operations during reset Anirudh Venkataramanan
2018-07-23 17:03 ` Shannon Nelson
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 04/13] ice: Code optimization for ice_fill_sw_rule() Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 05/13] ice: Refactor switch rule management structures and functions Anirudh Venkataramanan
2018-07-23 17:54 ` Shannon Nelson [this message]
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 06/13] ice: Refactor VSI allocation, deletion and rebuild flow Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 07/13] ice: Implement handlers for ethtool PHY/link operations Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 08/13] ice: Clean up register file Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 09/13] ice: Add support for Tx hang, Tx timeout and malicious driver detection Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 10/13] ice: Implement ice_bridge_getlink and ice_bridge_setlink Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 11/13] ice: Enable firmware logging during device initialization Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 12/13] ice: Make ice_vsi_kill_vlan return an error code Anirudh Venkataramanan
2018-07-20 20:53 ` [Intel-wired-lan] [RFC 13/13] ice: Introduce SERVICE_DIS flag and service routine functions Anirudh Venkataramanan
2018-07-23 16:59 ` [Intel-wired-lan] [RFC 00/13] Feature updates for ice Shannon Nelson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b18032ce-4e58-a5df-0935-371fa1ea0573@oracle.com \
--to=shannon.nelson@oracle.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.