The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] igc: enable HW VLAN insertion/stripping by default
@ 2025-03-07 11:02 Rui Salvaterra
  2025-03-11 13:52 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Rui Salvaterra @ 2025-03-07 11:02 UTC (permalink / raw)
  To: muhammad.husaini.zulkifli, anthony.l.nguyen, przemyslaw.kitszel
  Cc: edumazet, kuba, netdev, linux-kernel, Rui Salvaterra

This is enabled by default in other Intel drivers I've checked (e1000, e1000e,
iavf, igb and ice). Fixes an out-of-the-box performance issue when running
OpenWrt on typical mini-PCs with igc-supported Ethernet controllers and 802.1Q
VLAN configurations, as ethtool isn't part of the default packages and sane
defaults are expected.

In my specific case, with an Intel N100-based machine with four I226-V Ethernet
controllers, my upload performance increased from under 30 Mb/s to the expected
~1 Gb/s.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---

This patch cost me two afternoons of network debugging, last weekend. Is there
any plausible reason why VLAN acceleration wasn't enabled by default for this
driver, specifically?

 drivers/net/ethernet/intel/igc/igc_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 84307bb7313e..6fef763239bc 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -7049,6 +7049,9 @@ static int igc_probe(struct pci_dev *pdev,
 	netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
 			       NETDEV_XDP_ACT_XSK_ZEROCOPY;
 
+	/* enable hardware VLAN insertion/stripping by default */
+	netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
+
 	/* MTU range: 68 - 9216 */
 	netdev->min_mtu = ETH_MIN_MTU;
 	netdev->max_mtu = MAX_STD_JUMBO_FRAME_SIZE;
-- 
2.48.1


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

end of thread, other threads:[~2025-03-13 15:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 11:02 [PATCH] igc: enable HW VLAN insertion/stripping by default Rui Salvaterra
2025-03-11 13:52 ` Simon Horman
2025-03-11 13:59   ` Rui Salvaterra
2025-03-12 21:43     ` Tony Nguyen
2025-03-13  9:23       ` Rui Salvaterra
2025-03-13 15:49         ` Tony Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox