All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code
@ 2020-04-07 21:07 Andre Guedes
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro Andre Guedes
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

Hi,

This patch series provides some fixes and improvements to the ethertype
filtering code from IGC driver.

The improvements focuses on aligning the code organization to follow the
same rationale from the rest of the filtering code (MAC address and VLAN
priority filtering).

Best regards,

Andre

Andre Guedes (5):
  igc: Remove duplicated IGC_RXPBS macro
  igc: Remove ethertype filter in ptp code
  igc: Fix MAX_ETYPE_FILTER value
  igc: Refactor ethertype filtering code
  igc: Dump ETQF registers

 drivers/net/ethernet/intel/igc/igc.h         |  6 +-
 drivers/net/ethernet/intel/igc/igc_defines.h |  3 -
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 70 +++------------
 drivers/net/ethernet/intel/igc/igc_main.c    | 93 ++++++++++++++++++++
 drivers/net/ethernet/intel/igc/igc_ptp.c     | 12 ---
 drivers/net/ethernet/intel/igc/igc_regs.h    |  2 -
 6 files changed, 107 insertions(+), 79 deletions(-)

-- 
2.26.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro
  2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
@ 2020-04-07 21:07 ` Andre Guedes
  2020-04-23 18:12   ` Brown, Aaron F
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code Andre Guedes
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

This patch remove the IGC_RXPBS macro defined in line 233 since it is
already defined in line 18 with the exactly same value.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_regs.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_regs.h b/drivers/net/ethernet/intel/igc/igc_regs.h
index a01d93bf5028..1cbd428adfbe 100644
--- a/drivers/net/ethernet/intel/igc/igc_regs.h
+++ b/drivers/net/ethernet/intel/igc/igc_regs.h
@@ -227,8 +227,6 @@
 
 #define IGC_FTQF(_n)	(0x059E0 + (4 * (_n)))  /* 5-tuple Queue Fltr */
 
-#define IGC_RXPBS	0x02404  /* Rx Packet Buffer Size - RW */
-
 /* Transmit Scheduling Registers */
 #define IGC_TQAVCTRL                   0x3570
 #define IGC_TXQCTL(_n)                 (0x3344 + 0x4 * (_n))
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code
  2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro Andre Guedes
@ 2020-04-07 21:07 ` Andre Guedes
  2020-04-23 18:20   ` Brown, Aaron F
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value Andre Guedes
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

The driver only supports hardware timestamping for all incoming
traffic (HWTSTAMP_FILTER_ALL) which is enabled via Rx Time Sync
Control (TSYNCRXCTL) register already. Therefore, the ethertype
filter set in in igc_ptp_set_timestamp_mode() is useless so this
patch removes it.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h         |  2 +-
 drivers/net/ethernet/intel/igc/igc_defines.h |  3 ---
 drivers/net/ethernet/intel/igc/igc_ptp.c     | 12 ------------
 3 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index dd2d2f0c312f..3666914724b0 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -26,7 +26,7 @@ void igc_set_ethtool_ops(struct net_device *);
 #define MAX_Q_VECTORS			8
 #define MAX_STD_JUMBO_FRAME_SIZE	9216
 
-#define MAX_ETYPE_FILTER		(4 - 1)
+#define MAX_ETYPE_FILTER		4
 #define IGC_RETA_SIZE			128
 
 struct igc_tx_queue_stats {
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index 03c3ce86a9b6..1127ef81e374 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -384,9 +384,6 @@
 
 #define IGC_TSICR_INTERRUPTS	IGC_TSICR_TXTS
 
-/* PTP Queue Filter */
-#define IGC_ETQF_1588		BIT(30)
-
 #define IGC_FTQF_VF_BP		0x00008000
 #define IGC_FTQF_1588_TIME_STAMP	0x08000000
 #define IGC_FTQF_MASK			0xF0000000
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index c292aaf7c79d..825e21a73355 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -305,7 +305,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
 	struct igc_hw *hw = &adapter->hw;
 	u32 tsync_rx_cfg = 0;
 	bool is_l4 = false;
-	bool is_l2 = false;
 	u32 regval;
 
 	/* reserved for future extensions */
@@ -346,7 +345,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
 	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
 		tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_EVENT_V2;
 		config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
-		is_l2 = true;
 		is_l4 = true;
 		break;
 	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
@@ -370,7 +368,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
 		tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_ALL;
 		tsync_rx_ctl |= IGC_TSYNCRXCTL_RXSYNSIG;
 		config->rx_filter = HWTSTAMP_FILTER_ALL;
-		is_l2 = true;
 		is_l4 = true;
 
 		if (hw->mac.type == igc_i225) {
@@ -405,15 +402,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
 	/* define which PTP packets are time stamped */
 	wr32(IGC_TSYNCRXCFG, tsync_rx_cfg);
 
-	/* define ethertype filter for timestamped packets */
-	if (is_l2)
-		wr32(IGC_ETQF(3),
-		     (IGC_ETQF_FILTER_ENABLE | /* enable filter */
-		     IGC_ETQF_1588 | /* enable timestamping */
-		     ETH_P_1588)); /* 1588 eth protocol type */
-	else
-		wr32(IGC_ETQF(3), 0);
-
 	/* L4 Queue Filter[3]: filter by destination port and protocol */
 	if (is_l4) {
 		u32 ftqf = (IPPROTO_UDP /* UDP */
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value
  2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro Andre Guedes
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code Andre Guedes
@ 2020-04-07 21:07 ` Andre Guedes
  2020-04-23 19:29   ` Brown, Aaron F
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code Andre Guedes
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers Andre Guedes
  4 siblings, 1 reply; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

The I225 controller has 8 ethertype filters, not 4. This patch fixes the
MAX_ETYPE_FILTER macro accordingly.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 3666914724b0..c20ac078fdef 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -26,7 +26,7 @@ void igc_set_ethtool_ops(struct net_device *);
 #define MAX_Q_VECTORS			8
 #define MAX_STD_JUMBO_FRAME_SIZE	9216
 
-#define MAX_ETYPE_FILTER		4
+#define MAX_ETYPE_FILTER		8
 #define IGC_RETA_SIZE			128
 
 struct igc_tx_queue_stats {
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code
  2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
                   ` (2 preceding siblings ...)
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value Andre Guedes
@ 2020-04-07 21:07 ` Andre Guedes
  2020-04-23 19:28   ` Brown, Aaron F
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers Andre Guedes
  4 siblings, 1 reply; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

The whole ethertype filtering code is implemented in igc_ethtool.c and
mixes logic from ethtool and core parts. This patch refactors it so core
logic is moved to igc_main.c, aligning the ethertype filtering code
organization with the rest of the filtering code from the driver (MAC
address and VLAN priority).

Besides moving code to igc_main.c, this patch also does some minor
improvements to the code. Below are some highlights.

In case all filters are already in use and the user tries to add another
filter, we return -ENOSPC instead of -EINVAL so a more meaningful error
code is provided. This also aligns with the behavior implemented in MAC
address filtering code.

With this code refactoring, 'etype_bitmap' array in struct igc_adapter
and 'etype_reg_index' in struct igc_nfc_filter are not needed anymore
and are removed.

Log messages are added to help debugging the ethertype filtering code.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc.h         |  4 +-
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 67 ++------------
 drivers/net/ethernet/intel/igc/igc_main.c    | 93 ++++++++++++++++++++
 3 files changed, 103 insertions(+), 61 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index c20ac078fdef..22dde0590a23 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -189,7 +189,6 @@ struct igc_adapter {
 
 	/* lock for RX network flow classification filter */
 	spinlock_t nfc_lock;
-	bool etype_bitmap[MAX_ETYPE_FILTER];
 
 	struct igc_mac_addr *mac_table;
 
@@ -238,6 +237,8 @@ int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
 int igc_add_vlan_prio_filter(struct igc_adapter *adapter, int prio,
 			     int queue);
 void igc_del_vlan_prio_filter(struct igc_adapter *adapter, int prio);
+int igc_add_etype_filter(struct igc_adapter *adapter, u16 etype, int queue);
+int igc_del_etype_filter(struct igc_adapter *adapter, u16 etype);
 void igc_update_stats(struct igc_adapter *adapter);
 
 /* igc_dump declarations */
@@ -466,7 +467,6 @@ struct igc_nfc_filter {
 	struct hlist_node nfc_node;
 	struct igc_nfc_input filter;
 	unsigned long cookie;
-	u16 etype_reg_index;
 	u16 sw_idx;
 	u16 action;
 };
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index a66b04755b2a..5a53bf6ee1e5 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1183,46 +1183,6 @@ static int igc_set_rss_hash_opt(struct igc_adapter *adapter,
 	return 0;
 }
 
-static int igc_rxnfc_write_etype_filter(struct igc_adapter *adapter,
-					struct igc_nfc_filter *input)
-{
-	struct igc_hw *hw = &adapter->hw;
-	u8 i;
-	u32 etqf;
-	u16 etype;
-
-	/* find an empty etype filter register */
-	for (i = 0; i < MAX_ETYPE_FILTER; ++i) {
-		if (!adapter->etype_bitmap[i])
-			break;
-	}
-	if (i == MAX_ETYPE_FILTER) {
-		netdev_err(adapter->netdev,
-			   "ethtool -N: etype filters are all used");
-		return -EINVAL;
-	}
-
-	adapter->etype_bitmap[i] = true;
-
-	etqf = rd32(IGC_ETQF(i));
-	etype = ntohs(input->filter.etype & ETHER_TYPE_FULL_MASK);
-
-	etqf |= IGC_ETQF_FILTER_ENABLE;
-	etqf &= ~IGC_ETQF_ETYPE_MASK;
-	etqf |= (etype & IGC_ETQF_ETYPE_MASK);
-
-	etqf &= ~IGC_ETQF_QUEUE_MASK;
-	etqf |= ((input->action << IGC_ETQF_QUEUE_SHIFT)
-		& IGC_ETQF_QUEUE_MASK);
-	etqf |= IGC_ETQF_QUEUE_ENABLE;
-
-	wr32(IGC_ETQF(i), etqf);
-
-	input->etype_reg_index = i;
-
-	return 0;
-}
-
 int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)
 {
 	struct igc_hw *hw = &adapter->hw;
@@ -1236,7 +1196,9 @@ int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)
 	}
 
 	if (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {
-		err = igc_rxnfc_write_etype_filter(adapter, input);
+		u16 etype = ntohs(input->filter.etype);
+
+		err = igc_add_etype_filter(adapter, etype, input->action);
 		if (err)
 			return err;
 	}
@@ -1267,26 +1229,13 @@ int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)
 	return 0;
 }
 
-static void igc_clear_etype_filter_regs(struct igc_adapter *adapter,
-					u16 reg_index)
-{
-	struct igc_hw *hw = &adapter->hw;
-	u32 etqf = rd32(IGC_ETQF(reg_index));
-
-	etqf &= ~IGC_ETQF_QUEUE_ENABLE;
-	etqf &= ~IGC_ETQF_QUEUE_MASK;
-	etqf &= ~IGC_ETQF_FILTER_ENABLE;
-
-	wr32(IGC_ETQF(reg_index), etqf);
-
-	adapter->etype_bitmap[reg_index] = false;
-}
-
 int igc_erase_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)
 {
-	if (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE)
-		igc_clear_etype_filter_regs(adapter,
-					    input->etype_reg_index);
+	if (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {
+		u16 etype = ntohs(input->filter.etype);
+
+		igc_del_etype_filter(adapter, etype);
+	}
 
 	if (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {
 		int prio = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 150f4c6c029e..9c2d487803b2 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -2367,6 +2367,99 @@ void igc_del_vlan_prio_filter(struct igc_adapter *adapter, int prio)
 		   prio);
 }
 
+static int igc_get_avail_etype_filter_slot(struct igc_adapter *adapter)
+{
+	struct igc_hw *hw = &adapter->hw;
+	int i;
+
+	for (i = 0; i < MAX_ETYPE_FILTER; i++) {
+		u32 etqf = rd32(IGC_ETQF(i));
+
+		if (!(etqf & IGC_ETQF_FILTER_ENABLE))
+			return i;
+	}
+
+	return -1;
+}
+
+/**
+ * igc_add_etype_filter() - Add ethertype filter.
+ * @adapter: Pointer to adapter where the filter should be added.
+ * @etype: Ethertype value.
+ * @queue: If non-negative, queue assignment feature is enabled and frames
+ *         matching the filter are enqueued onto 'queue'. Otherwise, queue
+ *         assignment is disabled.
+ *
+ * Return: 0 in case of success, negative errno code otherwise.
+ */
+int igc_add_etype_filter(struct igc_adapter *adapter, u16 etype, int queue)
+{
+	struct igc_hw *hw = &adapter->hw;
+	int index;
+	u32 etqf;
+
+	index = igc_get_avail_etype_filter_slot(adapter);
+	if (index < 0)
+		return -ENOSPC;
+
+	etqf = rd32(IGC_ETQF(index));
+
+	etqf &= ~IGC_ETQF_ETYPE_MASK;
+	etqf |= etype;
+
+	if (queue >= 0) {
+		etqf &= ~IGC_ETQF_QUEUE_MASK;
+		etqf |= (queue << IGC_ETQF_QUEUE_SHIFT);
+		etqf |= IGC_ETQF_QUEUE_ENABLE;
+	}
+
+	etqf |= IGC_ETQF_FILTER_ENABLE;
+
+	wr32(IGC_ETQF(index), etqf);
+
+	netdev_dbg(adapter->netdev, "Add ethertype filter: etype %04x queue %d",
+		   etype, queue);
+	return 0;
+}
+
+static int igc_find_etype_filter(struct igc_adapter *adapter, u16 etype)
+{
+	struct igc_hw *hw = &adapter->hw;
+	int i;
+
+	for (i = 0; i < MAX_ETYPE_FILTER; i++) {
+		u32 etqf = rd32(IGC_ETQF(i));
+
+		if ((etqf & IGC_ETQF_ETYPE_MASK) == etype)
+			return i;
+	}
+
+	return -1;
+}
+
+/**
+ * igc_del_etype_filter() - Delete ethertype filter.
+ * @adapter: Pointer to adapter where the filter should be deleted from.
+ * @etype: Ethertype value.
+ *
+ * Return: 0 in case of success, negative errno code otherwise.
+ */
+int igc_del_etype_filter(struct igc_adapter *adapter, u16 etype)
+{
+	struct igc_hw *hw = &adapter->hw;
+	int index;
+
+	index = igc_find_etype_filter(adapter, etype);
+	if (index < 0)
+		return -ENOENT;
+
+	wr32(IGC_ETQF(index), 0);
+
+	netdev_dbg(adapter->netdev, "Delete ethertype filter: etype %04x",
+		   etype);
+	return 0;
+}
+
 static int igc_uc_sync(struct net_device *netdev, const unsigned char *addr)
 {
 	struct igc_adapter *adapter = netdev_priv(netdev);
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers
  2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
                   ` (3 preceding siblings ...)
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code Andre Guedes
@ 2020-04-07 21:07 ` Andre Guedes
  2020-04-23 19:33   ` Brown, Aaron F
  4 siblings, 1 reply; 11+ messages in thread
From: Andre Guedes @ 2020-04-07 21:07 UTC (permalink / raw)
  To: intel-wired-lan

This patch adds the EType Queue Filter (ETQF) registers to the list of
registers dumped by igc_get_regs().

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 5a53bf6ee1e5..eb7a6932dae2 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -318,6 +318,9 @@ static void igc_get_regs(struct net_device *netdev,
 		regs_buff[188 + i] = rd32(IGC_RAH(i));
 
 	regs_buff[204] = rd32(IGC_VLANPQF);
+
+	for (i = 0; i < 8; i++)
+		regs_buff[205 + i] = rd32(IGC_ETQF(i));
 }
 
 static void igc_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
-- 
2.26.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro Andre Guedes
@ 2020-04-23 18:12   ` Brown, Aaron F
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Aaron F @ 2020-04-23 18:12 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Tuesday, April 7, 2020 2:07 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS
> macro
> 
> This patch remove the IGC_RXPBS macro defined in line 233 since it is
> already defined in line 18 with the exactly same value.
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_regs.h | 2 --
>  1 file changed, 2 deletions(-)
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code Andre Guedes
@ 2020-04-23 18:20   ` Brown, Aaron F
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Aaron F @ 2020-04-23 18:20 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Tuesday, April 7, 2020 2:07 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp
> code
> 
> The driver only supports hardware timestamping for all incoming
> traffic (HWTSTAMP_FILTER_ALL) which is enabled via Rx Time Sync
> Control (TSYNCRXCTL) register already. Therefore, the ethertype
> filter set in in igc_ptp_set_timestamp_mode() is useless so this
> patch removes it.
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc.h         |  2 +-
>  drivers/net/ethernet/intel/igc/igc_defines.h |  3 ---
>  drivers/net/ethernet/intel/igc/igc_ptp.c     | 12 ------------
>  3 files changed, 1 insertion(+), 16 deletions(-)
> 
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code Andre Guedes
@ 2020-04-23 19:28   ` Brown, Aaron F
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Aaron F @ 2020-04-23 19:28 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Tuesday, April 7, 2020 2:07 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code
> 
> The whole ethertype filtering code is implemented in igc_ethtool.c and
> mixes logic from ethtool and core parts. This patch refactors it so core
> logic is moved to igc_main.c, aligning the ethertype filtering code
> organization with the rest of the filtering code from the driver (MAC
> address and VLAN priority).
> 
> Besides moving code to igc_main.c, this patch also does some minor
> improvements to the code. Below are some highlights.
> 
> In case all filters are already in use and the user tries to add another
> filter, we return -ENOSPC instead of -EINVAL so a more meaningful error
> code is provided. This also aligns with the behavior implemented in MAC
> address filtering code.
> 
> With this code refactoring, 'etype_bitmap' array in struct igc_adapter
> and 'etype_reg_index' in struct igc_nfc_filter are not needed anymore
> and are removed.
> 
> Log messages are added to help debugging the ethertype filtering code.
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc.h         |  4 +-
>  drivers/net/ethernet/intel/igc/igc_ethtool.c | 67 ++------------
>  drivers/net/ethernet/intel/igc/igc_main.c    | 93 ++++++++++++++++++++
>  3 files changed, 103 insertions(+), 61 deletions(-)
> 
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value Andre Guedes
@ 2020-04-23 19:29   ` Brown, Aaron F
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Aaron F @ 2020-04-23 19:29 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Tuesday, April 7, 2020 2:07 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value
> 
> The I225 controller has 8 ethertype filters, not 4. This patch fixes the
> MAX_ETYPE_FILTER macro accordingly.
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers
  2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers Andre Guedes
@ 2020-04-23 19:33   ` Brown, Aaron F
  0 siblings, 0 replies; 11+ messages in thread
From: Brown, Aaron F @ 2020-04-23 19:33 UTC (permalink / raw)
  To: intel-wired-lan

> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Andre Guedes
> Sent: Tuesday, April 7, 2020 2:07 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers
> 
> This patch adds the EType Queue Filter (ETQF) registers to the list of
> registers dumped by igc_get_regs().
> 
> Signed-off-by: Andre Guedes <andre.guedes@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_ethtool.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
Tested-by: Aaron Brown <aaron.f.brown@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-23 19:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 21:07 [Intel-wired-lan] [PATCH 0/5] igc: Fixes for ethertype filtering code Andre Guedes
2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 1/5] igc: Remove duplicated IGC_RXPBS macro Andre Guedes
2020-04-23 18:12   ` Brown, Aaron F
2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 2/5] igc: Remove ethertype filter in ptp code Andre Guedes
2020-04-23 18:20   ` Brown, Aaron F
2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 3/5] igc: Fix MAX_ETYPE_FILTER value Andre Guedes
2020-04-23 19:29   ` Brown, Aaron F
2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 4/5] igc: Refactor ethertype filtering code Andre Guedes
2020-04-23 19:28   ` Brown, Aaron F
2020-04-07 21:07 ` [Intel-wired-lan] [PATCH 5/5] igc: Dump ETQF registers Andre Guedes
2020-04-23 19:33   ` Brown, Aaron F

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.