On Fri, May 20, 2022 at 5:55 AM Han Ding <[email protected]> wrote: > > > Sometimes we need to dump packets on more than two interfaces in a bridge > at the same time. Then when we stop dumping in order, ovs-tcpdump print > traceback and fail to delete mirror interface for some interface. > > For example: > br-int has two interface tap1 and br-int. We use ovs-tcpdump dump tap1 first > and dump br-int next. Then stopping tap1 ovs-tcpdump first, and stopping > br-int second. When we stop ovs-tcpdump for br-int, the screen show the error > like this: > __main__.OVSDBException: Unable to delete Mirror m_br-int > > Signed-off-by: Han Ding <[email protected]>
I can confirm that this issue does occur, and this patch fixes it. Acked-by: Mike Pattrick <[email protected]> Small nit but instead of closing and reopening the OVSDB object, maybe we should just atexit.register the call to ovsdb.close_idl. Cheers, M > --- > utilities/ovs-tcpdump.in | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in > index 82d1bedfa..6188be5c4 100755 > --- a/utilities/ovs-tcpdump.in > +++ b/utilities/ovs-tcpdump.in > @@ -164,6 +164,9 @@ class OVSDB(object): > schema.register_all() > self._idl_conn = idl.Idl(db_sock, schema) > OVSDB.wait_for_db_change(self._idl_conn) # Initial Sync with DB > + > + def close_idl(self): > + self._idl_conn.close() > > def _get_schema(self): > error, strm = Stream.open_block(Stream.open(self._db_sock)) > @@ -500,6 +503,8 @@ def main(): > pass > sys.exit(1) > > + ovsdb.close_idl() > + > pipes = _doexec(*([dump_cmd, '-i', mirror_interface] + tcpdargs)) > try: > while pipes.poll() is None: > @@ -512,6 +517,7 @@ def main(): > if pipes.poll() is None: > pipes.terminate() > > + ovsdb = OVSDB(db_sock) > ovsdb.destroy_mirror(interface, ovsdb.port_bridge(interface)) > ovsdb.destroy_port(mirror_interface, ovsdb.port_bridge(interface)) > if tap_created is True: > -- > 2.27.0 > > > > > _______________________________________________ > dev mailing list > [email protected] > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
