app/testpmd: fix removed device link status asking
authorMatan Azrad <matan@mellanox.com>
Thu, 3 May 2018 10:31:47 +0000 (10:31 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 May 2018 02:20:25 +0000 (04:20 +0200)
In the RMV device event callback, there is a call for the removed
device stop operation which triggers a link status operation for the
removed device.

It may casue an error from the removed device PMD.

Skip the link status operation in the above described case.

Fixes: 284c908cc588 ("app/testpmd: request device removal interrupt")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
app/test-pmd/testpmd.c

index f72560c..287fe2a 100644 (file)
@@ -2100,13 +2100,16 @@ check_all_ports_link_status(uint32_t port_mask)
 static void
 rmv_event_callback(void *arg)
 {
+       int org_no_link_check = no_link_check;
        struct rte_eth_dev *dev;
        portid_t port_id = (intptr_t)arg;
 
        RTE_ETH_VALID_PORTID_OR_RET(port_id);
        dev = &rte_eth_devices[port_id];
 
+       no_link_check = 1;
        stop_port(port_id);
+       no_link_check = org_no_link_check;
        close_port(port_id);
        printf("removing device %s\n", dev->device->name);
        if (rte_eal_dev_detach(dev->device))