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 2CBC645A37; Thu, 26 Sep 2024 12:13:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7556402AE; Thu, 26 Sep 2024 12:13:19 +0200 (CEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mails.dpdk.org (Postfix) with ESMTP id 894774025D for ; Thu, 26 Sep 2024 12:13:18 +0200 (CEST) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2f761cfa5e6so9504231fa.0 for ; Thu, 26 Sep 2024 03:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1727345598; x=1727950398; 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=fN2+E0EDHZ8XZowWi1qGCGjr0pgOYDzPH3ARLFm3+Hs=; b=Z0w93InRIEGZoxT6qQM5u62S02HQCkVR7N1gTCOvnm5aLszaB/1bMRxoQts8qWAHvF rN2g48AqwAtHLbirbZe7YF6L4hR7x1pcEWLrT5j1lAFL5TRb7oBvupshUFR6rZpLwro7 b35fwiqJMyt7eSkMfIlmlHkT5GKculr9YE0I1r3MCt6zugDN1JZLsCHutjpIb/MATFej cn0sByc1jKNdefyGfEYrUSh4XIPkEWHINbL6XAQftIFaknhFVs+tbANlJIxcqc/vrcaP oyEoK29giCAkGUDg56bDtTomfBe+bZJlYesyRKO2IOyfQH5Ojus3CGFb1qv0Pl4D1d9P I3Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727345598; x=1727950398; 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=fN2+E0EDHZ8XZowWi1qGCGjr0pgOYDzPH3ARLFm3+Hs=; b=Maj2kBZ/OPtUdCSInmD1l8cwBgbOQIGj0PC3MMp3St0mlPPvdJE6o57fn62EQHYlt5 CyVLY7LOGR4hJPR3MnJLE/0VSLiVctvuumTG5qyTYe5dMch8CuE1xkx5nqirbTRIUkhq rsonulsxb09xnNUukUh47lZik74VhhQT2DNPbXm3kK96+vhB9jk1w5ThVi8WIQKrQQic o2CD/8T7/oreXnJAcLMpeyCRQXIoKWIdLoBxtet6+TIb40AUhUGIBCo15duCbl/pqT6R vtCVwkT0pCFyOENkM2dvKWs6smimkTGVB7u1ROfF+lXz00sPDi4zcj68RLgs3+zKMvKN 6WfA== X-Forwarded-Encrypted: i=1; AJvYcCVNHh+6CZ1HRpfGqk3tSWkAzhLVW006JOoYZYJCBMpy0mbtmsE18BHK3hzExgmKwVvURcQ=@dpdk.org X-Gm-Message-State: AOJu0YymaQ+uvmZX0jhNKXolykKGpDRLcRQEg0flbSTQiwhGFLKsjtMh yKBxA7LNjtRWcXWriDfBFv+whdhwfLo4TKVrSDg+LjPw0w0gXWJJPB+nacuuJws= X-Google-Smtp-Source: AGHT+IFHYi+h7NRcIAf3waRb0krxrqT9RPeoBggORF972wItyTLfcmixW6DjChnSotpXM51QvLBJYQ== X-Received: by 2002:a2e:619:0:b0:2f6:4f17:aeaf with SMTP id 38308e7fff4ca-2f91ca70240mr21859661fa.45.1727345597585; Thu, 26 Sep 2024 03:13:17 -0700 (PDT) Received: from [192.168.200.22] ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf497174sm2926394a12.23.2024.09.26.03.13.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2024 03:13:17 -0700 (PDT) Message-ID: Date: Thu, 26 Sep 2024 12:13:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] dts: add send_packets to test suites and rework packet addressing To: Jeremy Spewock Cc: paul.szczepanek@arm.com, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, alex.chapman@arm.com, thomas@monjalon.net, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, yoan.picchi@foss.arm.com, wathsala.vithanage@arm.com, dev@dpdk.org References: <20240904152827.11914-1-jspewock@iol.unh.edu> <20240920180852.34792-1-jspewock@iol.unh.edu> <20240920180852.34792-2-jspewock@iol.unh.edu> 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: 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 >>> diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py >> >>> @@ -243,41 +255,74 @@ def get_expected_packet(self, packet: Packet) -> Packet: >>> Returns: >>> `packet` with injected L2/L3 addresses. >>> """ >>> - return self._adjust_addresses(packet, expected=True) >>> + return self._adjust_addresses([packet], expected=True)[0] >>> >>> - def _adjust_addresses(self, packet: Packet, expected: bool = False) -> Packet: >>> + def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]: >>> """L2 and L3 address additions in both directions. >>> >>> + Packets in `packets` will be directly modified in this method. The returned list of packets >>> + however will be copies of the modified packets in order to keep the two lists distinct. >>> + >> >> Do we need to do this? I guess you needed this in a test suite - what is >> the reason? > > This is actually just me documenting something that was already > happening behind the scenes in this method that I thought would be > helpful for people to know. Right now this method ends in > `Ether(packet.build())` which essentially just copies the packet, but > it does so after the modifications were made. I think there is some > logical reason to do this Ah, ok, this only documents what already existed. I think this was here because packet.build() doesn't return a Packet so a conversion is needed. The intention is not to keep the two lists distinct. > which is this method is called internally in > the framework, so it allows the send methods where these packets are > used to essentially modify the list and do whatever they want to/need > to to get the packets sent There are two usages for this method: 1. To update the packet before it's sent out (so that the proper addresses are used), 2. To update a packet, constructed in a test case, that we expect to receive, so as to compare with actual received packets. This is used in the OS UDP test case which checks that the MAC addresses are updated properly (and IP addresses stay the same). > and the only change that is reflected on > the user is the addresses are added. >