Skip to contentSkip to conversation

igc: Clear old XDP info when changing ring settings

PATCH In review Kurt Kanzenbach 2 participants 3 messages Feb 4, 2022 – Feb 5, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Clear old XDP info when changing ring settings

When changing ring sizes the driver triggers kernel warnings in XDP code.

For instance, running 'ethtool -G $interface tx 1024 rx 1024' yields:

|[  754.838136] Missing unregister, handled but fix driver
|[  754.838143] WARNING: CPU: 4 PID: 704 at net/core/xdp.c:170 xdp_rxq_info_reg+0x7d/0xe0

The newly allocated ring is copied by memcpy() and still contains the old XDP information. Therefore, it has to be cleared before allocating new resources by igc_setup_rx_resources().

Igb does it the same way. Keep the code in sync.

Fixes 4609ffb9f615 ("igc: Refactor XDP rxq info registration")
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/igc/igc_ethtool.c +4 -0
index 8cc077b712ad..93839106504d 100644
@@ -671,6 +671,10 @@ igc_ethtool_set_ringparam(struct net_device *netdev,
 			memcpy(&temp_ring[i], adapter->rx_ring[i],
 			       sizeof(struct igc_ring));
 
+			/* Clear copied XDP RX-queue info */
+			memset(&temp_ring[i].xdp_rxq, 0,
+			       sizeof(temp_ring[i].xdp_rxq));
+
 			temp_ring[i].count = new_rx_count;
 			err = igc_setup_rx_resources(&temp_ring[i]);
 			if (err) {
Signature · 1 line
2.30.2
#1 lore raw

Hi Kurt,

Quoted 9 lines · Kurt Kanzenbach

When changing ring sizes the driver triggers kernel warnings in XDP code.

For instance, running 'ethtool -G $interface tx 1024 rx 1024' yields:

Quoted 3 lines

[? 754.838136] Missing unregister, handled but fix driver [? 754.838143] WARNING: CPU: 4 PID: 704 at net/core/xdp.c:170 xdp_rxq_info_reg+0x7d/0xe0

Quoted 7 lines

The newly allocated ring is copied by memcpy() and still contains the old XDP
information. Therefore, it has to be cleared before allocating new resources
by igc_setup_rx_resources().

Igb does it the same way. Keep the code in sync.

Thanks for the patch, but we have a patch[1] to resolve this issue in a more preferred method. igb is actually changing as well to this new solution [2].

Thanks,
Tony

[1] https://patchwork.ozlabs.org/patch/1581816/
[2] https://patchwork.ozlabs.org/patch/1581815/

Quoted 2 lines
Fixes 4609ffb9f615 ("igc: Refactor XDP rxq info registration")
#2 lore raw
Quoted 3 lines · Anthony L. Nguyen

Thanks for the patch, but we have a patch[1] to resolve this issue in a more preferred method. igb is actually changing as well to this new solution [2].

OK, great.

Thanks,
Kurt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 861 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20220205/97771d38/attachment-0001.asc>