From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH V17 4/4] app/testpmd: enable device hotplug monitoring Date: Thu, 29 Mar 2018 10:00:59 -0700 Message-ID: <20180329100059.0f10a32a@xeon-e3> References: <1522063256-3997-5-git-send-email-jia.guo@intel.com> <1522339205-27698-1-git-send-email-jia.guo@intel.com> <1522339205-27698-5-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net, motih@mellanox.com, harry.van.haaren@intel.com, jianfeng.tan@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com To: Jeff Guo Return-path: Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by dpdk.org (Postfix) with ESMTP id 08D8AE5D for ; Thu, 29 Mar 2018 19:01:07 +0200 (CEST) Received: by mail-pf0-f195.google.com with SMTP id y66so3612133pfi.7 for ; Thu, 29 Mar 2018 10:01:06 -0700 (PDT) In-Reply-To: <1522339205-27698-5-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 30 Mar 2018 00:00:05 +0800 Jeff Guo wrote: > Use testpmd for example, to show an application how to use device event > mechanism to monitor the hotplug event, involve both hot removal event > and the hot insertion event. > > The process is that, testpmd first enable hotplug monitoring and register > the user's callback, when device being hotplug insertion or hotplug > removal, the eal monitor the event and call user's callbacks, the > application according their hot plug policy to detach or attach the device > from the bus. > > Signed-off-by: Jeff Guo > --- > v17->v16: > unregister all user's callback when stop event monitor > --- > app/test-pmd/parameters.c | 5 +- > app/test-pmd/testpmd.c | 242 +++++++++++++++++++++++++++++++++++++++++++++- > app/test-pmd/testpmd.h | 11 +++ > 3 files changed, 256 insertions(+), 2 deletions(-) > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 97d22b8..825d602 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -186,6 +186,7 @@ usage(char* progname) > printf(" --flow-isolate-all: " > "requests flow API isolated mode on all ports at initialization time.\n"); > printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n"); > + printf(" --hot-plug: enalbe hot plug for device.\n") s/enalbe/enable/