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 0CFA7454A7; Wed, 19 Jun 2024 10:51:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD7D740693; Wed, 19 Jun 2024 10:51:31 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id 7474D4021D for ; Wed, 19 Jun 2024 10:51:30 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-52c9034860dso8006281e87.2 for ; Wed, 19 Jun 2024 01:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1718787090; x=1719391890; 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=b3VbkLY2fO+Oxx9cMwnaOKA+evbaJwO33JUqzoaEwuc=; b=OF3ss4IQ/30uFNZqSIIbM5ZSEhJLbfFTOx3VbohSijkdqpsKLZQKUB/kluictM/e7/ yPbzIie+BoTpo0ofGex6VLDCBj4FAv0mPzRWI8TSPo/RaZgI5aGtQPan927DQRYGsmcY zOFc6EUN3AtjdjScDpeIoLaJ6tV3f0p6MdYmyQ5G99P5I2ksu+FXry8du/QpNBs4fpV9 01bpvEgh20mAOkiglmEhU/O9kxTrHbQIlR3zd6T90HO2nFs4Aed0sjzqZgbfOyU7LoWU 8X2SAuuGvO+kPQVP46kGtLx9yD2Hd3CZjsdaPekdHPg8p4eZCRGbZ30W7LDjpBHLklqY wypA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718787090; x=1719391890; 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=b3VbkLY2fO+Oxx9cMwnaOKA+evbaJwO33JUqzoaEwuc=; b=pwETIHavTc/jvNxfUtcU19Lb89qszwwXbKrwApgpPqA8DLCTm89enWSvunnDufYBgN BBtjDoe1maEmZuz5TF+d/5ZmrJiffHCCldOgLR2Uwy1wxCWqB6p5WhF2uoc2NjiFKHRO rzfVnUjv18ds6fT8nOKQm5edOC6oM0s9NyyU+WmVBZNh30cKYxFb8zqpYXC3Rv9vtWIU Jf4qLDQF6lFX1BN3867dL/ftCbjfW0Dfm9pFyLUIWwpjaMsmk6UvI9+0THLHOIxDmsMN egfXJTem8r6+K6DJHu7066Drolf+pyavvaWBQf/FXFvH4C0fyprLDjjIlQmjOd7mcj0d zbXw== X-Gm-Message-State: AOJu0YweHcdNCq9UoebNeQHyPYjpQpF8ZnMDvaBy3IzKztc3dmDge9b2 28cvGlwKTs7GNrhnB+3yonPf+BMUZF6UXkFH9P7i32D/n2XTUAmq1h9YxnrEHeA= X-Google-Smtp-Source: AGHT+IHpXa947AFlxU17dSYRj3dV29xwrV94WBHF6qCj6gFYrpnr12N0rdUTpbQqiJf+3ZxTEIXMcQ== X-Received: by 2002:a05:6512:3195:b0:521:cc8a:46dd with SMTP id 2adb3069b0e04-52ccaa2a857mr1675087e87.11.1718787089758; Wed, 19 Jun 2024 01:51:29 -0700 (PDT) Received: from [192.168.1.113] ([84.245.121.236]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f3d07asm660900366b.144.2024.06.19.01.51.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jun 2024 01:51:29 -0700 (PDT) Message-ID: <1f919017-0a1b-400b-9aae-441186db954c@pantheon.tech> Date: Wed, 19 Jun 2024 10:51:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/4] dts: add test case that utilizes offload to pmd_buffer_scatter To: jspewock@iol.unh.edu, probb@iol.unh.edu, yoan.picchi@foss.arm.com, npratte@iol.unh.edu, Honnappa.Nagarahalli@arm.com, wathsala.vithanage@arm.com, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, thomas@monjalon.net Cc: dev@dpdk.org References: <20240514201436.2496-1-jspewock@iol.unh.edu> <20240613181510.30135-1-jspewock@iol.unh.edu> <20240613181510.30135-5-jspewock@iol.unh.edu> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: <20240613181510.30135-5-jspewock@iol.unh.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > - def scatter_pktgen_send_packet(self, pktsize: int) -> str: > + def scatter_pktgen_send_packet(self, pktsize: int) -> list[Packet]: A note: We should make this method a part of TestSuite (so that we have a common way to filter packets across all test suites) in a separate patchset as part of https://bugs.dpdk.org/show_bug.cgi?id=1438. > """Generate and send a packet to the SUT then capture what is forwarded back. > > Generate an IP packet of a specific length and send it to the SUT, > - then capture the resulting received packet and extract its payload. > - The desired length of the packet is met by packing its payload > + then capture the resulting received packets and filter them down to the ones that have the > + correct layers. The desired length of the packet is met by packing its payload > with the letter "X" in hexadecimal. > > Args: > pktsize: Size of the packet to generate and send. > > Returns: > - The payload of the received packet as a string. > + The filtered down list of received packets. > """ > with testpmd_shell as testpmd: > testpmd.set_forward_mode(TestPmdForwardingModes.mac) > + # adjust the MTU of the SUT ports > + for port_id in range(testpmd.number_of_ports): > + testpmd.set_port_mtu(port_id, 9000) For a second I thought about maybe somehow using the decorator from the previous patch, but that only works with testpmd methods. But then I thought about us setting this multiple times (twice (9000, then back to 1500) in each test case) and that a "better" place to put this would be set_up_suite() (and tear_down_suite()), but that has a major downside of starting testpmd two more times. Having it all in one place in set_up_suite() would surely make the whole test suite more understandable, but starting testpmd multiple times is not ideal. Maybe we have to do it like in this patch. I also noticed that we don't really document why we're setting MTU to 9000. The relation between MTU and mbuf size (I think that relation is the reason, correct me if I'm wrong) should be better documented, probably in set_up_suite(). > testpmd.start() > > for offset in [-1, 0, 1, 4, 5]: > - recv_payload = self.scatter_pktgen_send_packet(mbsize + offset) > - self._logger.debug( > - f"Payload of scattered packet after forwarding: \n{recv_payload}" > - ) > + recv_packets = self.scatter_pktgen_send_packet(mbsize + offset) > + self._logger.debug(f"Relevant captured packets: \n{recv_packets}") > + > self.verify( > - ("58 " * 8).strip() in recv_payload, > + any( > + " ".join(["58"] * 8) in hexstr(pakt.getlayer(2), onlyhex=1) > + for pakt in recv_packets > + ), > "Payload of scattered packet did not match expected payload with offset " > f"{offset}.", > ) > + testpmd.stop() This sneaked right back in.