From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 8B8B38E01 for ; Thu, 4 Jan 2018 17:04:10 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3CEB720C93; Thu, 4 Jan 2018 11:04:10 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 04 Jan 2018 11:04:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=/m8LRSABxNbbRwANpDPQwcjcwy ZcGvB7cIBZFJi6D5c=; b=Mm/8ZozQk/RsVLYR+Uu/csZFioYc5IzCOk59q6DymK rSQvoyQ3IOFvug91j4kvfvzkiA9Qn+ul6boI8Hc6qR9U0J79Q1jHYYeR1RRRlbAG OSOojoiIckM3WZABkiBNhJqUGqx/j7ZOZ6pS8zoUcBugtapmuSFPRvdKbv+q6oAC o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=/m8LRS ABxNbbRwANpDPQwcjcwyZcGvB7cIBZFJi6D5c=; b=Li75NGjroG7i4UhCCDBO0l fAZu4fgtk3dDr3NX/xwmcwdZRkDX7/5FgTv6xl9psFvO7l13KkGvnR8pG6A6gzgq k84h23hO9ZOoyMAvptM/JosBTn64WnTQ0PnPtE/KrjQ+DIxVoBmde1C08OHN7Y9k iprAmjVXByN5pVRB17Uq6t/BfMdvpmpxy6Kcrbxi1TIdRjNzRp4ghlidSO//Lite VGhuTXWf4rItO34WI5Kt0ZrRIL5oMEFYTvDmuFT3KEkSmQhLg/LcuG+q6Wh9v1Rz gfayH0Ut5sZGQIF66oswl4cBVcSmigPjVAXBWjOKGHYsOi9wm2zhyE7qrWkK61Pg == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C427324599; Thu, 4 Jan 2018 11:04:09 -0500 (EST) From: Thomas Monjalon To: Wenzhuo Lu , Jingjing Wu Cc: dev@dpdk.org, ferruh.yigit@intel.com, Matan Azrad Date: Thu, 04 Jan 2018 17:03:50 +0100 Message-ID: <2323611.DQWTZmajj2@xps> In-Reply-To: <20180104160112.28651-6-thomas@monjalon.net> References: <20171128221302.15400-1-thomas@monjalon.net> <20180104160112.28651-1-thomas@monjalon.net> <20180104160112.28651-6-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 5/5] app/testpmd: extend event printing 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, 04 Jan 2018 16:04:10 -0000 +Cc Wenzhuo and Jingjing for review, thanks 04/01/2018 17:01, Thomas Monjalon: > From: Matan Azrad > > There are new Ethernet device events - NEW and DESTROY, and new option > to register all ports by one call. > > Adjust application to aforementioned changes. > > Signed-off-by: Matan Azrad > --- > v3: no change > v4: no change > --- > app/test-pmd/parameters.c | 4 ++++ > app/test-pmd/testpmd.c | 30 ++++++++++++++++-------------- > doc/guides/testpmd_app_ug/run_app.rst | 4 ++-- > 3 files changed, 22 insertions(+), 16 deletions(-) > > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 84e7a63ef..796d1a5b6 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -546,6 +546,10 @@ parse_event_printing_config(const char *optarg, int enable) > mask = UINT32_C(1) << RTE_ETH_EVENT_MACSEC; > else if (!strcmp(optarg, "intr_rmv")) > mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV; > + else if (!strcmp(optarg, "dev_probed")) > + mask = UINT32_C(1) << RTE_ETH_EVENT_NEW; > + else if (!strcmp(optarg, "dev_released")) > + mask = UINT32_C(1) << RTE_ETH_EVENT_DESTROY; > else if (!strcmp(optarg, "all")) > mask = ~UINT32_C(0); > else { > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index c3ab44849..26576eb76 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1568,20 +1568,6 @@ start_port(portid_t pid) > } > } > > - for (event_type = RTE_ETH_EVENT_UNKNOWN; > - event_type < RTE_ETH_EVENT_MAX; > - event_type++) { > - diag = rte_eth_dev_callback_register(pi, > - event_type, > - eth_event_callback, > - NULL); > - if (diag) { > - printf("Failed to setup even callback for event %d\n", > - event_type); > - return -1; > - } > - } > - > /* start port */ > if (rte_eth_dev_start(pi) < 0) { > printf("Fail to start port %d\n", pi); > @@ -1608,6 +1594,20 @@ start_port(portid_t pid) > need_check_link_status = 1; > } > > + for (event_type = RTE_ETH_EVENT_UNKNOWN; > + event_type < RTE_ETH_EVENT_MAX; > + event_type++) { > + diag = rte_eth_dev_callback_register(RTE_ETH_ALL, > + event_type, > + eth_event_callback, > + NULL); > + if (diag) { > + printf("Failed to setup even callback for event %d\n", > + event_type); > + return -1; > + } > + } > + > if (need_check_link_status == 1 && !no_link_check) > check_all_ports_link_status(RTE_PORT_ALL); > else if (need_check_link_status == 0) > @@ -1930,6 +1930,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, > [RTE_ETH_EVENT_VF_MBOX] = "VF Mbox", > [RTE_ETH_EVENT_MACSEC] = "MACsec", > [RTE_ETH_EVENT_INTR_RMV] = "device removal", > + [RTE_ETH_EVENT_NEW] = "device probed", > + [RTE_ETH_EVENT_DESTROY] = "device released", > [RTE_ETH_EVENT_MAX] = NULL, > }; > > diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst > index 4c0d2cede..377b07651 100644 > --- a/doc/guides/testpmd_app_ug/run_app.rst > +++ b/doc/guides/testpmd_app_ug/run_app.rst > @@ -492,12 +492,12 @@ The commandline options are: > > Set the logical core N to perform bitrate calculation. > > -* ``--print-event `` > +* ``--print-event `` > > Enable printing the occurrence of the designated event. Using all will > enable all of them. > > -* ``--mask-event `` > +* ``--mask-event `` > > Disable printing the occurrence of the designated event. Using all will > disable all of them. >