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 95480455D4; Wed, 10 Jul 2024 17:37:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82C9942D91; Wed, 10 Jul 2024 17:37:12 +0200 (CEST) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 5627241101 for ; Wed, 10 Jul 2024 17:37:11 +0200 (CEST) Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-70df213542bso3622024a12.3 for ; Wed, 10 Jul 2024 08:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1720625830; x=1721230630; 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=QIC+mlUJcaGwe30uUhVm0adkKtrNrBs2b6tVtSMsNXo=; b=RZBC4K2Vboe0JKI1bxuUsOtwXb2XW1AiduHA9aZhLgCwXk+qfdmZfecMt2R2JthFMK YHPomFxMhlllm3x83cQ6gs6sZUIHAWCweoh+mzy9M2FeHzI2Ldf+mIQWuLokkDoLU+aC zIiDmpAxS5QIgbprbTT3eEQmheLyo/hJWEQsc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720625830; x=1721230630; 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=QIC+mlUJcaGwe30uUhVm0adkKtrNrBs2b6tVtSMsNXo=; b=XWogcvnZX6q0d+Xugz3fKuSZ6ZOG0Ftr7G4DjLuVmnIfa/Qm1e70rUuhUJtvLKxcfL VaI98PjwLZEbKf8pRsnlO/Nc0lrB6OQOJeLtHYsBFrWMzkeVAAMG0ggxpPMmhOFRkmFN W20mLAJSqxW5cxi6yEnWPB0deCHC93v6i+WHQ67QMRv6o92eYRG0kIkcBRColNSEmYT3 3fHGUgHEw6Ll97F0mH1LFbQdMxi9j1Zr6oSbytZzUmXkbeMdBBzgSpkqW+b0Iokkwl6/ oIxKaTKimt3wFyqZzADeNjXIV430MPN4ylX8He5hegJZAO0dssGd9+01ZZwFrzRuDPe6 Uzrw== X-Forwarded-Encrypted: i=1; AJvYcCUVaoiMtroYUhWsIb+n3ryzhIVSs8opi2vTHzrA52oWX+EpgNntD9K9+tJwPS5CKWRQrkN1phR9XsaAUs4= X-Gm-Message-State: AOJu0YyazbOtbaLiyQTw/xE9KXMhnC5adPY/VmFw2iC6ve3+NTd8viWU XqRV+a2cXFM2MOjeUOAiVJTiOlwj7dgQ8eMELWdFGsyibyY8sLpmBUmJ/GIEqRhK0an2PKmw7Sw 8Ewk8MDFldw8D7ueJsJ5tm9oqRBzMoqQzyTphihVX8VUvs2Tv X-Google-Smtp-Source: AGHT+IHk38wApqizc1+8AqSILhozvb9s3wgXxBvnYdoZMsSVvUuRregZVedFTKDeGqcbouBz6HbQ1zBer1fZbg+pJ/Q= X-Received: by 2002:a05:6a20:9145:b0:1c2:8e96:3343 with SMTP id adf61e73a8af0-1c29820394emr7067932637.10.1720625830328; Wed, 10 Jul 2024 08:37:10 -0700 (PDT) MIME-Version: 1.0 References: <20240617194638.12926-2-dmarx@iol.unh.edu> <20240703180820.18723-1-dmarx@iol.unh.edu> <20240703180820.18723-2-dmarx@iol.unh.edu> In-Reply-To: <20240703180820.18723-2-dmarx@iol.unh.edu> From: Jeremy Spewock Date: Wed, 10 Jul 2024 11:36:59 -0400 Message-ID: Subject: Re: [PATCH v5 2/3] dts: initial queue start/stop suite implementation To: Dean Marx Cc: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, bruce.richardson@intel.com, luca.vizzarro@arm.com, 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 Hey Dean, everything looks good here to me, but I had one thought about how we do the verification below. On Wed, Jul 3, 2024 at 2:08=E2=80=AFPM Dean Marx wrote: > + > + def test_rx_queue_start_stop(self) -> None: > + """Verify packets are not received by port 0 when Rx queue is di= sabled. > + > + Test: > + Create an interactive testpmd session, stop Rx queue on port= 0, verify > + packets are not received. > + """ > + testpmd =3D TestPmdShell(node=3Dself.sut_node) > + testpmd.set_forward_mode(SimpleForwardingModes.mac) > + testpmd.stop_port_queue(0, 0, True) > + > + testpmd.start() > + self.send_packet_and_verify(should_receive=3DFalse) > + stats =3D testpmd.show_port_stats(port_id=3D0) > + self.verify( > + stats.rx_packets =3D=3D 0, > + "Packets were received on Rx queue when it should've been di= sabled", > + ) Thinking more about this verification step, I think it makes a lot of sense why we can verify here using port stats even though we usually can't. One thing I was thinking about with this however is I think there is a (probably small) chance that before you get the chance to stop the port after opening testpmd, a packet is sent to it. When I tested this it seemed like this verification step worked with some NICs (like one I ran with on the bnxt_en driver), but specifically because when you stop the Rx queue it clears all of the Rx stats on the port. I'm not sure if this is something PMD specific or not, but it might be worth putting a small comment in here that explains that disabling the queue will reset the stats and that we then don't expect the stat to grow from that point on at all. If handling this number is something PMD specific, another alternative route we could take would be taking the statistics that are returned from the "stop" command. I think this would work because the statistics from the stop command are only aggregated while packet forwarding is running, and we know that we stopped the queue before starting forwarding so that number should truly always be 0. > + testpmd.close() > + > + def test_tx_queue_start_stop(self) -> None: > + """Verify packets are not forwarded by port 1 when Tx queue is d= isabled. > + > + Test: > + Create an interactive testpmd session, stop Tx queue on port= 1, verify > + packets are not forwarded. > + """ > + testpmd =3D TestPmdShell(node=3Dself.sut_node) > + testpmd.set_forward_mode(SimpleForwardingModes.mac) > + testpmd.stop_port_queue(1, 0, False) > + testpmd.start() > + self.send_packet_and_verify(should_receive=3DFalse) > + stats =3D testpmd.show_port_stats(port_id=3D1) > + self.verify( > + stats.tx_packets =3D=3D 0, > + "Packets were forwarded on Tx queue when it should've been d= isabled", > + ) > + testpmd.close() > -- > 2.44.0 >