From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 4D5A37CE5 for ; Wed, 24 May 2017 17:05:43 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id 7so67065142wmo.1 for ; Wed, 24 May 2017 08:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=XgcsdnzCrUZ8ftkdeyR1kiPo9ssjfvKXVIxQbXiI5kA=; b=A2On7UmBLfcZSyVh59bcIsq7ZLnOyl532jDSOnMdjnBT87mMHZ3q3qxNOvK76B5qU/ hKk7OHotPtc2SwvNpCEtEOODdyZoY20PYFuHxpQvo1IINgT0pB9j7t6aXRgFjR+eJ3G1 C5VYjv1eMNXVCwtKJl1WOUIKmknKQLY6cswqt1tHNhNYTtv44ROrp03VCzvIpbaH0U1M O7BEoRdjeC3KXe/Mw36VA6p+kGlfpRPUWksmpEpoRx43qtZLFBn7WS3hE/1F2xoxNXoX KiZwAFwUauY37doezB7DxoZ4Td+HUBlg6WfMMEn9paqKLloUQcI0jJdR2JRmGKObyH0k Xxsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=XgcsdnzCrUZ8ftkdeyR1kiPo9ssjfvKXVIxQbXiI5kA=; b=fePUzTvfcdY0wXKXxfEYHl7rEKvLXRYHgn/Uu+xkuoQHsNGzp0cdkzdu3xfmqxJWLR 4vJkEh8zwSRQ6ACy03qZWK7vppwcS510Ns7Iq5JL+JS/U7rICG43ZJD2XP6pLYS7ZfAj 2q97NtZfUBQb3yI9XldpWVUtiKPitOypvbdNQnsNV5nIWuMso+wneFhURkNQ9ErX9XB0 ugwUp1kGd14DVoz3L9mvUKReAHT8wfjiL259MrfYSGijZjI0Msv59GXP2a+9UZzCj8TZ 98hbG/nBCkknBCAsvJg9BXnpktWqWEc6gvEpCIU8EV+YrUWWvONCYp+TIPH1Kf6Ez725 HDcQ== X-Gm-Message-State: AODbwcBiwTGJBhcwsQoPyHTiRCG7HH2p2TPgsCXaEjOQVW6WQS/cCGXf FZ6/Yl8+wL3ArXYC X-Received: by 10.28.134.133 with SMTP id i127mr6188425wmd.1.1495638343091; Wed, 24 May 2017 08:05:43 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 25sm4076017wrz.8.2017.05.24.08.05.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 08:05:42 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Wed, 24 May 2017 17:04:59 +0200 Message-Id: <8293351024c3cbca680cca46f3dfe68c76697387.1495637723.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 7/9] vdev: implement detach 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: Wed, 24 May 2017 15:05:44 -0000 From: Jan Blunck Signed-off-by: Jan Blunck --- lib/librte_eal/common/eal_common_vdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 5fc516f..2095b01 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -352,10 +352,22 @@ vdev_find_device(int (*match)(const struct rte_device *dev, const void *data), return NULL; } +static int +vdev_detach(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, + /* .attach = NULL, see comment on vdev_detach */ + .detach = vdev_detach, }; RTE_INIT(rte_vdev_bus_register); -- 2.1.4