]> git.droids-corp.org - dpdk.git/commitdiff
app/testpmd: fix invalid port detach
authorMatan Azrad <matan@mellanox.com>
Tue, 30 Jan 2018 14:13:40 +0000 (14:13 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 20:04:21 +0000 (21:04 +0100)
Using registration to all ports includes also the ports which should not
be used by the application.

It is nice to print each port event by testpmd but in case of RMV
event, testpmd tries to detach the port and this case is problematic
when the port should not be used by the application.

Check the port validation before detach API calling.

Fixes: 4fb82244b394 ("app/testpmd: extend event printing")
Signed-off-by: Matan Azrad <matan@mellanox.com>
app/test-pmd/testpmd.c

index d8ac43268d37fae0a2f0fc783c89bcc61c66d997..f64dd73340045900a9bcfb17edb398d1a2f4d8ca 100644 (file)
@@ -2029,6 +2029,9 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,
                fflush(stdout);
        }
 
+       if (port_id_is_invalid(port_id, DISABLED_WARN))
+               return 0;
+
        switch (type) {
        case RTE_ETH_EVENT_INTR_RMV:
                if (rte_eal_alarm_set(100000,