From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id F34ED7CA9 for ; Fri, 30 Jun 2017 20:20:12 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id p204so9336551wmg.1 for ; Fri, 30 Jun 2017 11:20:12 -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=uQQORp+M664kJOoDuN4V4ys4bXbQHwYW8PKoceoim+QI0V0neMrqYIMhahvBw/kxra WpCVF/0C0EvTURDS+4KXBkSch97miFh+dLQX+3YIIcGypAUKlnQ+Pa9g7vPbOG0ahdXA gscEsVETfK2kDwt6a/ojtYrlLTuw6oMqrb0aG/ZrqCobYENaJk1K2bJm4KrUGwql1lji xUFgPLQipdybjNvoq0Bv6joZkPtGOiokfUea4XtYxtQcQGYdPrsdJCQVdCXR6h/0RJTk lyAg7jVDlg1S59WrfRwsFTJfY3mLGEJe6QOCBfLHK/0ggmvbfAOQNIArrN/xTxZovYvX razA== 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=TRZTdXBTNUWaWTvt+VRBZlBiD/76xfy1ReVuj+/d2zmvKGcLROyEu2ZhRl7cce25Nk 8cMZjO+vYtHKYstJ1JDMwuT2+9VQoUIF2BIQ6CiTe0JpVcScBKcJaERsNpC+U8aYtBrw nZB8lzIxeibuThcPbc8VvZ5Wqa6uykmm3yvZAXmyMk8Y1T6fow551jr+cm6PLnzK+/aG 3E//L7FI6dWCpCPn/71hH2hBsMBt+K0fbuhVKMVYN9F7IljSXoftht4jQxJGl1GYzsXf GAxka+PAJEQ6LRz2bAaxHSszHPU8B/9JAFjO5yMLNJARccMpPA+NF+e6lfpWP7dMHG0K Mfeg== X-Gm-Message-State: AKS2vOzQkw+0e7CAVXhlCrq3pYnlfnN6newL/xXzwI8owP3ni3Fk714w 5dSML6ffdSrnS+/c X-Received: by 10.80.216.5 with SMTP id o5mr3302480edj.178.1498846812639; Fri, 30 Jun 2017 11:20:12 -0700 (PDT) Received: from weierstrass.local ([91.200.110.13]) by smtp.gmail.com with ESMTPSA id r28sm2826940edd.33.2017.06.30.11.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2017 11:20:11 -0700 (PDT) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Cc: gaetan.rivet@6wind.com, shreyansh.jain@nxp.com Date: Fri, 30 Jun 2017 20:19:39 +0200 Message-Id: <20170630181943.23929-11-jblunck@infradead.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170630181943.23929-1-jblunck@infradead.org> References: <20170629182206.1072-1-jblunck@infradead.org> <20170630181943.23929-1-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH v8 10/14] 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: Fri, 30 Jun 2017 18:20:13 -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