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 2609E45A11; Mon, 23 Sep 2024 17:04:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6F6E40672; Mon, 23 Sep 2024 17:02:31 +0200 (CEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id 11CA340656 for ; Mon, 23 Sep 2024 17:02:28 +0200 (CEST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8d60e23b33so602245866b.0 for ; Mon, 23 Sep 2024 08:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1727103747; x=1727708547; 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=aX24QMpAIdKzjwDUrZ85GREvnFEDYfQ3V52dvD9VaWg=; b=XEi1vuQKbpngH/eSNzPNAFohUVkmOFJj0mqEYmDWQT/hDnpchXsj3tAk1LaeVNoJ0u bU6rVRkQBctT/tzOew3kSgT5Tf8mnyUfFcSoVKy0FVgmmmlCsxhxQVNx24Zw8bwAQijX sO/vCCNWpZ6X/wpe6WHp6nWxTeZ3fW1JiUp8deOxgDmSWMi1SGQhG6gYNqBYGLMgB4eo L4XDHG8rm+DIGgfx7kUigla5hGstbnA7OTwHeE4eDAf5H98ooYLK/QnJnqSD+NlERLRv MoBvZpRPUq1X0+4OJoA8+foF3uJt6G+AjCDwbQ2+aBE3gR9tKicN/3ruk/lmIVXZk1cJ gWig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727103747; x=1727708547; 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=aX24QMpAIdKzjwDUrZ85GREvnFEDYfQ3V52dvD9VaWg=; b=RErUCyb/Zc9jX7wijPdPDhyAY2Kc9hgmkwC7az2zw1kdSBRxkgpBD/frF16g5bbSu8 oY0MLfIiEQqvh4nJaKMe5WlRec4v/5FvN5hQlM4+BZf5UbAacfFl8X5mmVG3VGK1W0ep 0g9XLwXJ5zsteWt7Ofo7OQqk79mlRQjAlto+tZrfX0BftSeXPS0GllI/F/PmDPTe4tjW NS31drTQ+cSGApwnhMVMYSXwku+NUE6Fgb2PuVA0RpAv6X3ohVLAp2nRsJ67AzaCfEvS kkhsOGp9jgCZ2hAscKL/fDLFrWXVsY6TbeOdOppaSTjsxeh612sKRivjhX9+kluodo0g QZzA== X-Gm-Message-State: AOJu0YzGSoMVPPtqOO9OzpjVU+oH/gxkddg8seINmYMR6YsLJC4vF8Bk CvZRu6e0t6Gr61qoHxb1/imE8KHS/binBP7DhBRS1MCmtnNHd4Al2sMU2BLWaVw0O4KeO4aCscv famA= X-Google-Smtp-Source: AGHT+IGbsp7/G66FHJcNhBSDAKDQr/W1Xe7qJ6SvAH9kU2M/kPuF2KhYMG1Qf1bXQWaWr3CQCELfZQ== X-Received: by 2002:a17:907:f14f:b0:a8a:926a:d02a with SMTP id a640c23a62f3a-a90d577a4f4mr1161554166b.49.1727103747521; Mon, 23 Sep 2024 08:02:27 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.. ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3ba7sm1235318866b.119.2024.09.23.08.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 08:02:27 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, alex.chapman@arm.com, probb@iol.unh.edu, jspewock@iol.unh.edu, npratte@iol.unh.edu, dmarx@iol.unh.edu Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v4 11/11] dts: add NIC capabilities from show port info Date: Mon, 23 Sep 2024 17:02:10 +0200 Message-ID: <20240923150210.57269-11-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923150210.57269-1-juraj.linkes@pantheon.tech> References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240923150210.57269-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 the capabilities advertised by the testpmd command "show port info" so that test cases may be marked as requiring those capabilities: RUNTIME_RX_QUEUE_SETUP RUNTIME_TX_QUEUE_SETUP RXQ_SHARE FLOW_RULE_KEEP FLOW_SHARED_OBJECT_KEEP These names are copy pasted from the existing DeviceCapabilitiesFlag class. Dynamic addition of Enum members runs into problems with typing (mypy doesn't know about the members) and documentation generation (Sphinx doesn't know about the members). Signed-off-by: Juraj Linkeš Reviewed-by: Jeremy Spewock Reviewed-by: Dean Marx --- dts/framework/remote_session/testpmd_shell.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index e111a67663..60d017fc72 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -1279,6 +1279,24 @@ def get_capabilities_rxq_info( else: unsupported_capabilities.add(NicCapability.SCATTERED_RX_ENABLED) + def get_capabilities_show_port_info( + self, + supported_capabilities: MutableSet["NicCapability"], + unsupported_capabilities: MutableSet["NicCapability"], + ) -> None: + """Get all capabilities from show port info and divide them into supported and unsupported. + + Args: + supported_capabilities: Supported capabilities will be added to this set. + unsupported_capabilities: Unsupported capabilities will be added to this set. + """ + self._update_capabilities_from_flag( + supported_capabilities, + unsupported_capabilities, + DeviceCapabilitiesFlag, + self.ports[0].device_capabilities, + ) + class NicCapability(NoAliasEnum): """A mapping between capability names and the associated :class:`TestPmdShell` methods. @@ -1390,6 +1408,26 @@ class NicCapability(NoAliasEnum): RX_OFFLOAD_VLAN: TestPmdShellCapabilityMethod = functools.partial( TestPmdShell.get_capabilities_rx_offload ) + #: Device supports Rx queue setup after device started. + RUNTIME_RX_QUEUE_SETUP: TestPmdShellCapabilityMethod = functools.partial( + TestPmdShell.get_capabilities_show_port_info + ) + #: Device supports Tx queue setup after device started. + RUNTIME_TX_QUEUE_SETUP: TestPmdShellCapabilityMethod = functools.partial( + TestPmdShell.get_capabilities_show_port_info + ) + #: Device supports shared Rx queue among ports within Rx domain and switch domain. + RXQ_SHARE: TestPmdShellCapabilityMethod = functools.partial( + TestPmdShell.get_capabilities_show_port_info + ) + #: Device supports keeping flow rules across restart. + FLOW_RULE_KEEP: TestPmdShellCapabilityMethod = functools.partial( + TestPmdShell.get_capabilities_show_port_info + ) + #: Device supports keeping shared flow objects across restart. + FLOW_SHARED_OBJECT_KEEP: TestPmdShellCapabilityMethod = functools.partial( + TestPmdShell.get_capabilities_show_port_info + ) def __call__( self, -- 2.43.0