From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 4DB847CA9 for ; Thu, 29 Jun 2017 20:22:40 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id y5so4064348wmh.3 for ; Thu, 29 Jun 2017 11:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8fm4osc3OH9f2zNwRkn1ceKBk8FKGfJ49Z6lxH7/g/Y=; b=U5LDzGyBz0D2xxmuBZEUxUoaaMs8iMx9n1e4/wJlAqhYzBGohGds+BDxLm9BbdtItj JeA62I8mowuvxghR+ZWfBK/am2vGyY4xWSxeM44ApriyOpzkxgGNbUfUAbtO696lwAbB +yy6d62TDDelhTrYuxCIQulqWc/9id0N9qgHfC+nQrCZrVlL13JXX2vRJnziSXe7NWy2 Bja2lT2PBn2p9+Dk+eAJiVXEsRBkVaziY6bKjRalCKwGcd+E22pssYbctN5c8hag1/En w+667P4b+CsK1tTgjYKYuJPyMW1T1OcZarvE0r2oQlQZGw1u7xNfWJX7j1IOrRceQWhm HVkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8fm4osc3OH9f2zNwRkn1ceKBk8FKGfJ49Z6lxH7/g/Y=; b=dZCR9HEH7l7Hr6hhFYED7eO3uxrVYW8CtURaXmmbNX10QKEg2n7WxwpixADCKEWJbl dIySTOrZNGcmq7adrRpiyTONxi4f/XV6B8a484TBeiK8wmUDU1ydAzP2a4wNwD547dg3 NpCVRf/KyHBr/TURAhXFYaDMmhu6wCxU10OA6f3AobCglXHlV3xPHG5myyVMsV07J9ps yx3zBxujiB5srWlwoIQv7xLCVRZeA9QyPAcshIJkjikHQrLwT+lCPh2FOdB6kYc5khSf croOnlba8jNwBZALOGyFvU1moGuOPqLEwGruTMk5qhd5Ewcq2t0/zh282y88jt7deAQz g4JQ== X-Gm-Message-State: AKS2vOw7twvM/kNG/k2n76xbLRjzeMKivwQuf7YAfFjjPSrjRgZAOLAL wrhewdtez7E4cdB3 X-Received: by 10.80.142.27 with SMTP id 27mr2624717edw.104.1498760559922; Thu, 29 Jun 2017 11:22:39 -0700 (PDT) Received: from weierstrass.local ([91.200.110.13]) by smtp.gmail.com with ESMTPSA id e28sm1446366ede.14.2017.06.29.11.22.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 11:22:38 -0700 (PDT) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: gaetan.rivet@6wind.com, shreyansh.jain@nxp.com Date: Thu, 29 Jun 2017 20:22:02 +0200 Message-Id: <20170629182206.1072-12-jblunck@infradead.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170629182206.1072-1-jblunck@infradead.org> References: <20170629182206.1072-1-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v7 11/15] vdev: implement unplug bus operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 18:22:40 -0000 Signed-off-by: Jan Blunck --- lib/librte_eal/common/eal_common_vdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 9bb7427..baf3c5b 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -39,11 +39,13 @@ #include #include +#include #include #include #include #include #include +#include /** Double linked list of virtual device drivers. */ TAILQ_HEAD(vdev_device_list, rte_vdev_device); @@ -354,10 +356,22 @@ vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, return NULL; } +static int +vdev_unplug(struct rte_device *dev) +{ + /* + * The virtual bus doesn't support 'unattached' devices so this is + * actually equal to hotplugging removal of it. + */ + return rte_vdev_uninit(dev->name); +} + static struct rte_bus rte_vdev_bus = { .scan = vdev_scan, .probe = vdev_probe, .find_device = vdev_find_device, + /* .plug = NULL, see comment on vdev_unplug */ + .unplug = vdev_unplug, }; RTE_REGISTER_BUS(VIRTUAL_BUS_NAME, rte_vdev_bus); -- 2.9.4