From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B68FA04F7 for ; Wed, 25 Dec 2019 05:50:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D35CD1BEA5; Wed, 25 Dec 2019 05:49:58 +0100 (CET) Received: from valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by dpdk.org (Postfix) with ESMTP id B01813977 for ; Wed, 25 Dec 2019 05:49:57 +0100 (CET) Received: by valinux.co.jp (Postfix, from userid 1000) id 58BDA240D0C; Wed, 25 Dec 2019 13:49:56 +0900 (JST) From: Itsuro Oda To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Wed, 25 Dec 2019 13:49:52 +0900 Message-Id: <20191225044954.3600-11-oda@valinux.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191225044954.3600-1-oda@valinux.co.jp> References: <20191223050036.30765-1-oda@valinux.co.jp> <20191225044954.3600-1-oda@valinux.co.jp> Subject: [spp] [PATCH v2 10/12] shared: make sure vhost is stopped before (re)using the vhost X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" It is for the case a secondary process which used the vhost was down without stopping the eth_dev. It makes the eth_dev stopped and available to do following operations(ex. rte_eth_dev_configure). It is no-op if the eth_dev is stopped. Signed-off-by: Itsuro Oda --- src/shared/secondary/add_port.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/shared/secondary/add_port.c b/src/shared/secondary/add_port.c index b072140..d845250 100644 --- a/src/shared/secondary/add_port.c +++ b/src/shared/secondary/add_port.c @@ -170,6 +170,14 @@ add_vhost_pmd(int index) return ret; } + /* NOTE: make sure the eth_dev is stopped. + * it is for the case a secondary process which used the vhost + * was down without stopping the device. + * note that it is still user responsibility to prevent multipul + * processes use a vhost at the same time. + */ + rte_eth_dev_stop(vhost_port_id); + ret = rte_eth_dev_configure(vhost_port_id, nr_queues, nr_queues, &port_conf); if (ret < 0) { -- 2.17.1