diff options
author | Tonghao Zhang <xiangxia.m.yue@gmail.com> | 2020-04-24 03:08:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-24 04:26:11 +0300 |
commit | eb58eebc7fb5e23c9cc7d557c0a9236630591526 (patch) | |
tree | 8c1a3c09ebc1b041f6abf4416a1c4b9382b2cc7b /net/openvswitch/meter.h | |
parent | c7c4c44c9a95d87e50ced38f7480e779cb472174 (diff) | |
download | linux-eb58eebc7fb5e23c9cc7d557c0a9236630591526.tar.xz |
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>
Diffstat (limited to 'net/openvswitch/meter.h')
-rw-r--r-- | net/openvswitch/meter.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/openvswitch/meter.h b/net/openvswitch/meter.h index f52052d30a16..61a3ca43cd77 100644 --- a/net/openvswitch/meter.h +++ b/net/openvswitch/meter.h @@ -20,6 +20,7 @@ struct datapath; #define DP_MAX_BANDS 1 #define DP_METER_ARRAY_SIZE_MIN BIT_ULL(10) +#define DP_METER_NUM_MAX (200000UL) struct dp_meter_band { u32 type; @@ -50,6 +51,7 @@ struct dp_meter_instance { struct dp_meter_table { struct dp_meter_instance __rcu *ti; u32 count; + u32 max_meters_allowed; }; extern struct genl_family dp_meter_genl_family; |