From 5302eeabb757ccf710568a66b8f6435c1894cd4d Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 16 Jan 2023 12:45:25 +0100 Subject: feat(papi): add async mode, use it in scale calls + Introduce two explicit handling modes to save memory in scale test. + Connect in async mode for both handling modes (to avoid reconnects). + Support both pre- and post-37758 VPP PAPI async behavior. + Use control-ping in dumps to emulate sync mode. + Do not use it for single reply to avoid VPP-2033. + Fix call sites to get their replies with correct handling mode. + Drain enqueued replies to avoid subsequent errors. + Retry if read returns None too early. + Update docstrings. - Complexity issues reported by pylint postponed, needs larger refactor. - Explicit replace of VAT is done in subsequent changes. Ticket: CSIT-1547 CSIT-1671 Change-Id: I3c63fa5c578975cc4dd7fce0babe3ab04ec15ed3 Signed-off-by: Vratko Polak --- resources/libraries/python/IPUtil.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'resources/libraries/python/IPUtil.py') diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 4a5a413fc8..359bd1dce9 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -1,5 +1,5 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. -# Copyright (c) 2021 PANTHEON.tech s.r.o. +# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2023 PANTHEON.tech s.r.o. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -796,7 +796,7 @@ class IPUtil: ip_network(f"{network}/{prefix_len}", strict=strict), format=u"addr" ) - with PapiSocketExecutor(node) as papi_exec: + with PapiSocketExecutor(node, is_async=True) as papi_exec: for i in range(count): args[u"route"] = IPUtil.compose_vpp_route_structure( node, netiter.inc_fmt(), prefix_len, **kwargs -- cgit 1.2.3-korg