From ebada48456bdaeeec556567ffab9bec5642b1304 Mon Sep 17 00:00:00 2001 From: Adrien Mazarguil Date: Tue, 5 Sep 2017 14:56:37 +0200 Subject: [PATCH] net/mlx4: fix unhandled event debug message 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 --- drivers/net/mlx4/mlx4_intr.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c index e3449ee268..d7f10989d2 100644 --- a/drivers/net/mlx4/mlx4_intr.c +++ b/drivers/net/mlx4/mlx4_intr.c @@ -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); } -- 2.20.1