Patch "selftests: drv-net: Check if combined-count exists" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests: drv-net: Check if combined-count exists

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-drv-net-check-if-combined-count-exists.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aa9b0cf023b3ae0a866adddaa983481c381107bc
Author: Joe Damato <jdamato@xxxxxxxxxx>
Date:   Wed Feb 26 18:19:57 2025 +0000

    selftests: drv-net: Check if combined-count exists
    
    [ Upstream commit 1cbddbddee68d17feb6467fc556c144777af91ef ]
    
    Some drivers, like tg3, do not set combined-count:
    
    $ ethtool -l enp4s0f1
    Channel parameters for enp4s0f1:
    Pre-set maximums:
    RX:             4
    TX:             4
    Other:          n/a
    Combined:       n/a
    Current hardware settings:
    RX:             4
    TX:             1
    Other:          n/a
    Combined:       n/a
    
    In the case where combined-count is not set, the ethtool netlink code
    in the kernel elides the value and the code in the test:
    
      netnl.channels_get(...)
    
    With a tg3 device, the returned dictionary looks like:
    
    {'header': {'dev-index': 3, 'dev-name': 'enp4s0f1'},
     'rx-max': 4,
     'rx-count': 4,
     'tx-max': 4,
     'tx-count': 1}
    
    Note that the key 'combined-count' is missing. As a result of this
    missing key the test raises an exception:
    
     # Exception|     if channels['combined-count'] == 0:
     # Exception|        ~~~~~~~~^^^^^^^^^^^^^^^^^^
     # Exception| KeyError: 'combined-count'
    
    Change the test to check if 'combined-count' is a key in the dictionary
    first and if not assume that this means the driver has separate RX and
    TX queues.
    
    With this change, the test now passes successfully on tg3 and mlx5
    (which does have a 'combined-count').
    
    Fixes: 1cf270424218 ("net: selftest: add test for netdev netlink queue-get API")
    Signed-off-by: Joe Damato <jdamato@xxxxxxxxxx>
    Reviewed-by: David Wei <dw@xxxxxxxxxxx>
    Link: https://patch.msgid.link/20250226181957.212189-1-jdamato@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/drivers/net/queues.py b/tools/testing/selftests/drivers/net/queues.py
index 30f29096e27c2..4868b514ae78d 100755
--- a/tools/testing/selftests/drivers/net/queues.py
+++ b/tools/testing/selftests/drivers/net/queues.py
@@ -40,10 +40,9 @@ def addremove_queues(cfg, nl) -> None:
 
     netnl = EthtoolFamily()
     channels = netnl.channels_get({'header': {'dev-index': cfg.ifindex}})
-    if channels['combined-count'] == 0:
-        rx_type = 'rx'
-    else:
-        rx_type = 'combined'
+    rx_type = 'rx'
+    if channels.get('combined-count', 0) > 0:
+            rx_type = 'combined'
 
     expected = curr_queues - 1
     cmd(f"ethtool -L {cfg.dev['ifname']} {rx_type} {expected}", timeout=10)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux