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 38168459CC; Wed, 18 Sep 2024 16:18:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1885642E9B; Wed, 18 Sep 2024 16:18:29 +0200 (CEST) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mails.dpdk.org (Postfix) with ESMTP id 8C5544003C for ; Wed, 18 Sep 2024 16:18:27 +0200 (CEST) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a7a81bd549eso828472466b.3 for ; Wed, 18 Sep 2024 07:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1726669107; x=1727273907; darn=dpdk.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PjKxKEtD4PelfpA0jJnPPkufXrLnOlLG78wedFxw9dk=; b=U+m/80WQYMmgHXlE3OHaWG4bmfrSYmWegaC6J1g7vsLAtZa5khMuGGvL62TSna2ENj fUXmZovWMJJILTg60v6EoPWJyau96+lZRCR4Rubk/Du4oWisOo7pljRMQrTDVWnbBEY4 +/w/VwH/5bveO5ORuVH5Ld5eBcdJkbjxN9hmvS6X8i+3pLBJHfOD5U/sTsvNh1aaS350 uBr2NmQ076kFQJbAcpGwZYLMe4aiziXfw/nMA/Mv0hkxmMDFz9QMQw39FVaFAnv/viWI 2OOdJSr2dMSicCSpuiw8AUjKkQ1XfCu7zxUZY0QVH2TLNFvYzi/qj+Bul8iZNinhXATC bhkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726669107; x=1727273907; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PjKxKEtD4PelfpA0jJnPPkufXrLnOlLG78wedFxw9dk=; b=RzYsnm/MIeB0znX9vNVHgsXKvU32mstpK9YPShisBy2mP7VZYwuKKb5njEwcq3Q9vg ZU3mYy3yOfXMgHLFDz4Q+DfhiO/lUoChQ8CG618/VmLy3z09NC9VSxC2Oy4l5dCMTfDc 36GDB9WIYkE+Hnwkk4BZVf1q+7NfTRr+um6Fwlq2GpwwN6s7W4etgPrLBay3DJx8q3Ju slRG2G6e1Knexm1JZYGD4597sLHGGhYOkDivzLbLQ9vYbQthNq2qhDhdBCxJ4IscbGNZ KXCgFRexa2TgpYoAncxHN40jy5W33DfleQhiS+AP6K8J0E3i7uLR3erSbK7CYuYbDYsa 5KqQ== X-Forwarded-Encrypted: i=1; AJvYcCW3N30fXauGp+VTwlvieG8T2VD0HCBhHJMXBUGToC/c/Dt6eZYYDH6z/Sgd9A+1oxDdGGs=@dpdk.org X-Gm-Message-State: AOJu0Yyzpa3+kfR2zikcN5XNA0F59HKDr8+Zx8o41SxpcCkEzWBqPaBA vo/VS5wgTFyrQLX5WAlm7oiXPb3Vmy5DUOymOtJWntrEO3hTDevgEtKkEi3RXITqJpAKgzytKM1 L5+k= X-Google-Smtp-Source: AGHT+IGimX8Pm0u/tDKUDLg7TQHr2HLguo9mk+zUHR56hC9z3/LaNkrKTB8/P1RyaRLwmfto8taVVw== X-Received: by 2002:a17:907:9618:b0:a86:ac9e:45fd with SMTP id a640c23a62f3a-a902974b93fmr2301874566b.62.1726669106843; Wed, 18 Sep 2024 07:18:26 -0700 (PDT) Received: from [192.168.200.22] ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612b3ba7sm595446466b.119.2024.09.18.07.18.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Sep 2024 07:18:26 -0700 (PDT) Message-ID: Date: Wed, 18 Sep 2024 16:18:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 11/12] dts: add Rx offload capabilities To: Jeremy Spewock Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, dmarx@iol.unh.edu, alex.chapman@arm.com, dev@dpdk.org References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240821145315.97974-1-juraj.linkes@pantheon.tech> <20240821145315.97974-12-juraj.linkes@pantheon.tech> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 26. 8. 2024 19:24, Jeremy Spewock wrote: > On Wed, Aug 21, 2024 at 10:53 AM Juraj Linkeš > wrote: > >> diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py >> index 48c31124d1..f83569669e 100644 >> --- a/dts/framework/remote_session/testpmd_shell.py >> +++ b/dts/framework/remote_session/testpmd_shell.py >> @@ -659,6 +659,103 @@ class TestPmdPortStats(TextParser): >> tx_bps: int = field(metadata=TextParser.find_int(r"Tx-bps:\s+(\d+)")) >> >> >> +class RxOffloadCapability(Flag): >> + """Rx offload capabilities of a device.""" >> + >> + #: >> + RX_OFFLOAD_VLAN_STRIP = auto() >> + #: Device supports L3 checksum offload. >> + RX_OFFLOAD_IPV4_CKSUM = auto() >> + #: Device supports L4 checksum offload. >> + RX_OFFLOAD_UDP_CKSUM = auto() >> + #: Device supports L4 checksum offload. >> + RX_OFFLOAD_TCP_CKSUM = auto() >> + #: Device supports Large Receive Offload. >> + RX_OFFLOAD_TCP_LRO = auto() >> + #: Device supports QinQ (queue in queue) offload. >> + RX_OFFLOAD_QINQ_STRIP = auto() >> + #: Device supports inner packet L3 checksum. >> + RX_OFFLOAD_OUTER_IPV4_CKSUM = auto() >> + #: Device supports MACsec. >> + RX_OFFLOAD_MACSEC_STRIP = auto() >> + #: Device supports filtering of a VLAN Tag identifier. >> + RX_OFFLOAD_VLAN_FILTER = 1 << 9 >> + #: Device supports VLAN offload. >> + RX_OFFLOAD_VLAN_EXTEND = auto() >> + #: Device supports receiving segmented mbufs. >> + RX_OFFLOAD_SCATTER = 1 << 13 > > I know you mentioned in the commit message that the auto() can cause > problems with mypy/sphinx, is that why this one is a specific value > instead? Regardless, I think we should probably make it consistent so > that either all of them are bit-shifts or none of them are unless > there is a specific reason that the scatter offload is different. > Since both you and Dean asked, I'll add something to the docstring about this. There are actually two non-auto values (RX_OFFLOAD_VLAN_FILTER = 1 << 9 is the first one). I used the actual values to mirror the flags in DPDK code. >> + #: Device supports Timestamp. >> + RX_OFFLOAD_TIMESTAMP = auto() >> + #: Device supports crypto processing while packet is received in NIC. >> + RX_OFFLOAD_SECURITY = auto() >> + #: Device supports CRC stripping. >> + RX_OFFLOAD_KEEP_CRC = auto() >> + #: Device supports L4 checksum offload. >> + RX_OFFLOAD_SCTP_CKSUM = auto() >> + #: Device supports inner packet L4 checksum. >> + RX_OFFLOAD_OUTER_UDP_CKSUM = auto() >> + #: Device supports RSS hashing. >> + RX_OFFLOAD_RSS_HASH = auto() >> + #: Device supports >> + RX_OFFLOAD_BUFFER_SPLIT = auto() >> + #: Device supports all checksum capabilities. >> + RX_OFFLOAD_CHECKSUM = RX_OFFLOAD_IPV4_CKSUM | RX_OFFLOAD_UDP_CKSUM | RX_OFFLOAD_TCP_CKSUM >> + #: Device supports all VLAN capabilities. >> + RX_OFFLOAD_VLAN = ( >> + RX_OFFLOAD_VLAN_STRIP >> + | RX_OFFLOAD_VLAN_FILTER >> + | RX_OFFLOAD_VLAN_EXTEND >> + | RX_OFFLOAD_QINQ_STRIP >> + ) > >> >> @@ -1048,6 +1145,42 @@ def _close(self) -> None: >> ====== Capability retrieval methods ====== >> """ >> >> + def get_capabilities_rx_offload( >> + self, >> + supported_capabilities: MutableSet["NicCapability"], >> + unsupported_capabilities: MutableSet["NicCapability"], >> + ) -> None: >> + """Get all rx offload capabilities 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._logger.debug("Getting rx offload capabilities.") >> + command = f"show port {self.ports[0].id} rx_offload capabilities" > > Is it desirable to only get the capabilities of the first port? In the > current framework I suppose it doesn't matter all that much since you > can only use the first few ports in the list of ports anyway, but will > there ever be a case where a test run has 2 different devices included > in the list of ports? Of course it's possible that it will happen, but > is it practical? Because, if so, then we would want this to aggregate > what all the devices are capable of and have capabilities basically > say "at least one of the ports in the list of ports is capable of > these things." > > This consideration also applies to the rxq info capability gathering as well. > No parts of the framework are adjusted to use multiple NIC in a single test run (because we assume we're testing only one NIC at a time). If we add this support, it's going to be a broader change. I approached this with the above assumption in mind and in that case, testing just one port of the NIC seemed just fine. >> + rx_offload_capabilities_out = self.send_command(command) >> + rx_offload_capabilities = RxOffloadCapabilities.parse(rx_offload_capabilities_out) >> + self._update_capabilities_from_flag( >> + supported_capabilities, >> + unsupported_capabilities, >> + RxOffloadCapability, >> + rx_offload_capabilities.per_port | rx_offload_capabilities.per_queue, >> + ) >> + > >> >> def __call__( >> self, >> diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSuite_pmd_buffer_scatter.py >> index 89ece2ef56..64c48b0793 100644 >> --- a/dts/tests/TestSuite_pmd_buffer_scatter.py >> +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py >> @@ -28,6 +28,7 @@ >> from framework.testbed_model.capability import NicCapability, requires >> >> >> +@requires(NicCapability.RX_OFFLOAD_SCATTER) > > I know that we talked about this and how, in the environments we > looked at, it was true that the offload was supported in all cases > where the "native" or non-offloaded was supported, but thinking about > this more, I wonder if it is worth generalizing this assumption to all > NICs or if we can just decorate the second test case that I wrote > which uses the offloaded support. As long as the capabilities exposed > by testpmd are accurate, even if this assumption was true, the > capability for the non-offloaded one would show False when this > offload wasn't usable and it would skip the test case anyway, so I > don't think we lose anything by not including this test-suite-level > requirement and making it more narrow to the test cases that require > it. > > Let me know your thoughts on that though and I would be interested to > hear if anyone else has any. > I'm not sure I understand what your point is. Let's talk about it in the call. >> class TestPmdBufferScatter(TestSuite): >> """DPDK PMD packet scattering test suite. >> >> -- >> 2.34.1 >>