Commit 3e31d209 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 32f1002e d1c4a346
...@@ -11925,8 +11925,10 @@ void devl_region_destroy(struct devlink_region *region) ...@@ -11925,8 +11925,10 @@ void devl_region_destroy(struct devlink_region *region)
devl_assert_locked(devlink); devl_assert_locked(devlink);
/* Free all snapshots of region */ /* Free all snapshots of region */
mutex_lock(&region->snapshot_lock);
list_for_each_entry_safe(snapshot, ts, &region->snapshot_list, list) list_for_each_entry_safe(snapshot, ts, &region->snapshot_list, list)
devlink_region_snapshot_del(region, snapshot); devlink_region_snapshot_del(region, snapshot);
mutex_unlock(&region->snapshot_lock);
list_del(&region->list); list_del(&region->list);
mutex_destroy(&region->snapshot_lock); mutex_destroy(&region->snapshot_lock);
......
...@@ -496,8 +496,8 @@ dummy_reporter_test() ...@@ -496,8 +496,8 @@ dummy_reporter_test()
check_reporter_info dummy healthy 3 3 10 true check_reporter_info dummy healthy 3 3 10 true
echo 8192> $DEBUGFS_DIR/health/binary_len echo 8192 > $DEBUGFS_DIR/health/binary_len
check_fail $? "Failed set dummy reporter binary len to 8192" check_err $? "Failed set dummy reporter binary len to 8192"
local dump=$(devlink health dump show $DL_HANDLE reporter dummy -j) local dump=$(devlink health dump show $DL_HANDLE reporter dummy -j)
check_err $? "Failed show dump of dummy reporter" check_err $? "Failed show dump of dummy reporter"
......
...@@ -47,6 +47,17 @@ if [ -d "${NETDEVSIM_PATH}/devices/netdevsim${DEV_ADDR}" ]; then ...@@ -47,6 +47,17 @@ if [ -d "${NETDEVSIM_PATH}/devices/netdevsim${DEV_ADDR}" ]; then
exit 1 exit 1
fi 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() init_test()
{ {
RET=0 RET=0
...@@ -151,6 +162,7 @@ trap_stats_test() ...@@ -151,6 +162,7 @@ trap_stats_test()
RET=0 RET=0
check_netdev_down
for trap_name in $(devlink_traps_get); do for trap_name in $(devlink_traps_get); do
devlink_trap_stats_idle_test $trap_name devlink_trap_stats_idle_test $trap_name
check_err $? "Stats of trap $trap_name not idle when netdev down" check_err $? "Stats of trap $trap_name not idle when netdev down"
...@@ -254,6 +266,7 @@ trap_group_stats_test() ...@@ -254,6 +266,7 @@ trap_group_stats_test()
RET=0 RET=0
check_netdev_down
for group_name in $(devlink_trap_groups_get); do for group_name in $(devlink_trap_groups_get); do
devlink_trap_group_stats_idle_test $group_name devlink_trap_group_stats_idle_test $group_name
check_err $? "Stats of trap group $group_name not idle when netdev down" check_err $? "Stats of trap group $group_name not idle when netdev down"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment