From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id E9ECB7CC4 for ; Wed, 26 Jul 2017 15:36:17 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id t201so72916573wmt.1 for ; Wed, 26 Jul 2017 06:36:17 -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=IqVJKYD3joIzbVPnS7opA0qeGYw91yJzcSnI+0aX+JqjZ7dYiqHTOiSWLM0aMJSqab WHvijJHozXaTRUeFXHUEkmMpHpr1ddcuYcJcZBXhHed2EkAzweNss/7tDLdrx+PXF8/G YycSUgE21IeBSdTeVvxfD5PCod+emKGPnEIOElr0+30gRmMUavWmMUOLJGYciRh+Z6Gk TOxKQphGv8cFnXcyExCqWXzxIrCksRdQFn3zVwgaxfxZeaTNlAZdNer4MOb9KTxNhGp8 fnN4TFqEO+QcLtmgRTNMOfG3koduU8XHCrVYlqb9WO8XrW4wjkBHZb8alaws/+fDvAaY gvtg== 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=SWU1KpFxT3lxMnyOi3FBwrWrnKX1704Fuiw8ejZufiDDd4Qr6u3rfQQblZZ7hEYean gPyYml4BdWZ0tQex5MPivoynr5ogFNYl9zfT846O8EkhN8j1whuHhqJUELlxPJbH3HT+ YT5SwqmkQoqdXqRa7tIqjfFELFRpn2/1yuNvfWCQMxARKPdIN+kX6Cmw5EAuRflUV836 znVNBFT9msPehcFuZxiLjAu+KMJmMddoU3vVbWCZ2bn328NN20MTambVMKYUMZStUhN/ rjSC9g/RitEfhnTF6BBRXVeK5xmdQIuN9+NFvioaLIAmI9t/T7bMVsyQyXICtRwhvKcs rLqg== X-Gm-Message-State: AIVw110vWMoVGZusE93J73wk8Xz8s6L3/AvxRlZA1eg74GhRNRtevdi9 JuwnWJhth1rWqChNXgk= X-Received: by 10.28.183.196 with SMTP id h187mr767609wmf.134.1501076177313; Wed, 26 Jul 2017 06:36:17 -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 c13sm3144707wrc.7.2017.07.26.06.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jul 2017 06:36:16 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 26 Jul 2017 15:35:56 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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: , X-List-Received-Date: Wed, 26 Jul 2017 13:36:18 -0000 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 */ -- 2.1.4