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 A709BA0032; Fri, 30 Dec 2022 09:06:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 731F440DD8; Fri, 30 Dec 2022 09:06:00 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 185A64067B; Fri, 30 Dec 2022 09:05:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672387558; x=1703923558; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RwHPW3W+W++CWpEpy/E8HJmXLYEI039PcOmy1MeurUs=; b=X6ZOxWGVFNRksIiEHk34WYlIQ0iYrosS65WA9oAfrHKuMI133BffLHys Px4jbwJVrcfX0SXFFTp7TFSjUi3Rdw7/qWEBD+hKZupfbyj1Hj87+QaMq teQu7JkkXnTAzFdu7s/x46FRLiM6yhFUcrD8tXTEPBhBEjInKl6B4vEEH GX5WPgkZ5aDZCtlViy3qaeN6zn+0p/LWu/AKVBvM/Pxf6SmSnm1hGGIps tRSVASZysMJCtcI2Bv7kMmHn4f6U4tFDiJ9RTT6dyfswotM3+rhQ2MPt/ AwkiuloXqOcjt73GFFMTXVEeDCXJEU/NW9bbo2tCqo+y5ZyL4EYTdrdCu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="321245455" X-IronPort-AV: E=Sophos;i="5.96,286,1665471600"; d="scan'208";a="321245455" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 00:05:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="827912414" X-IronPort-AV: E=Sophos;i="5.96,286,1665471600"; d="scan'208";a="827912414" Received: from unknown (HELO root..) ([10.239.252.111]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 00:05:53 -0800 From: Shiyang He To: dev@dpdk.org Cc: yidingx.zhou@intel.com, Shiyang He , stable@dpdk.org, Aman Singh , Yuying Zhang , Anatoly Burakov , Xiaoyun Li , Alvin Zhang Subject: [PATCH] app/testpmd: fix secondary process not forwarding Date: Fri, 30 Dec 2022 07:55:53 +0000 Message-Id: <20221230075554.25244-1-shiyangx.he@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 Under multi-process scenario, the secondary process gets queue state from the wrong location (the global variable 'ports'). Therefore, the secondary process can not forward since "stream_init" is not called. This commit fixes the issue by calling 'rte_eth_rx/tx_queue_info_get' to get queue state from shared memory. Fixes: a78040c990cb ("app/testpmd: update forward engine beginning") Cc: stable@dpdk.org Signed-off-by: Shiyang He --- app/test-pmd/testpmd.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 134d79a555..2c73daf9eb 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2378,9 +2378,34 @@ start_packet_forwarding(int with_tx_first) if (!pkt_fwd_shared_rxq_check()) return; - if (stream_init != NULL) - for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) + if (stream_init != NULL) { + for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++) { + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + struct fwd_stream *fs = fwd_streams[i]; + struct rte_eth_rxq_info rx_qinfo; + struct rte_eth_txq_info tx_qinfo; + int32_t rc; + rc = rte_eth_rx_queue_info_get(fs->rx_port, + fs->rx_queue, &rx_qinfo); + if (!rc) + ports[fs->rx_port].rxq[fs->rx_queue].state = + rx_qinfo.queue_state; + else + TESTPMD_LOG(WARNING, + "Failed to get rx queue info\n"); + + rc = rte_eth_tx_queue_info_get(fs->tx_port, + fs->tx_queue, &tx_qinfo); + if (!rc) + ports[fs->tx_port].txq[fs->tx_queue].state = + tx_qinfo.queue_state; + else + TESTPMD_LOG(WARNING, + "Failed to get tx queue info\n"); + } stream_init(fwd_streams[i]); + } + } port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin; if (port_fwd_begin != NULL) { -- 2.34.1