All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v2 07/12] igc: Remove 'queue' check in igc_del_mac_filter()
Date: Wed,  1 Apr 2020 14:41:43 -0700	[thread overview]
Message-ID: <20200401214142.2779-1-andre.guedes@intel.com> (raw)
In-Reply-To: <20200318230102.36952-8-andre.guedes@intel.com>

igc_add_mac_filter() doesn't allow us to have more than one entry with
the same address and address type in adapter->mac_table so checking if
'queue' matches in igc_del_mac_filter() isn't necessary. This patch
removes that check.

This patch also takes the opportunity to improve the igc_del_mac_filter
documentation and remove comment which is not applicable to this I225
controller.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
---
v2: Fix function documentation to follow kernel-doc style.
---
 drivers/net/ethernet/intel/igc/igc_main.c | 25 ++++++++++-------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 37c8980a43a0..961a7c642e44 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -2234,14 +2234,17 @@ static int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,
 	return -ENOSPC;
 }
 
-/* Remove a MAC filter for 'addr' directing matching traffic to
- * 'queue', 'flags' is used to indicate what kind of match need to be
- * removed, match is by default for the destination address, if
- * matching by source address is to be removed the flag
- * IGC_MAC_STATE_SRC_ADDR can be used.
+/**
+ * igc_del_mac_filter() - Delete MAC address filter.
+ * @adapter: Pointer to adapter where the filter should be deleted from.
+ * @addr: MAC address.
+ * @flags: Set IGC_MAC_STATE_SRC_ADDR bit to indicate @address is a source
+ *         address.
+ *
+ * Return: 0 in case of success, negative errno code otherwise.
  */
 static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
-			      const u8 queue, const u8 flags)
+			      const u8 flags)
 {
 	struct igc_hw *hw = &adapter->hw;
 	int rar_entries = hw->mac.rar_entry_count;
@@ -2250,17 +2253,11 @@ static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
 	if (!is_valid_ether_addr(addr))
 		return -EINVAL;
 
-	/* Search for matching entry in the MAC table based on given address
-	 * and queue. Do not touch entries at the end of the table reserved
-	 * for the VF MAC addresses.
-	 */
 	for (i = 0; i < rar_entries; i++) {
 		if (!(adapter->mac_table[i].state & IGC_MAC_STATE_IN_USE))
 			continue;
 		if (flags && (adapter->mac_table[i].state & flags) != flags)
 			continue;
-		if (adapter->mac_table[i].queue != queue)
-			continue;
 		if (!ether_addr_equal(adapter->mac_table[i].addr, addr))
 			continue;
 
@@ -2296,7 +2293,7 @@ static int igc_uc_unsync(struct net_device *netdev, const unsigned char *addr)
 {
 	struct igc_adapter *adapter = netdev_priv(netdev);
 
-	return igc_del_mac_filter(adapter, addr, adapter->num_rx_queues, 0);
+	return igc_del_mac_filter(adapter, addr, 0);
 }
 
 /**
@@ -3741,7 +3738,7 @@ int igc_add_mac_steering_filter(struct igc_adapter *adapter,
 int igc_del_mac_steering_filter(struct igc_adapter *adapter,
 				const u8 *addr, u8 queue, u8 flags)
 {
-	return igc_del_mac_filter(adapter, addr, queue,
+	return igc_del_mac_filter(adapter, addr,
 				  IGC_MAC_STATE_QUEUE_STEERING | flags);
 }
 
-- 
2.26.0


  parent reply	other threads:[~2020-04-01 21:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 23:00 [Intel-wired-lan] [PATCH 00/12] igc: Refactor MAC address filtering code Andre Guedes
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 01/12] igc: Remove duplicate code in MAC filtering logic Andre Guedes
2020-03-31 19:58   ` Brown, Aaron F
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 02/12] igc: Check unsupported flag in igc_add_mac_filter() Andre Guedes
2020-03-31 19:58   ` Brown, Aaron F
2020-03-31 20:59     ` Brown, Aaron F
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 03/12] igc: Change igc_add_mac_filter() returning value Andre Guedes
2020-03-31 19:59   ` Brown, Aaron F
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 04/12] igc: Fix igc_uc_unsync() Andre Guedes
2020-03-31 19:59   ` Brown, Aaron F
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 05/12] igc: Refactor igc_rar_set_index() Andre Guedes
2020-03-31 11:22   ` Neftin, Sasha
2020-03-31 21:12     ` Andre Guedes
2020-04-01 21:51       ` Andre Guedes
2020-03-31 20:00   ` Brown, Aaron F
2020-04-01 21:36   ` [Intel-wired-lan] [PATCH v2 " Andre Guedes
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 06/12] igc: Improve address check in igc_del_mac_filter() Andre Guedes
2020-03-31 20:01   ` Brown, Aaron F
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 07/12] igc: Remove 'queue' " Andre Guedes
2020-03-31 15:53   ` Neftin, Sasha
2020-03-31 20:48     ` Brown, Aaron F
2020-03-31 20:50       ` Kirsher, Jeffrey T
2020-04-01 21:41   ` Andre Guedes [this message]
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 08/12] igc: Remove IGC_MAC_STATE_QUEUE_STEERING Andre Guedes
2020-03-31 20:55   ` Brown, Aaron F
2020-04-01  5:44   ` Neftin, Sasha
2020-04-01 21:43   ` [Intel-wired-lan] [PATCH v2 " Andre Guedes
2020-03-18 23:00 ` [Intel-wired-lan] [PATCH 09/12] igc: Remove igc_*_mac_steering_filter() wrappers Andre Guedes
2020-03-31 20:56   ` Brown, Aaron F
2020-03-18 23:01 ` [Intel-wired-lan] [PATCH 10/12] igc: Refactor igc_mac_entry_can_be_used() Andre Guedes
2020-03-31 20:56   ` Brown, Aaron F
2020-03-18 23:01 ` [Intel-wired-lan] [PATCH 11/12] igc: Refactor igc_del_mac_filter() Andre Guedes
2020-03-31 20:57   ` Brown, Aaron F
2020-03-18 23:01 ` [Intel-wired-lan] [PATCH 12/12] igc: Add debug messages to MAC filter code Andre Guedes
2020-03-31 20:57   ` Brown, Aaron F

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=20200401214142.2779-1-andre.guedes@intel.com \
    --to=andre.guedes@intel.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.