]> git.baikalelectronics.ru Git - kernel.git/commit
net: openvswitch: expand the meters supported number
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Fri, 24 Apr 2020 00:08:02 +0000 (08:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Apr 2020 01:26:11 +0000 (18:26 -0700)
commit41b09dbbef26c823add17462264330c457e224f9
tree24188e5afbec72cdc585128e9ae8eb996a84756d
parenta677f9db0282c8435407a84697764b12b9203af1
net: openvswitch: expand the meters supported number

In kernel datapath of Open vSwitch, there are only 1024
buckets of meter in one datapath. If installing more than
1024 (e.g. 8192) meters, it may lead to the performance drop.
But in some case, for example, Open vSwitch used as edge
gateway, there should be 20K at least, where meters used for
IP address bandwidth limitation.

[Open vSwitch userspace datapath has this issue too.]

For more scalable meter, this patch use meter array instead of
hash tables, and expand/shrink the array when necessary. So we
can install more meters than before in the datapath.
Introducing the struct *dp_meter_instance, it's easy to
expand meter though changing the *ti point in the struct
*dp_meter_table.

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/datapath.h
net/openvswitch/meter.c
net/openvswitch/meter.h