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 409D545849; Fri, 23 Aug 2024 12:17:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEB33402E6; Fri, 23 Aug 2024 12:17:18 +0200 (CEST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mails.dpdk.org (Postfix) with ESMTP id 60FDD402CA for ; Fri, 23 Aug 2024 12:17:16 +0200 (CEST) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5bed72ff2f2so2338227a12.2 for ; Fri, 23 Aug 2024 03:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1724408236; x=1725013036; 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=hWDymsMNtA7D9DA6zh82gJH64G45SjlnJ6PZ/xAMJzw=; b=bTBTzxmQkD07pB/6cqmqtBfjuggBd6c89/o2OZASRPTH0RboFTLSqD3tGCgJXjFAgc r5cBoLWBe9KxRsYnBWVhoRoRoWHSOYCDJW2XvhiS89RdlGVI4mZHudjKaH0Nhk7UoHy5 lSigeR9MeBxg1pd91eVO/cYP5LTCzYSkFTzFbG2h0GW0YTTYuf8Z4SPRkeKWDe8sZsO2 gVqcq4FphDdDBBJ77r6k6PkbP/V6JnfmpF1CWmKNPqN8pBW0XniPhZPzg6dhIGP6JYgH pS57+DzudgXr/P2Seji6AB9Oc1M5SQPlvf2ch7SzJ9OUfrfHkXudEzmpXF7ntjqOyEZV 4B+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724408236; x=1725013036; 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=hWDymsMNtA7D9DA6zh82gJH64G45SjlnJ6PZ/xAMJzw=; b=AvTsc+j2QUkZsIanGYwTgneakTKznio3pXmM65N0jTB2XKTOCcuK+0Tu9cHyCM4Wsd 3zPMADFncs+kWD7zfni3ThPSv0v3m1STGuBnm58fj/pnYv1F13jRj3vAKtluOKXKML7p e5dt5iRuc2nfHzCR/pzGyysCHmM73dfSJRXRaup43TPxo26AhuUgVvPjYuDjxs8SpDie +AnmKXq6yJDzwkA2zsAw6YNZOkN2ZiJaBXs8X+gH6ocTuw+IJboNt9wuRyHxNYaTylDm 26aOL3Esxe7cIQONOGKiCojs5HvwkuKVaXGp6gw5bdem+N97yKgcJ2cVerJhq02pm5GL sHYg== X-Forwarded-Encrypted: i=1; AJvYcCW2XaDB4QNp9EDAlIlkKYoYK037ioSdUnPpmoEEl3sGtmgBSmivAId2nd7K19ZU/qbuwjs=@dpdk.org X-Gm-Message-State: AOJu0YzFfwG4IY75aCJuHvrC8K6Ef4KYMI3I8CzSplLyBPQhZ34ZnsfG SYuYi9jZJg5jMfoL2lPOPF1I/FGqaCtfAt3cS4/xr65moVb+iU9h76m04jnWy4Q= X-Google-Smtp-Source: AGHT+IELOwXX3oBNDCYOl8pYOrtbsBZV0AhAdZNajKcixDLqYNNKrcNTReuapgJfKOr4ANAM9gA3OA== X-Received: by 2002:a17:907:36c8:b0:a86:92fa:cd1d with SMTP id a640c23a62f3a-a86a54aa610mr112511266b.49.1724408235906; Fri, 23 Aug 2024 03:17:15 -0700 (PDT) Received: from [192.168.200.22] ([84.245.121.107]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f4f3856sm237361966b.189.2024.08.23.03.17.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Aug 2024 03:17:15 -0700 (PDT) Message-ID: <0053d46d-331d-4d2e-9d97-0cb0a668d240@pantheon.tech> Date: Fri, 23 Aug 2024 12:17:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] dts: add ability to send/receive multiple packets To: Luca Vizzarro , dev@dpdk.org Cc: Jeremy Spewock , Honnappa Nagarahalli , Paul Szczepanek , Alex Chapman References: <20240806121417.2567708-1-Luca.Vizzarro@arm.com> <20240806124642.2580828-1-luca.vizzarro@arm.com> <20240806124642.2580828-2-luca.vizzarro@arm.com> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: <20240806124642.2580828-2-luca.vizzarro@arm.com> 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 This is a nice improvement. The comment below won't necessarily results in any changes, so: Reviewed-by: Juraj Linkeš > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py > @@ -303,6 +329,40 @@ def verify_packets(self, expected_packet: Packet, received_packets: list[Packet] > ) > self._fail_test_case_verify("An expected packet not found among received packets.") > > + def match_all_packets( > + self, expected_packets: list[Packet], received_packets: list[Packet] > + ) -> None: > + """Matches all the expected packets against the received ones. > + > + Matching is performed by counting down the occurrences in a dictionary which keys are the > + raw packet bytes. No deep packet comparison is performed. All the unexpected packets (noise) > + are automatically ignored. > + > + Args: > + expected_packets: The packets we are expecting to receive. > + received_packets: All the packets that were received. > + > + Raises: > + TestCaseVerifyError: if and not all the `expected_packets` were found in > + `received_packets`. > + """ > + expected_packets_counters = Counter(map(raw, expected_packets)) > + received_packets_counters = Counter(map(raw, received_packets)) > + # The number of expected packets is subtracted by the number of received packets, ignoring > + # any unexpected packets and capping at zero. > + missing_packets_counters = expected_packets_counters - received_packets_counters > + missing_packets_count = missing_packets_counters.total() > + self._logger.debug( > + f"match_all_packets: expected {len(expected_packets)}, " > + f"received {len(received_packets)}, missing {missing_packets_count}" > + ) > + > + if missing_packets_count != 0: > + self._fail_test_case_verify( > + f"Not all packets were received, expected {len(expected_packets)} " > + f"but {missing_packets_count} were missing." > + ) > + Is it worthwhile to log the missing packets? It's not necessary, as the received packets are logged elsewhere, but it would be convenient. On the other hand, it could just unnecessarily bloat logs.