From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19FFD45CF8; Wed, 13 Nov 2024 17:25:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54D2D40A87; Wed, 13 Nov 2024 17:25:27 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 5F3AF4025E for ; Wed, 13 Nov 2024 17:25:25 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 92203150C; Wed, 13 Nov 2024 08:25:54 -0800 (PST) Received: from localhost.localdomain (unknown [10.57.58.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1491F3F66E; Wed, 13 Nov 2024 08:25:23 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org Cc: Paul Szczepanek , Patrick Robb , Luca Vizzarro Subject: [PATCH v4 1/3] dts: allow to get multiple expected packets Date: Wed, 13 Nov 2024 16:25:13 +0000 Message-ID: <20241113162518.643764-2-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241113162518.643764-1-luca.vizzarro@arm.com> References: <20240806125140.2582859-1-luca.vizzarro@arm.com> <20241113162518.643764-1-luca.vizzarro@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org At the moment there is only one facility that allows to prepare a packet as it is expected to be received on the traffic generator end. Extend this to allow to prepare multiple packets at the same time. Signed-off-by: Luca Vizzarro Reviewed-by: Paul Szczepanek --- dts/framework/test_suite.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 5b3e7c205e..23fe41a10e 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -310,16 +310,31 @@ def send_packets( packets = self._adjust_addresses(packets) self.tg_node.send_packets(packets, self._tg_port_egress) + def get_expected_packets(self, packets: list[Packet]) -> list[Packet]: + """Inject the proper L2/L3 addresses into `packets`. + + Inject the L2/L3 addresses expected at the receiving end of the traffic generator. + + Args: + packets: The packets to modify. + + Returns: + `packets` with injected L2/L3 addresses. + """ + return self._adjust_addresses(packets, expected=True) + def get_expected_packet(self, packet: Packet) -> Packet: """Inject the proper L2/L3 addresses into `packet`. + Inject the L2/L3 addresses expected at the receiving end of the traffic generator. + Args: packet: The packet to modify. Returns: `packet` with injected L2/L3 addresses. """ - return self._adjust_addresses([packet], expected=True)[0] + return self.get_expected_packet([packet])[0] def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]: """L2 and L3 address additions in both directions. -- 2.43.0