Patch "selftests: forwarding: devlink_lib: Wait for udev events after reloading" has been added to the 6.1-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: forwarding: devlink_lib: Wait for udev events after reloading

to the 6.1-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-forwarding-devlink_lib-wait-for-udev-event.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 4895ae54d8fdbcaf7bb077d6a37d754a6b135342
Author: Amit Cohen <amcohen@xxxxxxxxxx>
Date:   Thu Jul 11 17:27:02 2024 +0200

    selftests: forwarding: devlink_lib: Wait for udev events after reloading
    
    [ Upstream commit f67a90a0c8f5b3d0acc18f10650d90fec44775f9 ]
    
    Lately, an additional locking was added by commit c0a40097f0bc
    ("drivers: core: synchronize really_probe() and dev_uevent()"). The
    locking protects dev_uevent() calling. This function is used to send
    messages from the kernel to user space. Uevent messages notify user space
    about changes in device states, such as when a device is added, removed,
    or changed. These messages are used by udev (or other similar user-space
    tools) to apply device-specific rules.
    
    After reloading devlink instance, udev events should be processed. This
    locking causes a short delay of udev events handling.
    
    One example for useful udev rule is renaming ports. 'forwading.config'
    can be configured to use names after udev rules are applied. Some tests run
    devlink_reload() and immediately use the updated names. This worked before
    the above mentioned commit was pushed, but now the delay of uevent messages
    causes that devlink_reload() returns before udev events are handled and
    tests fail.
    
    Adjust devlink_reload() to not assume that udev events are already
    processed when devlink reload is done, instead, wait for udev events to
    ensure they are processed before returning from the function.
    
    Without this patch:
    TESTS='rif_mac_profile' ./resource_scale.sh
    TEST: 'rif_mac_profile' 4                                           [ OK ]
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
    sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
    Cannot find device "swp1"
    Cannot find device "swp2"
    TEST: setup_wait_dev (: Interface swp1 does not come up.) [FAIL]
    
    With this patch:
    $ TESTS='rif_mac_profile' ./resource_scale.sh
    TEST: 'rif_mac_profile' 4                                           [ OK ]
    TEST: 'rif_mac_profile' overflow 5                                  [ OK ]
    
    This is relevant not only for this test.
    
    Fixes: bc7cbb1e9f4c ("selftests: forwarding: Add devlink_lib.sh")
    Signed-off-by: Amit Cohen <amcohen@xxxxxxxxxx>
    Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>
    Signed-off-by: Petr Machata <petrm@xxxxxxxxxx>
    Link: https://patch.msgid.link/89367666e04b38a8993027f1526801ca327ab96a.1720709333.git.petrm@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index 601990c6881bf..4c555fab9e755 100644
--- a/tools/testing/selftests/net/forwarding/devlink_lib.sh
+++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh
@@ -122,6 +122,8 @@ devlink_reload()
 	still_pending=$(devlink resource show "$DEVLINK_DEV" | \
 			grep -c "size_new")
 	check_err $still_pending "Failed reload - There are still unset sizes"
+
+	udevadm settle
 }
 
 declare -A DEVLINK_ORIG




[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