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 2EC2545721; Fri, 2 Aug 2024 22:26:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDBA040DD3; Fri, 2 Aug 2024 22:26:10 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 9B2D940B90 for ; Fri, 2 Aug 2024 22:26:09 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1fc65329979so74732005ad.0 for ; Fri, 02 Aug 2024 13:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1722630369; x=1723235169; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VkoxEipFihloAIMBiX39Xr3LL7cggp/xz+IiNF097TI=; b=FU2XbKjm9MC60612aUOfQIh98zw6J/e7Ukf7xuRcO61C3sQ/zH3ChMlXhfLkzGXQWj LrJIE6T9bZPYRc7pJTPSjdyREtc5kwJJw+zWdvipxME1qGLQPS1YrvLOKaTaHBLaq2tw 88pH7z+S+kbERSgwbkzAvOGOiFwVWxYqNDDUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722630369; x=1723235169; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VkoxEipFihloAIMBiX39Xr3LL7cggp/xz+IiNF097TI=; b=FkiLz1WdNx8ZthQAdRamm7MfWnFeZSZHWDPv3x9LNDB4jA1mFz1qwKzyiUwnRErX1z 7N19HwjH/LgEl5CVOLRGSo6WPYDpqdf3k/uaM+m7uMoj1MlWMmzOoBALK/8eVXVINT2N f1P6yv1W6DlHsumLUIXtmpzAoSTPtEa9fY4cpKihGNGq1eSjhSM08Pl6/BOIQHzlmk/+ X9L/ZwGN9qzpAE6UINCJvjIVVTrmvp5IsiJU6yAjlE9uusgIGEJuVdPJif1ctpTPF5SY 2QZ7JQG11eq/MCwm9Y7EyH57aNW4SYu63L1BX5pgJ9E46HcABh6l4TG0Dq+3jbM64S2p 4y+g== X-Forwarded-Encrypted: i=1; AJvYcCV/zCkVreNwDjmmES218lagI6jOp9mMdNbVIXon9f/2Cjg2dHnq5geTDKcM/V5ssOvoK/sfUaCGLd/DWRY= X-Gm-Message-State: AOJu0YxevYuhG4PIKNSgGRFOSWEOa+lzxUJaKRCpNZ3SoNuD8jSVV7pv 3BnvuO++aS7f0lGdAK3wH3+qOv65/HLX8Zuf2tUCRSZhbRCpvaWAXYF9P6N5lgfHch4WK4W8fHR QfN9N62ml7qyIkDpMgZIY2TfMM3lSmTgSMrmcfQ== X-Google-Smtp-Source: AGHT+IGwVt3yAV9M8Bm7sJQIP87Rj1KNcIhENLCu25opcxaomiRWZE9kGx8McRn6P+psZejFK1L84GMaY1XRz46z2pU= X-Received: by 2002:a17:90b:4e8b:b0:2c8:716f:b46e with SMTP id 98e67ed59e1d1-2cff9449562mr5776058a91.16.1722630368459; Fri, 02 Aug 2024 13:26:08 -0700 (PDT) MIME-Version: 1.0 References: <20240726163915.19277-2-npratte@iol.unh.edu> <20240726164602.25519-1-npratte@iol.unh.edu> In-Reply-To: <20240726164602.25519-1-npratte@iol.unh.edu> From: Jeremy Spewock Date: Fri, 2 Aug 2024 16:25:57 -0400 Message-ID: Subject: Re: [PATCH v4 2/2] dts: mac filter test suite refactored for new dts To: Nicholas Pratte Cc: probb@iol.unh.edu, dmarx@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Just a few small comments, otherwise: Reviewed-by: Jeremy Spewock On Fri, Jul 26, 2024 at 12:46=E2=80=AFPM Nicholas Pratte wrote: > > The mac address filter test suite, whose test cases are based on old > DTS's test cases, has been refactored to interface with the new DTS > framework. > > In porting over this test suite into the new framework, some > adjustments were made, namely in the EAL and TestPMD parameter provided > before executing the application. While the original test plan was > referenced, by and large, only for the individual test cases, I'll leave > the parameters the original test plan was asking for below for the sake > of discussion: > > --burst=3D1 --rxpt=3D0 --rxht=3D0 --rxwt=3D0 --txpt=3D36 --txht=3D0 --txw= t=3D0 > --txfreet=3D32 --rxfreet=3D64 --mbcache=3D250 --portmask=3D0x3 > > depends-on: patch-142691 ("dts: add send_packets to test suites and > rework packet addressing") > depends-on: patch-142696 ("dts: add VLAN methods to testpmd shell") > > Bugzilla ID: 1454 > Signed-off-by: Nicholas Pratte > > --- > + > + def send_packet_and_verify( > + self, > + mac_address: str, > + add_vlan: bool =3D False, > + should_receive: bool =3D True, > + ) -> None: > + """Generate, send, and verify a packet based on specified parame= ters. > + > + Test cases within this suite utilize this method to create, send= , and verify > + packets based on criteria relating to the packet's destination m= ac address, > + vlan tag, and whether or not the packet should be received or no= t. Packets > + are verified using an inserted payload. Assuming the test case e= xpects to > + receive a specified packet, if the list of received packets cont= ains this > + payload within any of its packets, the test case passes. Alterna= tively, if > + the designed packet should not be received, and the packet paylo= ad is not, I think there is an extra comma here, but we probably should remove the "not," all together since the test case really fails here if it is received. > + received, then the test case fails. Each call with this method s= ends exactly > + one packet. > + > + Args: > + mac_address: The destination mac address of the packet being= sent. > + add_vlan: If :data:'True', add a vlan tag to the packet bein= g sent. The > + vlan tag will be :data:'2' if the packet should be recei= ved and > + :data:'1' if the packet should not be received but requi= res a vlan tag. > + should_receive: If :data:'True', assert whether or not the s= ent packet > + has been received. If :data:'False', assert that the sen= d packet was not > + received. :data:'True' by default > + """ > + if add_vlan: > + packet =3D Ether() / Dot1Q(vlan=3D2 if should_receive else 1= ) / IP() / Raw(load=3D"X" * 22) > + else: > + packet =3D Ether() / IP() / Raw(load=3D"X" * 22) > + packet.dst =3D mac_address > + received_packets =3D [ > + packets > + for packets in self.send_packet_and_capture(packet) > + if hasattr(packets, "load") and "X" * 22 in str(packets.load= ) > + ] > + if should_receive: > + self.verify(len(received_packets) =3D=3D 1, "Expected packet= not received") > + else: > + self.verify(len(received_packets) =3D=3D 0, "Expected packet= received") > + > + def test_add_remove_mac_addresses(self) -> None: > + """Assess basic mac addressing filtering functionalities. > + > + This test case validates for proper behavior of mac address filt= ering with both > + a port's default, burned-in mac address, as well as additional m= ac addresses > + added to the PMD. Packets should either be received or not recei= ved depending on > + the properties applied to the PMD at any given time. > + > + Test: > + Start TestPMD with promiscuous mode. > + Send a packet with the port's default mac address. (Should r= eceive) > + Send a packet with fake mac address. (Should not receive) > + Add fake mac address to the PMD's address pool. > + Send a packet with the fake mac address to the PMD. (Should = receive) > + Remove the fake mac address from the PMD's address pool. > + Sent a packet with the fake mac address to the PMD. (Should = not receive) Typo: sent should be send. > + """ > + with TestPmdShell(self.sut_node) as testpmd: > + testpmd.set_promisc(0, on=3DFalse) > + testpmd.start() > + mac_address =3D self._sut_port_ingress.mac_address > + > + # Send a packet with NIC default mac address > + self.send_packet_and_verify(mac_address=3Dmac_address, shoul= d_receive=3DTrue) > + # Send a packet with different mac address > + fake_address =3D "00:00:00:00:00:01" > + self.send_packet_and_verify(mac_address=3Dfake_address, shou= ld_receive=3DFalse) > + > + # Add mac address to pool and rerun tests > + testpmd.set_mac_addr(0, mac_address=3Dfake_address, add=3DTr= ue) > + self.send_packet_and_verify(mac_address=3Dfake_address, shou= ld_receive=3DTrue) > + testpmd.set_mac_addr(0, mac_address=3Dfake_address, add=3DFa= lse) > + self.send_packet_and_verify(mac_address=3Dfake_address, shou= ld_receive=3DFalse) > + > 2.44.0 >