Browse Source

IB/rxe: Handle NETDEV_CHANGE events

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>
Andrew Boyer 8 years ago
parent
commit
5c50f1d18f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      drivers/infiniband/sw/rxe/rxe_net.c

+ 6 - 1
drivers/infiniband/sw/rxe/rxe_net.c

@@ -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);
 		pr_info("%s changed mtu to %d\n", ndev->name, ndev->mtu);
 		rxe_set_mtu(rxe, ndev->mtu);
 		rxe_set_mtu(rxe, ndev->mtu);
 		break;
 		break;
-	case NETDEV_REBOOT:
 	case NETDEV_CHANGE:
 	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_GOING_DOWN:
 	case NETDEV_CHANGEADDR:
 	case NETDEV_CHANGEADDR:
 	case NETDEV_CHANGENAME:
 	case NETDEV_CHANGENAME: