From df5c293642cc07013e796e588eb7aead917e20a1 Mon Sep 17 00:00:00 2001 From: Tonghao Zhang Date: Mon, 16 Mar 2020 05:56:03 +0800 Subject: [PATCH] dpif-netdev: Delete the artificial flow limit. The MAX_FLOWS constant was there from the introduction of dpif-netdev, however, later new flow-limit mechanism was implemented that controls number of datapath flows in a dynamic way on ofproto level. So, we can just remove the limit and fully rely on ofproto to decide what flow limit we need. There are no limitations for flow table size in dpif-netdev beside the artificial one. 'other_config:flow-limit' seems suitable to control this. Suggested-by: Ilya Maximets Signed-off-by: Tonghao Zhang Signed-off-by: Ilya Maximets --- NEWS | 3 +++ lib/dpif-netdev.c | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 0116b3ea0..ac992d17f 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,9 @@ Post-v2.13.0 * New netdev class 'afxdp-nonpmd' for netdev-afxdp to save CPU cycles by enabling interrupt mode. - Userspace datapath: + * Removed artificial datapath flow limit that was 65536. + Now number of datapath flows is fully controlled by revalidators and the + 'other_config:flow-limit' knob. * Add support for conntrack zone-based timeout policy. * New configuration knob 'other_config:lb-output-action' for bond ports that enables new datapath action 'lb_output' to avoid recirculation diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 1086efd47..cd349c4a4 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -98,7 +98,6 @@ DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0) #define DEFAULT_TX_FLUSH_INTERVAL 0 /* Configuration parameters. */ -enum { MAX_FLOWS = 65536 }; /* Maximum number of flows in flow table. */ enum { MAX_METERS = 65536 }; /* Maximum number of meters. */ enum { MAX_BANDS = 8 }; /* Maximum number of bands / meter. */ enum { N_METER_LOCKS = 64 }; /* Maximum number of meters. */ @@ -3527,13 +3526,8 @@ flow_put_on_pmd(struct dp_netdev_pmd_thread *pmd, netdev_flow = dp_netdev_pmd_lookup_flow(pmd, key, NULL); if (!netdev_flow) { if (put->flags & DPIF_FP_CREATE) { - if (cmap_count(&pmd->flow_table) < MAX_FLOWS) { - dp_netdev_flow_add(pmd, match, ufid, put->actions, - put->actions_len); - error = 0; - } else { - error = EFBIG; - } + dp_netdev_flow_add(pmd, match, ufid, put->actions, + put->actions_len); } else { error = ENOENT; }