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 05DE24609A; Thu, 16 Jan 2025 06:05:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDB504025F; Thu, 16 Jan 2025 06:05:17 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id E42D740156 for ; Thu, 16 Jan 2025 06:05:15 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2eed82ca5b4so977914a91.2 for ; Wed, 15 Jan 2025 21:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737003915; x=1737608715; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PygG9jXXDs1hYq7Mlw20mXipHnHG8iqhtzq9UsNwm3g=; b=elJp1UXadef0bWAPja3GwZ6JQ9e+8Y7z8Z9aPRy3g4dpMIHzMdBlDBfEKDNCm7Qvge e7v2ZWVev47FLZUEY/p+y/YtmNbDB9HgzQnGkquUHAdXy4vBD9Tx5kn1u+Hrnmbib85J cdcUTHZ34mCcV1rLTNY/O1J2h5XAFcFyPIyh4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737003915; x=1737608715; h=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=PygG9jXXDs1hYq7Mlw20mXipHnHG8iqhtzq9UsNwm3g=; b=wERMPIAszCCVpuBCTuvaw10lmDaxdpjDx9yPchxlzPijVHtQzfJh8WbAMfLA3HO5Oi rL10nc2cSVaAI7SredE9+d9+t/z/aumQbOOJi4ZHKgsuai61Vu0sVzzQbucZXKRcjyzl qiMlPWtI9E3S3Zx4YOykl1DC1rjBOk12mmBSaodze9Zo0UsLd+iD5dVh6L94h6j27xf8 JaMXii4qRb3AT+U4cfbJFO3IHH8tFB2kYu4JA5GxWYq4vLSM9WvlpyTrhENl5tApiDrE x9ON0TX8Cg1UIP/cTGMKKZp8uvo292F4RdZu6Hdb6ZTL5trTQoA7kl6BjPid6rfVq8Pv ZHfg== X-Forwarded-Encrypted: i=1; AJvYcCXu55oTJ3jRjqgKVJYAXbqqODa+L+7RKCRDQ9qpRHWJUDCPA4muyKXyE0vawYcHh69xDhE=@dpdk.org X-Gm-Message-State: AOJu0YxmzsoIoRCp/qTWKDfodwEna4QLTGYUYWtoyXPzs6rfYvshbqBH W9HckFJ9xVYtQjFsokLuwnGbx+02vVcEnHEsCPu4UMetEvXqq6x9l7J1zB0/K5QjvIrHiijtueM tiEBPAuqgCi+62RAXuQvk0MWYriXpCOOvpfZg6A== X-Gm-Gg: ASbGncu6r2QjBvffY/8owUVFy1ZK951vMmMvNHPhJyxWMpAUEeYq93bOUZ2avLjo4yI dp7+P8XaOc4B0oMQPfYRPXBELrP18d/59TLSL4P1J6TSvdImkZ/8kBg== X-Google-Smtp-Source: AGHT+IHBdbfvyYjiwN8S7hlXn+F3nGYESsnvcydayDkE5J1fYg3ym1sNE55MS3c3LPsgpTvlA1NlxOPghNSWZjRrYuU= X-Received: by 2002:a17:90b:3d50:b0:2ea:9ccb:d1f4 with SMTP id 98e67ed59e1d1-2f548e3c0demr54716869a91.0.1737003914877; Wed, 15 Jan 2025 21:05:14 -0800 (PST) MIME-Version: 1.0 References: <20241010202104.15364-2-dmarx@iol.unh.edu> <20250115162959.12975-1-dmarx@iol.unh.edu> <20250115162959.12975-2-dmarx@iol.unh.edu> In-Reply-To: <20250115162959.12975-2-dmarx@iol.unh.edu> From: Patrick Robb Date: Thu, 16 Jan 2025 00:02:25 -0500 X-Gm-Features: AbW1kvbLlsohrDJIxkEQPrqPzxq8ZQv6YDCbVj_vcb5D4fl7_kPfLoz6wUIhEjg Message-ID: Subject: Re: [PATCH v8 2/2] dts: port over dynamic config test suite To: Dean Marx Cc: npratte@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, dev@dpdk.org Content-Type: multipart/alternative; boundary="00000000000051fccf062bcbbd2c" 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 --00000000000051fccf062bcbbd2c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 15, 2025 at 11:30=E2=80=AFAM Dean Marx wrot= e: > + def disable_promisc_setup(self, testpmd: TestPmdShell, port_id: int) > -> TestPmdShell: > + """Sets up testpmd shell config for cases where promisc mode is > disabled. > + > + Args: > + testpmd: Testpmd session that is being configured. > + port_id: Port number to disable promisc mode on. > + > + Returns: > + TestPmdShell: interactive testpmd shell object. > I know we chatted about this way back, but I personally don't see the stylistic benefit of returning the Testpmd shell, and rewriting the testpmd instance via the return when calling disable_promisc_setup(). I think it reads cleaner if these methods are void methods. But of course it's functionally the same either way, so I'm being a little pedantic. There is no need to change this now, again particularly with what Luca has suggested we do with testpmd shell going forward. > + """ > + testpmd.start() > + testpmd.set_promisc(port=3Dport_id, enable=3DFalse) > + testpmd.set_forward_mode(SimpleForwardingModes.io) > + return testpmd > + > + @func_test > + def test_default_mode(self) -> None: > + """Tests default configuration. > + > + Creates a testpmd shell, verifies that promiscuous mode is > enabled by default, > + and sends two packets; one matching source MAC address and one > unknown. > + Verifies that both are received. > + """ > + with TestPmdShell(node=3Dself.sut_node) as testpmd: > + isPromisc =3D > testpmd.show_port_info(0).is_promiscuous_mode_enabled > + self.verify(isPromisc, "Promiscuous mode was not enabled by > default.") > isPromisc should be is_promisc > > -- > 2.44.0 > I will update the commit to change the camelcase to python variable style and merge. Thank you for the testsuite Dean! Reviewed-by: Patrick Robb --00000000000051fccf062bcbbd2c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Jan 15,= 2025 at 11:30=E2=80=AFAM Dean Marx <dmarx@iol.unh.edu> wrote:
+=C2=A0 =C2=A0 def disable_promisc_setup(self, testpmd: TestPmdShell, port_= id: int) -> TestPmdShell:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Sets up testpmd shell config= for cases where promisc mode is disabled.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd: Testpmd session that is= being configured.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 port_id: Port number to disable = promisc mode on.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Returns:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TestPmdShell: interactive testpm= d shell object.

I know we chatted about= this way back, but I personally don't see the stylistic benefit of ret= urning the Testpmd shell, and rewriting the testpmd instance via the return= when calling disable_promisc_setup(). I think it reads cleaner if these me= thods are void methods. But of course it's functionally the same either= way, so I'm being a little pedantic. There is no need to change this n= ow, again particularly with what Luca has suggested we do with testpmd shel= l going forward.
=C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.start()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.set_promisc(port=3Dport_id, enable=3DF= alse)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.set_forward_mode(SimpleForwardingModes= .io)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return testpmd
+
+=C2=A0 =C2=A0 @func_test
+=C2=A0 =C2=A0 def test_default_mode(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Tests default configuration.=
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Creates a testpmd shell, verifies that promisc= uous mode is enabled by default,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 and sends two packets; one matching source MAC= address and one unknown.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Verifies that both are received.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 with TestPmdShell(node=3Dself.sut_node) as tes= tpmd:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 isPromisc =3D testpmd.show_port_= info(0).is_promiscuous_mode_enabled
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(isPromisc, "Pro= miscuous mode was not enabled by default.")

<= /div>
isPromisc should be is_promisc
=C2=A0

--
2.44.0

I will update the commit to chan= ge the camelcase to python variable style and merge. Thank you for the test= suite Dean!

Reviewed-by: Patrick Robb <probb@iol.unh.edu>
--00000000000051fccf062bcbbd2c--