Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 12:01:42 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341921 - in stable/12/sys/dev/mlx5: mlx5_core mlx5_ib
Message-ID:  <201812121201.wBCC1gbd066680@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec 12 12:01:42 2018
New Revision: 341921
URL: https://svnweb.freebsd.org/changeset/base/341921

Log:
  MFC r341554:
  mlx5: Raise fatal IB event when sys error occurs
  
  All other mlx5_events report the port number as 1 based, which is how FW
  reports it in the port event EQE. Reporting 0 for this event causes
  mlx5_ib to not raise a fatal event notification to registered clients
  due to a seemingly invalid port.
  
  All switch cases in mlx5_ib_event that go through the port check are
  supposed to set the port now, so just do it once at variable
  declaration.
  
  Linux commit:
  aba462134634b502d720e15b23154f21cfa277e5
  
  Sponsored by:   Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_core/mlx5_health.c
  stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_health.c	Wed Dec 12 12:00:51 2018	(r341920)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_health.c	Wed Dec 12 12:01:42 2018	(r341921)
@@ -269,7 +269,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev,
 	mlx5_core_err(dev, "system error event triggered\n");
 
 err_state_done:
-	mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0);
+	mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 1);
 	mutex_unlock(&dev->intf_state_mutex);
 }
 

Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c	Wed Dec 12 12:00:51 2018	(r341920)
+++ stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c	Wed Dec 12 12:01:42 2018	(r341921)
@@ -2335,7 +2335,7 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, v
 	struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context;
 	struct ib_event ibev;
 	bool fatal = false;
-	u8 port = 0;
+	u8 port = (u8)param;
 
 	switch (event) {
 	case MLX5_DEV_EVENT_SYS_ERROR:
@@ -2347,8 +2347,6 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, v
 	case MLX5_DEV_EVENT_PORT_UP:
 	case MLX5_DEV_EVENT_PORT_DOWN:
 	case MLX5_DEV_EVENT_PORT_INITIALIZED:
-		port = (u8)param;
-
 		/* In RoCE, port up/down events are handled in
 		 * mlx5_netdev_event().
 		 */
@@ -2362,24 +2360,20 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, v
 
 	case MLX5_DEV_EVENT_LID_CHANGE:
 		ibev.event = IB_EVENT_LID_CHANGE;
-		port = (u8)param;
 		break;
 
 	case MLX5_DEV_EVENT_PKEY_CHANGE:
 		ibev.event = IB_EVENT_PKEY_CHANGE;
-		port = (u8)param;
 
 		schedule_work(&ibdev->devr.ports[port - 1].pkey_change_work);
 		break;
 
 	case MLX5_DEV_EVENT_GUID_CHANGE:
 		ibev.event = IB_EVENT_GID_CHANGE;
-		port = (u8)param;
 		break;
 
 	case MLX5_DEV_EVENT_CLIENT_REREG:
 		ibev.event = IB_EVENT_CLIENT_REREGISTER;
-		port = (u8)param;
 		break;
 
 	default:
@@ -2390,7 +2384,7 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, v
 	ibev.device	      = &ibdev->ib_dev;
 	ibev.element.port_num = port;
 
-	if (port < 1 || port > ibdev->num_ports) {
+	if (!rdma_is_port_valid(&ibdev->ib_dev, port)) {
 		mlx5_ib_warn(ibdev, "warning: event(%d) on port %d\n", event, port);
 		return;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121201.wBCC1gbd066680>