IB/rxe: Handle NETDEV_CHANGE events
authorAndrew Boyer <andrew.boyer@dell.com>
Mon, 28 Aug 2017 20:11:59 +0000 (16:11 -0400)
committerDoug Ledford <dledford@redhat.com>
Mon, 28 Aug 2017 23:12:36 +0000 (19:12 -0400)
Without this fix, ports configured on top of ixgbe miss link up
notifications. ibv_query_port() will continue to return IBV_PORT_DOWN even
though the port is up and working.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Andrew Boyer <andrew.boyer@dell.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_net.c

index 3ba76e7c7a388afebfd534d58ea76cfdd55b7de1..59dee10bebcbd96f701c572e9a9d8331add13694 100644 (file)
@@ -651,8 +651,13 @@ static int rxe_notify(struct notifier_block *not_blk,
                pr_info("%s changed mtu to %d\n", ndev->name, ndev->mtu);
                rxe_set_mtu(rxe, ndev->mtu);
                break;
-       case NETDEV_REBOOT:
        case NETDEV_CHANGE:
+               if (netif_running(ndev) && netif_carrier_ok(ndev))
+                       rxe_port_up(rxe);
+               else
+                       rxe_port_down(rxe);
+               break;
+       case NETDEV_REBOOT:
        case NETDEV_GOING_DOWN:
        case NETDEV_CHANGEADDR:
        case NETDEV_CHANGENAME: