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 8B86745501; Wed, 26 Jun 2024 21:51:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79E7A402D8; Wed, 26 Jun 2024 21:51:20 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id 9128E402D0 for ; Wed, 26 Jun 2024 21:51:18 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-707040e3018so4931550a12.1 for ; Wed, 26 Jun 2024 12:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1719431478; x=1720036278; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tPPuKr6LCllhaHZdHN6BZCc/6UjeBfVTsonjO8wUtHI=; b=VzeaoW5/bzHq+s8v+1Fv565FDVWMLao7XQZrud1Ew3/9n7ldWwpdZ52juufy/gTl3/ PRK1PQmOPVpQYI/uIjLjZmR/gBytEWqqFLt0qD/KM37QEh4jTNrR26mO19WEoTTEguzI UdJkduN3zbUczJG/w8GpqZvzCe17PwGbGBzNQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719431478; x=1720036278; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tPPuKr6LCllhaHZdHN6BZCc/6UjeBfVTsonjO8wUtHI=; b=Yby0SogDqPxy9cpBzNtP9/zK2w7ataByX3Nsl3upGGoF15G6DHkO1SjAJIr/v5RQUq 7Ot+ZiyIDTn7eAoNEqmHzO/0kSZasIzP0kdTRTbYqTATm4xv/GFrPIlXdAs7BNhQzYiZ y47yigPra4UMt01du5HtzzzgUUfpOjs14redH4d3IGFM9xOU46WIOHvt+YHqVA9y2awM NAXSF9mf1fdPGPpZ2ivmPYpxcogGjtusotqL4f44IQPns/7hCuxy/uPoG4xKGujQHPdE IIt8StolKuXgpbrwPsISSSIQZqjRmFEmsA7R4If/7qjr17uAPg+NceWLpexizVhKciYu tEBA== X-Forwarded-Encrypted: i=1; AJvYcCX50SSdDN/hFhgM0kplwAXTil5nJ20ONRi11UEqrcyBtmsGyHuqkHZiAfP0FMfR02bDzIRDJAJ5AkEv1Wg= X-Gm-Message-State: AOJu0YxKM0RxRcyuY1cd5ZnhWQjzehljv9jbbMcvJgooZbmjhRPu7oZN U/Q2H/upzUXIdm1MNr3gni7o4gaG8ih47T+s6hyzxwwYFyUq4gESTVYesgqadykMRwkviqgB6bp UUw6YrKflENcyNu4D0ltgxzmZsGRb2nexfP44VQ== X-Google-Smtp-Source: AGHT+IGZ1uvaIUTxOT1C+qsjwZoNn8nKx6RUxF/He+i32FUijiDyerLuE9owOt1IlshxMCod/bBZcxrzG3rnAciCbk4= X-Received: by 2002:a17:90a:b886:b0:2c8:de94:48d0 with SMTP id 98e67ed59e1d1-2c8de944945mr2188831a91.17.1719431477604; Wed, 26 Jun 2024 12:51:17 -0700 (PDT) MIME-Version: 1.0 References: <20240617194638.12926-2-dmarx@iol.unh.edu> <20240626135149.32557-1-dmarx@iol.unh.edu> <20240626135149.32557-2-dmarx@iol.unh.edu> In-Reply-To: <20240626135149.32557-2-dmarx@iol.unh.edu> From: Jeremy Spewock Date: Wed, 26 Jun 2024 15:51:06 -0400 Message-ID: Subject: Re: [PATCH v3 2/3] dts: add functions to testpmd shell To: Dean Marx Cc: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, bruce.richardson@intel.com, luca.vizzarro@arm.com, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Jun 26, 2024 at 9:52=E2=80=AFAM Dean Marx wrote= : > > added set promisc, set verbose, and port stop > commands to testpmd shell. > > Signed-off-by: Dean Marx > --- > dts/framework/remote_session/testpmd_shell.py | 157 +++++++++++++++--- > 1 file changed, 136 insertions(+), 21 deletions(-) > > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framewor= k/remote_session/testpmd_shell.py > index ec22f72221..a1928b2cec 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > @@ -645,27 +645,6 @@ def start(self, verify: bool =3D True) -> None: > "Not all ports came up after starting packet for= warding in testpmd." > ) > > - def stop(self, verify: bool =3D True) -> None: > - """Stop packet forwarding. > - > - Args: > - verify: If :data:`True` , the output of the stop command is = scanned to verify that > - forwarding was stopped successfully or not started. If n= either is found, it is > - considered an error. > - > - Raises: > - InteractiveCommandExecutionError: If `verify` is :data:`True= ` and the command to stop > - forwarding results in an error. > - """ > - stop_cmd_output =3D self.send_command("stop") > - if verify: > - if ( > - "Done." not in stop_cmd_output > - and "Packet forwarding not started" not in stop_cmd_outp= ut > - ): > - self._logger.debug(f"Failed to stop packet forwarding: \= n{stop_cmd_output}") > - raise InteractiveCommandExecutionError("Testpmd failed t= o stop packet forwarding.") > - Apologies, I didn't mean to remove the entire method from testpmd shell, I just mean the changes that were made to it in the last version. This method is still required since the scatter test suite uses it on main currently. The version that is on main should be fine though. > def get_devices(self) -> list[TestPmdDevice]: > """Get a list of device names that are known to testpmd. > > + def set_promisc_on(self, port: int, on: bool, verify: bool =3D True)= : I had some comments on this method in your VLAN series that still apply here. Seems like this method if needed in quite a few places, definitely good we're getting it added. > + """Turns promiscuous mode on/off for the specified port > + > + Args: > + port: port number to use, should be within 0-32. > + on: if :data:`True`, turn promisc mode on, otherwise turn of= f. > + verify: if :data:`True` an additional command will be sent t= o verify that promisc mode > + is properly set. Defaults to :data:`True`. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` and promisc mode > + is not correctly set. > + """ > + if on: > + promisc_output =3D self.send_command(f"set promisc {port} on= ") > + else: > + promisc_output =3D self.send_command(f"set promisc {port} of= f") > + if verify: > + if (on and "Promiscuous mode: enabled" not in > + self.send_command(f"show port info {port}")): > + self._logger.debug(f"Failed to set promisc mode on port = {port}: \n{promisc_output}") > + raise InteractiveCommandExecutionError(f"Testpmd failed = to set promisc mode on port {port}.") > + elif (not on and "Promiscuous mode: disabled" not in > + self.send_command(f"show port info {port}")): > + self._logger.debug(f"Failed to set promisc mode on port = {port}: \n{promisc_output}") > + raise InteractiveCommandExecutionError(f"Testpmd failed = to set promisc mode on port {port}.") > + > + > + def set_verbose(self, level: int, verify: bool =3D True): > + """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 I think in the VLAN suite series these lines got indented, we should probably also update this method to match what is there. > + verify: if :data:`True` an additional command will be sent t= o 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 =3D 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 {lev= el}: \n{verbose_output}") > + raise InteractiveCommandExecutionError(f"Testpmd failed = to set verbose level to {level}.") > + > def close(self) -> None: > """Overrides :meth:`~.interactive_shell.close`.""" > self.send_command("quit", "") > -- > 2.44.0 >