aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2014-08-21 07:28:40 -0400
committerRoland Dreier <roland@purestorage.com>2014-09-22 12:46:52 -0400
commitbccb84f1dfab92ed180adf09c76cfa9ddc90edb9 (patch)
tree095c0d9da9bc1ed99a7adfabe64245b7ec946d14
parent655b2aaefc353604f9975c31960d9722e6eda449 (diff)
IB/mlx4: Get upper dev addresses as RoCE GIDs when port comes up
When a RoCE port becomes active and the netdev of the port has upper device (e.g bond/team), GIDs derived from the upper dev should appear in the port's RoCE GID table. Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/mlx4/main.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 49965b692042..d404a2eafa79 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1802,14 +1802,23 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
1802 port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ? 1802 port_state = (netif_running(curr_netdev) && netif_carrier_ok(curr_netdev)) ?
1803 IB_PORT_ACTIVE : IB_PORT_DOWN; 1803 IB_PORT_ACTIVE : IB_PORT_DOWN;
1804 mlx4_ib_set_default_gid(ibdev, curr_netdev, port); 1804 mlx4_ib_set_default_gid(ibdev, curr_netdev, port);
1805 /* if using bonding/team and a slave port is down, we 1805 if (curr_master) {
1806 * don't the bond IP based gids in the table since 1806 /* if using bonding/team and a slave port is down, we
1807 * flows that select port by gid may get the down port. 1807 * don't want the bond IP based gids in the table since
1808 */ 1808 * flows that select port by gid may get the down port.
1809 if (curr_master && (port_state == IB_PORT_DOWN)) { 1809 */
1810 reset_gid_table(ibdev, port); 1810 if (port_state == IB_PORT_DOWN) {
1811 mlx4_ib_set_default_gid(ibdev, 1811 reset_gid_table(ibdev, port);
1812 curr_netdev, port); 1812 mlx4_ib_set_default_gid(ibdev,
1813 curr_netdev,
1814 port);
1815 } else {
1816 /* gids from the upper dev (bond/team)
1817 * should appear in port's gid table
1818 */
1819 mlx4_ib_get_dev_addr(curr_master,
1820 ibdev, port);
1821 }
1813 } 1822 }
1814 /* if bonding is used it is possible that we add it to 1823 /* if bonding is used it is possible that we add it to
1815 * masters only after IP address is assigned to the 1824 * masters only after IP address is assigned to the