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 DBEE7A00C5; Fri, 8 May 2020 05:59:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 684221DC27; Fri, 8 May 2020 05:59:22 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id DE5851DC11 for ; Fri, 8 May 2020 05:59:20 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id b8so246425pgi.11 for ; Thu, 07 May 2020 20:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tP+lLDysTL0Pya5smLg3aRZ0hdkebx+L5jBRYitmnq4=; b=z0bfdA8XLjdcAsh4IK48c2wol9n78rw69WPI1rN8pmahJrFMCDqXfOU6SBCwi9/tZV Y0e2U7G4cHWD2n/J+ngMV8Pt31SRDxeG9cqoUv/CA54S2wtOmGqg3KINmJmCBNkdjKsa WZ3O6hvSPJCuACVtJUOL8AcBcQm4IWfomn92BM+n3JZisEx4D5lwcauT6ntOtoySb4aY ZnicESb3iDVjBcTl97E2PO9M3Jms8F4X203xhHhXzYiu8cZgFroA0ETYarWE8dQBkgKC 1U+aYnxieLcJMPU9EU/tkaDPqpVtI7jtpNjUv/q7Cskx6Bms1hoAIaKjFqtYabK8/X9h cawA== 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:mime-version:content-transfer-encoding; bh=tP+lLDysTL0Pya5smLg3aRZ0hdkebx+L5jBRYitmnq4=; b=DqXYAqFKPkmUBeGKcTremeFYmPbJqF2YYt0hZw8GWcQ2H7ZeiGAhJ13rPpR6wEcJ7S oWVDYRJhDZ80ekFiHTZgKHguc/T0NH26bLKMEc2hsisPQvHMQzpcEo93OFkF4paeWv5C gCStZSikkqeRIZHKS8b7hcj92FFA7FpYUfTQjWuLoh31/Y/euF04ZJS+6VHa8w63oPdM 5jvXs6/UApe4oaCSJn0e4X5z5+VPBma6DXBdf+kJjUcl7d1ia4bF9sMPuuPwJL0vbyDP pje9EM/E0wFYET/0lnEHGIKzuMKwNkS4pniwBJbpihPyUa2w/zflZ5K4uEJ4OPT/bYE2 mhCQ== X-Gm-Message-State: AGi0PubUpcI9L/anNFDXiA1U4ALPbOGIf8atnbdHdNASD6JEybj2mW/w MZyUAhVwUWKxKqFUvyO7H5lQScpmIxhdLA== X-Google-Smtp-Source: APiQypJ5yOsc7Pd5JL9H6i8dwOjCRPdjZ57I11oXg6UA8+g3V8M8O4e0MnCwnp3c3GUvzZvUXlZ3HA== X-Received: by 2002:a62:1985:: with SMTP id 127mr660456pfz.175.1588910359616; Thu, 07 May 2020 20:59:19 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id fv14sm1130694pjb.47.2020.05.07.20.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 20:59:18 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 7 May 2020 20:59:05 -0700 Message-Id: <20200508035906.18359-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200508035906.18359-1-stephen@networkplumber.org> References: <20200508035906.18359-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC 2/3] net/vdev_netvsc: automatically enable hotplug support 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In Hyper-V/Azure with accelerated networking the VF device maybe added or removed at anytime. Automatically enable hotplug support (in case application has forgot to). Signed-off-by: Stephen Hemminger --- drivers/net/vdev_netvsc/vdev_netvsc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 9ed74a1d6a2e..f99909ad800f 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -729,6 +729,7 @@ vdev_netvsc_vdev_probe(struct rte_vdev_device *dev) if (kvargs) rte_kvargs_free(kvargs); ++vdev_netvsc_ctx_inst; + rte_dev_event_monitor_start(); return 0; } @@ -749,7 +750,10 @@ vdev_netvsc_vdev_remove(__rte_unused struct rte_vdev_device *dev) { if (--vdev_netvsc_ctx_inst) return 0; + rte_eal_alarm_cancel(vdev_netvsc_alarm, NULL); + rte_dev_event_monitor_stop(); + while (!LIST_EMPTY(&vdev_netvsc_ctx_list)) { struct vdev_netvsc_ctx *ctx = LIST_FIRST(&vdev_netvsc_ctx_list); -- 2.20.1