提交 80cebed8 编写于 作者: I Ido Schimmel 提交者: David S. Miller

drop_monitor: Consider all monitoring states before performing configuration

The drop monitor configuration (e.g., alert mode) is global, but user
will be able to enable monitoring of only software or hardware drops.

Therefore, ensure that monitoring of both software and hardware drops are
disabled before allowing drop monitor configuration to take place.
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Acked-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 edd3d007
......@@ -633,6 +633,11 @@ static int set_all_monitor_traces(int state, struct netlink_ext_ack *extack)
return rc;
}
static bool net_dm_is_monitoring(void)
{
return trace_state == TRACE_ON || monitor_hw;
}
static int net_dm_alert_mode_get_from_info(struct genl_info *info,
enum net_dm_alert_mode *p_alert_mode)
{
......@@ -694,8 +699,8 @@ static int net_dm_cmd_config(struct sk_buff *skb,
struct netlink_ext_ack *extack = info->extack;
int rc;
if (trace_state == TRACE_ON) {
NL_SET_ERR_MSG_MOD(extack, "Cannot configure drop monitor while tracing is on");
if (net_dm_is_monitoring()) {
NL_SET_ERR_MSG_MOD(extack, "Cannot configure drop monitor during monitoring");
return -EBUSY;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册