From patchwork Wed Jul 26 13:30:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 27209 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C8BF27CCF; Wed, 26 Jul 2017 15:30:58 +0200 (CEST) Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id E6C677CBC for ; Wed, 26 Jul 2017 15:30:50 +0200 (CEST) Received: by mail-wr0-f169.google.com with SMTP id 12so131851192wrb.1 for ; Wed, 26 Jul 2017 06:30:50 -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=63isYLqL6ebmHtRGXh5gjpOjlUZf8ajef8JJlHXsfes=; b=yF1Nd62gjgmHDYgtIg9xwSJLHS3En2ExdNIBp4jXIcf2AhRunCshMHl7lRpjww7o7D epAfwIV4Y3Nw3jMV0KXqbjJmC615Kx3ihnq6zy/D5NMxlBwj5sd0r6WFnM7gMMxgUxy+ OdPZ3q4Y9XyqDUPDg/IcPEQXd/sdTPgxvXu7uPEoBjzNWqOzDaMwB4PRvYCRoxDe9TeI pyNZSyTOZH7bihPEgaqUjninjb1FjnIdfnDYjYvDMLksaXtPj7vBNiogUY13u/7ci9Au TLgPv2Vxi4RJYY311cTSO1N6+mYW4MCuF5wNzzA/eTXAkkxdHPl+WbHJ6rzYdWATKwps riQw== 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=63isYLqL6ebmHtRGXh5gjpOjlUZf8ajef8JJlHXsfes=; b=Kcp8glmmjnMETk4NVnL9N2x66L0/JuQKuPS9BclCYpmEkRyzKPUl5qGSikAWd1LcJp QG0j6iRdI+m/s1/7cLRrn41SbfCzLDrI/uXrKOj2b2vsofwrUfe+Dn8xe8lPEfCiVP8E 3PPidWzp3bySEDC0AJAQD8TNvRIvwc5bakvOYi5NDl10F/aYpud2cKtk1D7G9IhzNVRK NLvFR8MBWkQ1Fv/Z7xoXwRqjC9ux3ydBZrH6nQHPqQsAV2HX9hj9mb6DgyF7xPQDiw9n ZwmlYZWPabnUdtp3eAyE4pKAUrHXiaNMGkdpUClvm3UkWzuwt+3hbsKArTn9JvtIcrV8 H4Nw== X-Gm-Message-State: AIVw110R+cKmCQA9NHe7xS9juZ3DtfNrLZygCqfZ5CoC5R2sQI+nnlX7 qGiVUNK9lb1lh42ieWU= X-Received: by 10.223.172.21 with SMTP id v21mr865738wrc.153.1501075850306; Wed, 26 Jul 2017 06:30:50 -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 d26sm16186659wra.92.2017.07.26.06.30.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jul 2017 06:30:49 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 26 Jul 2017 15:30:21 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <5ec0604196fb087a42fa75e6ddc2a04aab293593.1501047767.git.shacharbe@mellanox.com> In-Reply-To: References: Subject: [dpdk-dev] [PATCH 5/6] app/testpmd: let the user know device detach failed 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" Signed-off-by: Gaetan Rivet --- app/test-pmd/testpmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9142218..9a36e66 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1728,8 +1728,10 @@ detach_port(uint8_t port_id) if (ports[port_id].flow_list) port_flow_flush(port_id); - if (rte_eth_dev_detach(port_id, name)) + if (rte_eth_dev_detach(port_id, name)) { + RTE_LOG(ERR, USER1, "Failed to detach port '%s'\n", name); return; + } nb_ports = rte_eth_dev_count(); @@ -1835,7 +1837,9 @@ rmv_event_callback(void *arg) stop_port(port_id); close_port(port_id); printf("removing device %s\n", dev->device->name); - rte_eal_dev_detach(dev->device); + if (rte_eal_dev_detach(dev->device)) + RTE_LOG(ERR, USER1, "Failed to detach device %s\n", + dev->device->name); } /* This function is used by the interrupt thread */