linux/net
Yi-Hung Wei 11efd5cb04 openvswitch: Support conntrack zone limit
Currently, nf_conntrack_max is used to limit the maximum number of
conntrack entries in the conntrack table for every network namespace.
For the VMs and containers that reside in the same namespace,
they share the same conntrack table, and the total # of conntrack entries
for all the VMs and containers are limited by nf_conntrack_max.  In this
case, if one of the VM/container abuses the usage the conntrack entries,
it blocks the others from committing valid conntrack entries into the
conntrack table.  Even if we can possibly put the VM in different network
namespace, the current nf_conntrack_max configuration is kind of rigid
that we cannot limit different VM/container to have different # conntrack
entries.

To address the aforementioned issue, this patch proposes to have a
fine-grained mechanism that could further limit the # of conntrack entries
per-zone.  For example, we can designate different zone to different VM,
and set conntrack limit to each zone.  By providing this isolation, a
mis-behaved VM only consumes the conntrack entries in its own zone, and
it will not influence other well-behaved VMs.  Moreover, the users can
set various conntrack limit to different zone based on their preference.

The proposed implementation utilizes Netfilter's nf_conncount backend
to count the number of connections in a particular zone.  If the number of
connection is above a configured limitation, ovs will return ENOMEM to the
userspace.  If userspace does not configure the zone limit, the limit
defaults to zero that is no limitation, which is backward compatible to
the behavior without this patch.

The following high leve APIs are provided to the userspace:
  - OVS_CT_LIMIT_CMD_SET:
    * set default connection limit for all zones
    * set the connection limit for a particular zone
  - OVS_CT_LIMIT_CMD_DEL:
    * remove the connection limit for a particular zone
  - OVS_CT_LIMIT_CMD_GET:
    * get the default connection limit for all zones
    * get the connection limit for a particular zone

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-05-25 16:45:19 -04:00
..
6lowpan
9p Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-11 20:53:22 -04:00
802
8021q vlan: Add extack messages for link create 2018-05-17 17:08:55 -04:00
appletalk
atm net: atm: Fix potential Spectre v1 2018-05-04 12:52:47 -04:00
ax25
batman-adv batman-adv: enable B.A.T.M.A.N. V compilation by default 2018-05-14 09:31:17 +02:00
bluetooth Bluetooth: Add __hci_cmd_send function 2018-05-18 06:37:52 +02:00
bpf
bpfilter bpfilter: don't pass O_CREAT when opening console for debug 2018-05-24 09:36:49 -04:00
bridge net: bridge: add support for port isolation 2018-05-25 14:37:20 -04:00
caif
can
ceph libceph: add osd_req_op_extent_osd_data_bvecs() 2018-05-10 10:15:05 +02:00
core net/ipv6: Udate fib6_table_lookup tracepoint 2018-05-24 23:01:15 -04:00
dcb net/dcb: Add dcbnl buffer attribute 2018-05-24 14:22:59 -07:00
dccp dccp: fix tasklet usage 2018-05-03 15:14:57 -04:00
decnet
dns_resolver KEYS: DNS: limit the length of option strings 2018-04-17 13:42:58 -04:00
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
ethernet net: core: rework basic flow dissection helper 2018-05-08 00:02:36 -04:00
hsr
ieee802154
ife
ipv4 net/ipv4: Remove tracepoint in fib_validate_source 2018-05-24 23:01:15 -04:00
ipv6 net/ipv6: Udate fib6_table_lookup tracepoint 2018-05-24 23:01:15 -04:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc llc: better deal with too small mtu 2018-05-08 00:11:40 -04:00
mac80211 mac80211: Support adding duration for prepare_tx() callback 2018-05-23 11:06:10 +02:00
mac802154
mpls
ncsi net/ncsi: prevent a couple array underflows 2018-05-17 16:27:39 -04:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2018-05-23 16:37:11 -04:00
netlabel
netlink net/netlink: make sure the headers line up actual value output 2018-05-04 13:00:57 -04:00
netrom
nfc
nsh nsh: fix infinite loop 2018-05-04 12:54:38 -04:00
openvswitch openvswitch: Support conntrack zone limit 2018-05-25 16:45:19 -04:00
packet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
phonet
psample
qrtr
rds rds: do not leak kernel memory to user land 2018-05-03 11:26:14 -04:00
rfkill rfkill: Create rfkill-none LED trigger 2018-05-23 11:26:45 +02:00
rose
rxrpc rxrpc: Trace UDP transmission failure 2018-05-10 23:26:01 +01:00
sched net_sched: switch to rcu_work 2018-05-24 22:56:15 -04:00
sctp sctp: checkpatch fixups 2018-05-14 23:15:27 -04:00
smc net/smc: longer delay when freeing client link groups 2018-05-23 16:02:35 -04:00
strparser
sunrpc NFS client fixes for Linux 4.17-rc4 2018-05-11 13:56:43 -07:00
switchdev
tipc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-11 20:53:22 -04:00
tls Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
unix
vmw_vsock
wimax
wireless nl80211: Reject disconnect commands except from conn_owner 2018-05-23 11:56:26 +02:00
x25
xdp xsk: convert atomic_t to refcount_t 2018-05-22 10:25:06 +02:00
xfrm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-11 20:53:22 -04:00
compat.c
Kconfig net: add skeleton of bpfilter kernel module 2018-05-23 13:23:40 -04:00
Makefile net: add skeleton of bpfilter kernel module 2018-05-23 13:23:40 -04:00
socket.c
sysctl_net.c