Search K
Appearance
Appearance
dropwatch 组件名称为 dropwatch, 需要开启的内核选项为
# Networking support
# -> Networking options
# -> Network testing
# -> Network packet drop alerting service
CONFIG_NET_DROP_MONITOR=y检查工具为
#!/opt/sum/bin/bash
source ./kernel_config_utils.sh
dropwatch_check() {
local is_error
is_error="false"
if ! kernel_config_check CONFIG_NET_DROP_MONITOR drop_monitor; then
is_error="true"
fi
if ! kernel_config_check CONFIG_NET_DEVLINK; then
is_error="true"
fi
if [ "$is_error" == "true" ]; then
return 1
fi
return 0
}NET_DM_CMD_CONFIG 支持的 attr 对应的标识符格式为 NET_DM_ATTR_*, 对应的 C 类型是 include/uapi/linux/net_dropmon.h 文件中的 enum net_dm_attr 类型. 引入的 attr 的版本和提交号如下表所示:
| attr | 版本 | 提交号 |
|---|---|---|
NET_DM_ATTR_ALERT_MODE | v5.4 | ca30707dee2bc8bc81cfd8b4277fe90f7ca6df1f |
NET_DM_ATTR_QUEUE_LEN | v5.4 | 30328d46af593dcf24582f2a431d84ea0cf4bdef |
NET_DM_ATTR_TRUNC_LEN | v5.4 | 57986617a736aec2980c1c78a9dd8dcdf477ee6e |
dwdump 工具在 NET_DM_CMD_CONFIG 不支持下列 attr 时
会打印以下报错
Failed to configure drop monitor kernel moduledwdump 工具在 CONFIG_NET_DEVLINK 内核选项未开启时, 但是开启 hardware origin 时, 即以如下格式
-o 选项.-o 选项为 -o all.-o 选项为 -o hw.调用时会打印以下报错
Failed to start monitoring