net: openvswitch: set max limitation to meters
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Fri, 24 Apr 2020 00:08:03 +0000 (08:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Apr 2020 01:26:11 +0000 (18:26 -0700)
commiteb58eebc7fb5e23c9cc7d557c0a9236630591526
tree8c1a3c09ebc1b041f6abf4416a1c4b9382b2cc7b
parentc7c4c44c9a95d87e50ced38f7480e779cb472174
net: openvswitch: set max limitation to meters

Don't allow user to create meter unlimitedly, which may cause
to consume a large amount of kernel memory. The max number
supported is decided by physical memory and 20K meters as default.

Cc: Pravin B Shelar <pshelar@ovn.org>
Cc: Andy Zhou <azhou@ovn.org>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/meter.c
net/openvswitch/meter.h