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 2AAB145807; Fri, 23 Aug 2024 21:34:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 942FB43385; Fri, 23 Aug 2024 21:34:43 +0200 (CEST) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by mails.dpdk.org (Postfix) with ESMTP id D18A640295 for ; Fri, 23 Aug 2024 21:34:41 +0200 (CEST) Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7a1e1f6a924so149640285a.1 for ; Fri, 23 Aug 2024 12:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724441681; x=1725046481; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SepikYRcNVCD56UNhypwDVD4FQ8v9eI84HfxprhphxI=; b=Y6O5k3WS4ALGs9Zfq5xfiHrB1g5ppQ6y3/RNUCiu7B2eEK6n74oEmMrdaSEQHjeleT yvHLz5sI22yhmuqgFuHjIznb4xryPTClRhHLI0IRgFQ2eLB7gRpDlSvs/yBE/wfLEQ4b CYDW7QEncfdafU4Iv64j9yhieSd4SRo8Z06NA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724441681; x=1725046481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SepikYRcNVCD56UNhypwDVD4FQ8v9eI84HfxprhphxI=; b=s7AXWXqbKNwlk+Am9qsB8q/cZF+LTOSA/mYAOMBZi0vU/qL+0c2MIs69V34gup10kW pCTd+Kk4eMJ0ZAdIJKnmssdLBTQJcUTjjjq8PI0/0Vlf5rQgNCwP88dlsoVe7kaqrxHr kyXKaugQm21JTZdktmWFdYh2UkT/G3z9a01xUFutFvYihn2x81Wft1Acr/ts+M7fkc/v CqwieZ3McbnLaxY0zsEsrUSqtAUkkVYpdheRAWws1e4hKEDAEDFDt9vnUc20u/QDzhg0 bHYLe+Jd2WTI21O2DIQeFT2yqy/V7ZX2UI3tE2tRL7JyQxurO6/4XMaVBN969YvqyUUG cSLg== X-Gm-Message-State: AOJu0YygTf2O+l5CWyNKGCOFNcf6OUfIYZmTb4+1GD5AoVe71jDXIt3s QT5/PcXzDCXw9dRtyYyekW+5t7Nw338BxmpoiLeZEQxecSU1iedgzIzTkzgXAOQ= X-Google-Smtp-Source: AGHT+IGi7BHes0/0AIqtjthGSen78kzawtGKU8mEb7MebbGvnUJ85mgBFcq1Ow8fWOBYu499syIAow== X-Received: by 2002:a05:620a:4144:b0:7a1:c426:d875 with SMTP id af79cd13be357-7a689724a32mr468775485a.39.1724441681026; Fri, 23 Aug 2024 12:34:41 -0700 (PDT) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a67f3fbdafsm207913285a.119.2024.08.23.12.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 12:34:40 -0700 (PDT) From: Dean Marx To: probb@iol.unh.edu, npratte@iol.unh.edu, jspewock@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Dean Marx Subject: [PATCH v1 1/2] dts: add VXLAN port method to testpmd shell Date: Fri, 23 Aug 2024 15:34:58 -0400 Message-ID: <20240823193459.23026-2-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240823193459.23026-1-dmarx@iol.unh.edu> References: <20240823193459.23026-1-dmarx@iol.unh.edu> 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 Add rx_vxlan_port add/rm method to testpmd shell for adding or removing a vxlan id to the specified port filter list. Port over set_verbose method from queue start/stop suite. Signed-off-by: Dean Marx --- dts/framework/remote_session/testpmd_shell.py | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index 7d0b5a374c..d802338d59 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1207,6 +1207,53 @@ def extract_verbose_output(output: str) -> list[TestPmdVerbosePacket]: out.append(TestPmdVerbosePacket.parse(f"{prev_header}\n{match.group('PACKET')}")) return out + def set_verbose(self, level: int, verify: bool = True) -> None: + """Set debug verbosity level. + + Args: + level: + 0: silent except for error. + 1: fully verbose except for Tx packets. + 2: fully verbose except for Rx packets. + >2: fully verbose. + verify: if :data:`True` an additional command will be sent to verify that verbose level + is properly set. Defaults to :data:`True`. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and verbose level + is not correctly set. + """ + verbose_output = self.send_command(f"set verbose {level}") + if verify: + if "Change verbose level" not in verbose_output: + self._logger.debug(f"Failed to set verbose level to {level}: \n{verbose_output}") + raise InteractiveCommandExecutionError( + f"Testpmd failed to set verbose level to {level}." + ) + + def rx_vxlan(self, vxlan_id: int, port_id: int, add: bool, verify: bool = True) -> None: + """Add or remove vxlan id to filter list. + + Args: + vxlan_id: Number of VXLAN ID to add to port filter list. + port_id: Number of port to add VXLAN ID to. + add: If :data:`True`, adds specified VXLAN ID, otherwise removes it. + verify: If :data:`True`, the output of the command is checked to verify + the VXLAN ID was successfully added/removed from the port. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and VXLAN ID + is not successfully added or removed. + """ + action = "add" if add else "rm" + vxlan_output = self.send_command(f"rx_vxlan_port {action} {vxlan_id} {port_id}") + if verify: + if "udp tunneling add error" in vxlan_output: + self._logger.debug(f"Failed to set VXLAN:\n{vxlan_output}") + raise InteractiveCommandExecutionError( + f"Failed to set VXLAN:\n{vxlan_output}" + ) + def _close(self) -> None: """Overrides :meth:`~.interactive_shell.close`.""" self.stop() -- 2.44.0