A conntrack flush that matches on mark, labels or a partial tuple stops at the first entry that is gone by the time it is deleted, and leaves the rest in the connection tracker. Whatever goes wrong, the controller that asked for the flush is not told.
v1 was a single patch [1]. This version follows the review by Aaron Conole. Patch 1 rate limits the "Tuple not found" log of the userspace connection tracker, which the flush loop could repeat for every connection once it no longer stops at the first one. It comes before the fix, as a patch of its own, so that no point of the series can flood the log. Patch 2 is the fix. Only ENOENT keeps the flush going. Any other error ends it, as before; v1 carried on after every error. The patch adds a test. Neither datapath can lose an entry between the dump and the delete on demand, so the test has a small datapath of its own. Patch 3 reports the result of NXT_CT_FLUSH and NXT_CT_FLUSH_ZONE to the controller, which v1 only pointed out. Two things in it are choices that I would like opinions on: - It adds two errors, NXCTF_NOT_SUPPORTED and NXCTF_FAILED, and does not reuse an existing one. The commit message has the reasons. - A controller now gets an error reply where it got nothing. ovn-controller logs an OpenFlow error that it does not expect at info level and reconnects to the switch (ofctrl_recv(), since OVN commit 82b90fa5c006 "controller: Handle OpenFlow errors."). With this series the two cases that happen in normal operation produce no error: an entry that is already gone, and a 5-tuple that matches nothing. What is left is a datapath that fails the flush, like ENOBUFS, or that cannot do it. If a reconnect is too much for those, OVN can handle the two new errors on its side. Tested with "make check", and with the kernel datapath by hand for what the testsuite cannot trigger (details in patches 2 and 3). [1] https://patchwork.ozlabs.org/project/openvswitch/patch/5b59ff8835fb53d08003393ac72180401c6636cf.1795359264.git.forq...@iteasy.co.kr/ Bekei Park (3): conntrack: Rate limit the log for a tuple that is not found. ct-dpif: Do not stop a partial match flush on ENOENT. ofproto: Report a failed conntrack flush to the controller. NEWS | 4 + include/openvswitch/ofp-errors.h | 14 +++ lib/conntrack.c | 4 +- lib/ct-dpif.c | 6 +- ofproto/ofproto-dpif.c | 4 +- ofproto/ofproto-provider.h | 10 +- ofproto/ofproto.c | 42 ++++--- tests/automake.mk | 1 + tests/library.at | 12 ++ tests/ofp-errors.at | 35 ++++++ tests/test-ct-dpif.c | 195 +++++++++++++++++++++++++++++++ 11 files changed, 306 insertions(+), 21 deletions(-) create mode 100644 tests/test-ct-dpif.c base-commit: e77c3bac93f5f62234e5e586b6b02488a43e4557 -- 2.43.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
