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 B7F0541CEE; Mon, 20 Feb 2023 19:35:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2458430E0; Mon, 20 Feb 2023 19:35:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id DEAF5430E4 for ; Mon, 20 Feb 2023 19:35:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676918131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Dji4/wCD978V1OBVX9B/v0EzSSjtqEv2rPwixNvdhc=; b=M8uIbpOPzbsC7fLPCERTrNTqbYkD3TOrsUfu++dqAAGJYxyJ6n4QOnnL0Ll8lTow2UgdMk 4MS5geC4dnUTj6Qj7443A/huU8OG4n12J+CF6glBYVzwM5ffKedukSYi41VU6x2nFBzM7Z jFEkh5TjsbRMEWMdIhDkxmTTQZ/Nw7A= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-bnjPsIXLNcy7Fpc-la8fsA-1; Mon, 20 Feb 2023 13:35:28 -0500 X-MC-Unique: bnjPsIXLNcy7Fpc-la8fsA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 311263C0F185; Mon, 20 Feb 2023 18:35:28 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id D77EE140EBF6; Mon, 20 Feb 2023 18:35:25 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Ferruh Yigit , Aman Singh , Yuying Zhang , Robin Jarry , stable@dpdk.org, Kevin Traynor , Bernard Iremonger , Jens Freimann Subject: [PATCH v3 4/9] app/testpmd: fix packet transmission in noisy VNF engine Date: Mon, 20 Feb 2023 19:34:57 +0100 Message-Id: <20230220183502.3348368-5-david.marchand@redhat.com> In-Reply-To: <20230220183502.3348368-1-david.marchand@redhat.com> References: <20230124104742.1265439-1-david.marchand@redhat.com> <20230220183502.3348368-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 nb_rx relates to the number of packets received from the driver. nb_tx is the total number of packets transmitted by this forward engine. Fix the retry stage, for dequeued packets, as it was incorrectly passing nb_rx / nb_tx as bounds of the tmp_pkts[] array, and fix tx stats accordingly. Fixes: 3c156061b938 ("app/testpmd: add noisy neighbour forwarding mode") Cc: stable@dpdk.org Signed-off-by: David Marchand --- app/test-pmd/noisy_vnf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c index ce5a3e5e69..0e72dc034f 100644 --- a/app/test-pmd/noisy_vnf.c +++ b/app/test-pmd/noisy_vnf.c @@ -217,9 +217,10 @@ pkt_burst_noisy_vnf(struct fwd_stream *fs) sent = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, tmp_pkts, nb_deqd); if (unlikely(sent < nb_deqd) && fs->retry_enabled) - nb_tx += do_retry(nb_rx, nb_tx, tmp_pkts, fs); - inc_tx_burst_stats(fs, nb_tx); + sent += do_retry(nb_deqd, sent, tmp_pkts, fs); + inc_tx_burst_stats(fs, sent); fs->fwd_dropped += drop_pkts(tmp_pkts, nb_deqd, sent); + nb_tx += sent; ncf->prev_time = rte_get_timer_cycles(); } end: -- 2.39.2