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 B2251A0547; Wed, 12 Oct 2022 09:54:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9124842D86; Wed, 12 Oct 2022 09:54:34 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 6014F42BF0; Wed, 12 Oct 2022 09:54:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665561273; x=1697097273; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7LHp9Nx1piEuKhwGUGg0tUmapQ9qKdFJojG6TAYNJ+U=; b=Y3YStFKUgtaDW5LNeY9WtFXd096ebsjl7ExJZKuYinvxEqsZbLQ3QOQy /jkPq5M0fW/rl7s1hPH4eOr5qYZik73bqen5Z5QhzzPXsha/D5H4tPGXA Gva6+GKYKWzQTOw4SBNx/xpF52wGEluGqGN4sQDz0F6db4fOQ7TWgf3zW UxwKwJTvVGDQjrBq+e/eOpMU97O0/G9CUW/fW0Ra0oiusYrsRbdK01d7/ IirUq7N2R5srkMw8KX1EfZC2iATRaBnyyRBXtKdaezNcGrP8TxpJERmoO sLlOAr3ChSBBHifXBQgqCfHFK4chXnTFNofZKWSdvCy5HMypwzPXrKGG3 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="366727798" X-IronPort-AV: E=Sophos;i="5.95,178,1661842800"; d="scan'208";a="366727798" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 00:54:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="577743183" X-IronPort-AV: E=Sophos;i="5.95,178,1661842800"; d="scan'208";a="577743183" Received: from dpdk-qiming3.sh.intel.com ([10.67.110.196]) by orsmga003.jf.intel.com with ESMTP; 12 Oct 2022 00:54:23 -0700 From: Qiming Yang To: dev@dpdk.org, andrew.rybchenko@oktetlabs.ru Cc: Qiming Yang , stable@dpdk.org Subject: [PATCH] app/testpmd: fix slave port reset action Date: Wed, 12 Oct 2022 07:43:59 +0000 Message-Id: <20221012074359.878049-1-qiming.yang@intel.com> X-Mailer: git-send-email 2.25.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 As stop action has been forbidden in secondary process, so the reset action should also not be allowed. Fixes: a550baf24af9 ("app/testpmd: support multi-process") Cc: stable@dpdk.org Signed-off-by: Qiming Yang --- app/test-pmd/testpmd.c | 18 ++++++++++-------- doc/guides/testpmd_app_ug/run_app.rst | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5b0f0838dc..6ce3cdabd9 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3333,14 +3333,16 @@ reset_port(portid_t pid) continue; } - diag = rte_eth_dev_reset(pi); - if (diag == 0) { - port = &ports[pi]; - port->need_reconfig = 1; - port->need_reconfig_queues = 1; - } else { - fprintf(stderr, "Failed to reset port %d. diag=%d\n", - pi, diag); + if (is_proc_primary()) { + diag = rte_eth_dev_reset(pi); + if (diag == 0) { + port = &ports[pi]; + port->need_reconfig = 1; + port->need_reconfig_queues = 1; + } else { + fprintf(stderr, "Failed to reset port %d. diag=%d\n", + pi, diag); + } } } diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index abc3ec10a0..7657b4afad 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -600,6 +600,7 @@ as follows: - ``dev_configure`` - ``dev_start`` - ``dev_stop`` +- ``dev_reset`` - ``rx_queue_setup`` - ``tx_queue_setup`` - ``rx_queue_release`` -- 2.25.1