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 B9CFF43D6D; Thu, 28 Mar 2024 17:49:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CBD1410EE; Thu, 28 Mar 2024 17:49:08 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 20AA5410D5 for ; Thu, 28 Mar 2024 17:49:07 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-5c6bd3100fcso812632a12.3 for ; Thu, 28 Mar 2024 09:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1711644546; x=1712249346; 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=9FCOSItIH9x2/ZVc4atUpgKJ0T8SUdephdtV8uVNqYg=; b=WVPz7feUEqZ3gY5pZxi2NU+9MMxMtioaT/xeu4TBVx4v3tJTe63q5JZ1bFPRTDm423 M2PS4+VUm0StEKt6HrDlT3JkZn0QGP/YiLE0bjux06oOWUNEXFnggCZtgXqPQzN/rfG4 sEaxp7jp/YBpjQ09ozo4k39veE2z7cP1Jy3rk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711644546; x=1712249346; 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=9FCOSItIH9x2/ZVc4atUpgKJ0T8SUdephdtV8uVNqYg=; b=Hg0rcIsNR5zyfpBeUsGCIYCpKrYpca4QF3WDoMMWvTV6sixaAWLeonxvqa2Q+9jg+q tAocmOkhuew9srBz8HC9voe3TkiFBYAzGBoU0f1/m2gi6RvznBDz0t6NeznlPRpyMeqG FprpDQPIOZ97gYS6+aO6CRaExOKn5ia59i0n82i9MBVRMe0dL2w915AuqOh57Il9QIkS HIETIkj8XweY0xGiKTjBMgGA+b0m8rd/P07Z/VKqnKrEy1yWOa7bd/PdsMlf23okVfuF 9HiNN335ryp4V5MYeNpZq3g98ZZ1fMBpppX4CfiwUg068MNiAG/SzqWnU5Dz3OwGXKgU tymg== X-Gm-Message-State: AOJu0YySavqhlNogVBlzLRIN3wQgw6iPy3OC9RSeYkR80GOffPXLXNYA 8Nt05nv+GIpqXWNXLDGexqCbxOeyFi98nx1sCijiHXjxEJw29D6yyvPHMbgZTsB5DU45t9z8ieJ chmJXelv5Cn67ddCL06c46DpnGmtA9QsfuiC8QQ== X-Google-Smtp-Source: AGHT+IFfWRvcS35hkgGz2+jQBf9daQGYomnmfG4pwKmNqFUuQvq4RwZwscGv2oJ6hAfKc0h0J1IuHRza7JSHZzAgTNQ= X-Received: by 2002:a17:90a:71c6:b0:2a0:8d5f:b9fd with SMTP id m6-20020a17090a71c600b002a08d5fb9fdmr2531132pjs.47.1711644546304; Thu, 28 Mar 2024 09:49:06 -0700 (PDT) MIME-Version: 1.0 References: <20240326190422.577028-1-luca.vizzarro@arm.com> <20240326190422.577028-7-luca.vizzarro@arm.com> In-Reply-To: <20240326190422.577028-7-luca.vizzarro@arm.com> From: Jeremy Spewock Date: Thu, 28 Mar 2024 12:48:55 -0400 Message-ID: Subject: Re: [PATCH 6/6] dts: add statefulness to TestPmdShell To: Luca Vizzarro Cc: dev@dpdk.org, =?UTF-8?Q?Juraj_Linke=C5=A1?= , Jack Bond-Preston , Honnappa Nagarahalli 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 Tue, Mar 26, 2024 at 3:04=E2=80=AFPM Luca Vizzarro wrote: > > This commit provides a state container for TestPmdShell. It currently > only indicates whether the packet forwarding has started > or not, and the number of ports which were given to the shell. > > This also fixes the behaviour of `wait_link_status_up` to use the > command timeout as inherited from InteractiveShell. > > Signed-off-by: Luca Vizzarro > Reviewed-by: Jack Bond-Preston > Reviewed-by: Honnappa Nagarahalli > --- > @@ -723,7 +731,13 @@ def _start_application(self, get_privileged_command:= Callable[[str], str] | None > if self._app_args.app_params is None: > self._app_args.app_params =3D TestPmdParameters() > > - self.number_of_ports =3D len(self._app_args.ports) if self._app_= args.ports is not None else 0 > + assert isinstance(self._app_args.app_params, TestPmdParameters) > + This is tricky because ideally we wouldn't have the assertion here, but I understand why it is needed because Eal parameters have app args which can be any instance of params. I'm not sure of the best way to solve this, because making testpmd parameters extend from eal would break the general scheme that you have in place, and having an extension of EalParameters that enforces this app_args is TestPmdParameters would solve the issues, but might be a little clunky. Is there a way we can use a generic to get python to just understand that, in this case, this will always be TestPmdParameters? If not I might prefer making a private class where this is TestPmdParameters, just because there aren't really any other assertions that we use elsewhere and an unexpected exception from this (even though I don't think that can happen) could cause people some issues. It might be the case that an assertion is the easiest way to deal with it though, what do you think? > + if self._app_args.app_params.auto_start: > + self.state.packet_forwarding_started =3D True > + > + if self._app_args.ports is not None: > + self.state.number_of_ports =3D len(self._app_args.ports) > > super()._start_application(get_privileged_command) > > 2.34.1 >