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 D6110A04A4; Wed, 2 Mar 2022 09:26:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 680DB4014E; Wed, 2 Mar 2022 09:26:45 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 9465640141 for ; Wed, 2 Mar 2022 09:26:43 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1029E5C03A0; Wed, 2 Mar 2022 03:26:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 02 Mar 2022 03:26:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=frSEzSatGD/ncv ntY+hNgJsQJKtdcznrv3gY6RvlHhU=; b=QKZ6kIeDkdfTkYcbbBHfsQb0on3QQR llQ1cQr0pOVvU/FmFsTohtEW6Fdm7f83kjkU7mqyaicRRk1CSzMXHQlqU2Q9Gsku +Of4nx9njHx6Z383oJYvLsdXb54vZL3waagpxGr4apq8FCU7ApFb740NbPNYC2Dz R3Uo3aoDEWWKUGaUrw25+7mcICg+5OAy7Uyn1GGzUM9jcCjALLRFDPkx8672DPzE iKkiY8qnf3eUMnjwL8SX8t0PSHxZiQxcWJJWxOKDx9SJYVfjD8cUcIdwufMPaIHS 8fwPR+Qqy4oSqHDz5OTAsBmqIHuZ6b6N0ky4bP+2QZLSU28JkdSKMKPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=frSEzSatGD/ncvntY+hNgJsQJKtdcznrv3gY6RvlH hU=; b=kAOvaV5DDlO7gJtbXchDdka61K5rIM0Q+n1nPvZqCJQiZyIUiCExHKRF5 TP6am+BfGFM4yc2EoG/3JbyE015pOUKeJISNbsFUDAsG2Zr2lWaQlRzLi9OuJfpF S273svwzviH85ymhqEY23xRiAa4eaQlis4PgR/hYTFvvWomQsFzGdST6lkoZW1OW 9WFhzkVLsC/gUBUKctBx1At5a3hoLunTnw6lfTdDakswVZkzwReiVj4Gdk4l+ZIV 82j7SILOkE40r8GfRb2m/oe2fBGSxn6Pm5sYQDqNy4VLZCL6BIF3xWSnQrdN2bAQ FQePwv7wFNlsR6/vq8ALcjVzTCVPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddtfedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Mar 2022 03:26:42 -0500 (EST) From: Thomas Monjalon To: Chengwen Feng Cc: ferruh.yigit@intel.com, dev@dpdk.org, xiaoyun.li@intel.com, aman.deep.singh@intel.com, yuying.zhang@intel.com Subject: Re: [PATCH] app/testpmd: remove invalid ports when other process detach Date: Wed, 02 Mar 2022 09:26:40 +0100 Message-ID: <5569707.V25eIC5XRa@thomas> In-Reply-To: <20220302023326.16509-1-fengchengwen@huawei.com> References: <20220302023326.16509-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 02/03/2022 03:33, Chengwen Feng: > Start main and secondary process: > ./dpdk-testpmd -a BDF0 -a BDF1 --proc-type=auto -- -i --rxq=8 --txq=8 > --num-procs=2 --proc-id=0 > ./dpdk-testpmd -a BDF0 -a BDF1 --proc-type=auto -- -i --rxq=8 --txq=8 > --num-procs=2 --proc-id=1 > Execute following command in main process: > port stop 0 > port detach 0 > Execute following command in secondary process: > set fwd mac > start > The secondary process will display: > Invalid port_id=0 > telcore 19 called rx_pkt_burst for not ready port 0 > stpmd> 8: [/lib64/libc.so.6(+0xdf600) [0xffff9e1dc600]] > 7: [/lib64/libpthread.so.0(+0x7c48) [0xffff9e28ac48]] > 6: [/usr/app/testpmd(eal_thread_loop+0x2c4) [0xb23574]] > 5: [/usr/app/testpmd() [0x9c21d8]] > 4: [/usr/app/testpmd() [0x9c2108]] > 3: [/usr/app/testpmd() [0x9b6cf0]] > 2: [/usr/app/testpmd() [0xad8620]] > 1: [/usr/app/testpmd(rte_dump_stack+0x20) [0xb1a130]] > > The root cause it that the secondary process has not removed invalid > ports when it processes RTE_ETH_EVENT_DESTROY event. Why the ports are not removed? > This patch adds a delay remove invalid ports invoke when process the > RTE_ETH_EVENT_DESTROY event. Why do we need this delay? [...] > +static void > +remove_invalid_ports_callback(void *arg) > +{ > + RTE_SET_USED(arg); > + remove_invalid_ports(); > +} [...] > case RTE_ETH_EVENT_DESTROY: > ports[port_id].port_status = RTE_PORT_CLOSED; > printf("Port %u is closed\n", port_id); > + if (rte_eal_alarm_set(100000, remove_invalid_ports_callback, > + (void *)(intptr_t)port_id)) > + fprintf(stderr, > + "Could not set up deferred device released\n"); > break;