詹法风暴防护

詹法风暴防护

在运行 4.14 内核的 ls1021(ARMv7 处理器版本 5)上,我可以看到 gianfar 网络驱动程序的一些风暴保护参数。

/sys/devices/platform/soc/soc:ethernet@2d90000/net/eth0/stormprot_count    
/sys/devices/platform/soc/soc:ethernet@2d90000/net/eth0/stormprot_events    
/sys/devices/platform/soc/soc:ethernet@2d90000/net/eth0/stormprot_current    
/sys/devices/platform/soc/soc:ethernet@2d90000/net/eth0/stormprot_window    
/sys/devices/platform/soc/soc:ethernet@2d90000/net/eth0/stormprot_delay

它是如何工作的以及如何激活它?

答案1

FRAMEREJ_COUNT=60
FRAMEREJ_WINDOW=10
FRAMEREJ_DELAY=500
echo $FRAMEREJ_COUNT > /sys/class/net/eth1/stormprot_count
echo $FRAMEREJ_WINDOW > /sys/class/net/eth1/stormprot_window
echo $FRAMEREJ_DELAY > /sys/class/net/eth1/stormprot_delay

然后内核会在出现网络风暴时写入此内容,而不是重新启动

2020-07-30T13:39:15.255130+0200 kernel: kern.warn: net_ratelimit: 2540 callbacks suppressed
2020-07-30T13:39:15.255190+0200 kernel: kern.warn: br0: received packet on eth1 with own address as source address (addr:00:26:77:01:ea:7e, vlan:0)
2020-07-30T13:39:15.255199+0200 kernel: kern.warn: br0: received packet on eth1 with own address as source address (addr:00:26:77:01:ea:7e, vlan:0)

相关内容