main.c (90be7c8ab72853ff9fc407f01518a898df1f3045) | main.c (dbaaff2a2caa03d472b5cc53a3fbfd415c97dc26) |
---|---|
1/* 2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. 3 * 4 * This software is available to you under a choice of one of two 5 * licenses. You may choose to be licensed under the terms of the GNU 6 * General Public License (GPL) Version 2, available from the file 7 * COPYING in the main directory of this source tree, or the 8 * OpenIB.org BSD license below: --- 2297 unchanged lines hidden (view full) --- 2306 spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags); 2307} 2308 2309static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context, 2310 enum mlx5_dev_event event, unsigned long param) 2311{ 2312 struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context; 2313 struct ib_event ibev; | 1/* 2 * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. 3 * 4 * This software is available to you under a choice of one of two 5 * licenses. You may choose to be licensed under the terms of the GNU 6 * General Public License (GPL) Version 2, available from the file 7 * COPYING in the main directory of this source tree, or the 8 * OpenIB.org BSD license below: --- 2297 unchanged lines hidden (view full) --- 2306 spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags); 2307} 2308 2309static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context, 2310 enum mlx5_dev_event event, unsigned long param) 2311{ 2312 struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context; 2313 struct ib_event ibev; |
2314 | 2314 bool fatal = false; |
2315 u8 port = 0; 2316 2317 switch (event) { 2318 case MLX5_DEV_EVENT_SYS_ERROR: | 2315 u8 port = 0; 2316 2317 switch (event) { 2318 case MLX5_DEV_EVENT_SYS_ERROR: |
2319 ibdev->ib_active = false; | |
2320 ibev.event = IB_EVENT_DEVICE_FATAL; 2321 mlx5_ib_handle_internal_error(ibdev); | 2319 ibev.event = IB_EVENT_DEVICE_FATAL; 2320 mlx5_ib_handle_internal_error(ibdev); |
2321 fatal = true; |
|
2322 break; 2323 2324 case MLX5_DEV_EVENT_PORT_UP: 2325 case MLX5_DEV_EVENT_PORT_DOWN: 2326 case MLX5_DEV_EVENT_PORT_INITIALIZED: 2327 port = (u8)param; 2328 2329 /* In RoCE, port up/down events are handled in --- 35 unchanged lines hidden (view full) --- 2365 2366 if (port < 1 || port > ibdev->num_ports) { 2367 mlx5_ib_warn(ibdev, "warning: event on port %d\n", port); 2368 return; 2369 } 2370 2371 if (ibdev->ib_active) 2372 ib_dispatch_event(&ibev); | 2322 break; 2323 2324 case MLX5_DEV_EVENT_PORT_UP: 2325 case MLX5_DEV_EVENT_PORT_DOWN: 2326 case MLX5_DEV_EVENT_PORT_INITIALIZED: 2327 port = (u8)param; 2328 2329 /* In RoCE, port up/down events are handled in --- 35 unchanged lines hidden (view full) --- 2365 2366 if (port < 1 || port > ibdev->num_ports) { 2367 mlx5_ib_warn(ibdev, "warning: event on port %d\n", port); 2368 return; 2369 } 2370 2371 if (ibdev->ib_active) 2372 ib_dispatch_event(&ibev); |
2373 2374 if (fatal) 2375 ibdev->ib_active = false; |
|
2373} 2374 2375static void get_ext_port_caps(struct mlx5_ib_dev *dev) 2376{ 2377 int port; 2378 2379 for (port = 1; port <= MLX5_CAP_GEN(dev->mdev, num_ports); port++) 2380 mlx5_query_ext_port_caps(dev, port); --- 865 unchanged lines hidden --- | 2376} 2377 2378static void get_ext_port_caps(struct mlx5_ib_dev *dev) 2379{ 2380 int port; 2381 2382 for (port = 1; port <= MLX5_CAP_GEN(dev->mdev, num_ports); port++) 2383 mlx5_query_ext_port_caps(dev, port); --- 865 unchanged lines hidden --- |