Merge branch 'devlink-fixes'

Jakub Kicinski says:

====================
devlink: region snapshot locking fix and selftest adjustments

Minor fix for region snapshot locking and adjustments to selftests.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2022-12-16 10:21:37 +00:00
commit 3e31d209ed
3 changed files with 17 additions and 2 deletions

View File

@ -11925,8 +11925,10 @@ void devl_region_destroy(struct devlink_region *region)
devl_assert_locked(devlink);
/* Free all snapshots of region */
mutex_lock(&region->snapshot_lock);
list_for_each_entry_safe(snapshot, ts, &region->snapshot_list, list)
devlink_region_snapshot_del(region, snapshot);
mutex_unlock(&region->snapshot_lock);
list_del(&region->list);
mutex_destroy(&region->snapshot_lock);

View File

@ -496,8 +496,8 @@ dummy_reporter_test()
check_reporter_info dummy healthy 3 3 10 true
echo 8192> $DEBUGFS_DIR/health/binary_len
check_fail $? "Failed set dummy reporter binary len to 8192"
echo 8192 > $DEBUGFS_DIR/health/binary_len
check_err $? "Failed set dummy reporter binary len to 8192"
local dump=$(devlink health dump show $DL_HANDLE reporter dummy -j)
check_err $? "Failed show dump of dummy reporter"

View File

@ -47,6 +47,17 @@ if [ -d "${NETDEVSIM_PATH}/devices/netdevsim${DEV_ADDR}" ]; then
exit 1
fi
check_netdev_down()
{
state=$(cat /sys/class/net/${NETDEV}/flags)
if [ $((state & 1)) -ne 0 ]; then
echo "WARNING: unexpected interface UP, disable NetworkManager?"
ip link set dev $NETDEV down
fi
}
init_test()
{
RET=0
@ -151,6 +162,7 @@ trap_stats_test()
RET=0
check_netdev_down
for trap_name in $(devlink_traps_get); do
devlink_trap_stats_idle_test $trap_name
check_err $? "Stats of trap $trap_name not idle when netdev down"
@ -254,6 +266,7 @@ trap_group_stats_test()
RET=0
check_netdev_down
for group_name in $(devlink_trap_groups_get); do
devlink_trap_group_stats_idle_test $group_name
check_err $? "Stats of trap group $group_name not idle when netdev down"