net/mlx4: fix unhandled event debug message
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Tue, 5 Sep 2017 12:56:37 +0000 (14:56 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
When LSC or RMV events are received by the PMD but are not requested by the
application, a misleading debugging message implying the PMD does not
support them is shown.

Fixes: 6dd7b7056d7f ("net/mlx4: support device removal event")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx4/mlx4_intr.c

index e3449ee..d7f1098 100644 (file)
@@ -160,16 +160,21 @@ mlx4_collect_interrupt_events(struct priv *priv, uint32_t *events)
        for (;;) {
                if (ibv_get_async_event(priv->ctx, &event))
                        break;
-               if ((event.event_type == IBV_EVENT_PORT_ACTIVE ||
-                    event.event_type == IBV_EVENT_PORT_ERR) &&
-                   intr_conf->lsc) {
+               switch (event.event_type) {
+               case IBV_EVENT_PORT_ACTIVE:
+               case IBV_EVENT_PORT_ERR:
+                       if (!intr_conf->lsc)
+                               break;
                        port_change = 1;
                        ret++;
-               } else if (event.event_type == IBV_EVENT_DEVICE_FATAL &&
-                          intr_conf->rmv) {
+                       break;
+               case IBV_EVENT_DEVICE_FATAL:
+                       if (!intr_conf->rmv)
+                               break;
                        *events |= (1 << RTE_ETH_EVENT_INTR_RMV);
                        ret++;
-               } else {
+                       break;
+               default:
                        DEBUG("event type %d on port %d not handled",
                              event.event_type, event.element.port_num);
                }