summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2023-02-27 16:30:11 +0100
committerIlya Maximets <i.maximets@ovn.org>2023-03-03 22:27:37 +0100
commitbfc0d5da350775f9872b57817169eaf146fb5461 (patch)
tree031d37a4ac5c8c83b0e1ea42feccdf7c75894e2a /ofproto
parent4d69c19000357812fcbe8202a10822d57ac9cc43 (diff)
downloadopenvswitch-bfc0d5da350775f9872b57817169eaf146fb5461.tar.gz
ofproto-dpif-upcall: Include hardware offloaded flows in total flows.
The revalidator process uses the internal call udpif_get_n_flows() to get the total number of flows installed in the system. It uses this value for various decisions on flow installation and removal. With the tc offload this values is incorrect, as the hardware offloaded are not included. With rte_flow offload this is not a problem as dpif netdev keeps both in sync. This patch will include the hardware offloaded flows if the underlying dpif implementation is not syncing them. Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-upcall.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 4031e766f..06873d477 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -785,6 +785,17 @@ udpif_get_n_flows(struct udpif *udpif)
atomic_store_relaxed(&udpif->n_flows_timestamp, now);
dpif_get_dp_stats(udpif->dpif, &stats);
flow_count = stats.n_flows;
+
+ if (!dpif_synced_dp_layers(udpif->dpif)) {
+ /* If the dpif layer does not sync the flows, we need to include
+ * the hardware offloaded flows separately. */
+ uint64_t hw_flows;
+
+ if (!dpif_get_n_offloaded_flows(udpif->dpif, &hw_flows)) {
+ flow_count += hw_flows;
+ }
+ }
+
atomic_store_relaxed(&udpif->n_flows, flow_count);
ovs_mutex_unlock(&udpif->n_flows_mutex);
} else {