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 AFBAA45CB5; Fri, 8 Nov 2024 18:02:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11C704340F; Fri, 8 Nov 2024 18:01:49 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 523D043400 for ; Fri, 8 Nov 2024 18:01:47 +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 41190152B; Fri, 8 Nov 2024 09:02:16 -0800 (PST) Received: from localhost.localdomain (unknown [10.57.59.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9704C3F6A8; Fri, 8 Nov 2024 09:01:45 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org Cc: Paul Szczepanek , Patrick Robb , Luca Vizzarro Subject: [PATCH v3 2/3] dts: allow to get multiple expected packets Date: Fri, 8 Nov 2024 17:01:37 +0000 Message-ID: <20241108170138.203096-3-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241108170138.203096-1-luca.vizzarro@arm.com> References: <20240806125140.2582859-1-luca.vizzarro@arm.com> <20241108170138.203096-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