Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 12:52:10 +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: r341961 - in stable/12/sys/dev/mlx5: . mlx5_fpga
Message-ID:  <201812121252.wBCCqAVO097140@repo.freebsd.org>

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

Log:
  MFC r341574:
  mlx5fpga: Support MorseQ board
  
  Added and supported new enum "morseQ = 4" for fpga_id field
  
  Submitted by:   kib@
  Sponsored by:   Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c
  stable/12/sys/dev/mlx5/mlx5io.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c	Wed Dec 12 12:50:23 2018	(r341960)
+++ stable/12/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c	Wed Dec 12 12:52:10 2018	(r341961)
@@ -138,6 +138,8 @@ static const char *mlx5_fpga_name(u32 fpga_id)
 		return "Edison";
 	case MLX5_FPGA_MORSE:
 		return "Morse";
+	case MLX5_FPGA_MORSEQ:
+		return "MorseQ";
 	}
 
 	snprintf(ret, sizeof(ret), "Unknown %d", fpga_id);
@@ -148,6 +150,7 @@ static int mlx5_fpga_device_load_check(struct mlx5_fpg
 {
 	struct mlx5_fpga_query query;
 	int err;
+	u32 fpga_id;
 
 	err = mlx5_fpga_query(fdev->mdev, &query);
 	if (err) {
@@ -162,8 +165,9 @@ static int mlx5_fpga_device_load_check(struct mlx5_fpg
 	mlx5_fpga_info(fdev, "Status %u; Admin image %u; Oper image %u\n",
 		      query.image_status, query.admin_image, query.oper_image);
 
-	/* For Morse project FPGA has no influence to network functionality */
-	if (MLX5_CAP_FPGA(fdev->mdev, fpga_id) == MLX5_FPGA_MORSE)
+	/* For Morse projects FPGA has no influence to network functionality */
+	fpga_id = MLX5_CAP_FPGA(fdev->mdev, fpga_id);
+	if (fpga_id == MLX5_FPGA_MORSE || fpga_id == MLX5_FPGA_MORSEQ)
 		return 0;
 
 	if (query.image_status != MLX5_FPGA_STATUS_SUCCESS) {
@@ -226,7 +230,7 @@ int mlx5_fpga_device_start(struct mlx5_core_dev *mdev)
 	fpga_id = MLX5_CAP_FPGA(fdev->mdev, fpga_id);
 	mlx5_fpga_info(fdev, "FPGA card %s\n", mlx5_fpga_name(fpga_id));
 
-	if (fpga_id == MLX5_FPGA_MORSE)
+	if (fpga_id == MLX5_FPGA_MORSE || fpga_id == MLX5_FPGA_MORSEQ)
 		goto out;
 
 	mlx5_fpga_info(fdev, "%s(%d) image, version %u; SBU %06x:%04x version %d\n",
@@ -361,13 +365,16 @@ void mlx5_fpga_device_stop(struct mlx5_core_dev *mdev)
 	unsigned int max_num_qps;
 	unsigned long flags;
 	int err;
+	u32 fpga_id;
 
 	if (!fdev)
 		return;
 
-	spin_lock_irqsave(&fdev->state_lock, flags);
-	if (MLX5_CAP_FPGA(mdev, fpga_id) == MLX5_FPGA_MORSE)
+	fpga_id = MLX5_CAP_FPGA(mdev, fpga_id);
+	if (fpga_id == MLX5_FPGA_MORSE || fpga_id == MLX5_FPGA_MORSEQ)
 		return;
+
+	spin_lock_irqsave(&fdev->state_lock, flags);
 
 	if (fdev->fdev_state != MLX5_FDEV_STATE_SUCCESS) {
 		spin_unlock_irqrestore(&fdev->state_lock, flags);

Modified: stable/12/sys/dev/mlx5/mlx5io.h
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5io.h	Wed Dec 12 12:50:23 2018	(r341960)
+++ stable/12/sys/dev/mlx5/mlx5io.h	Wed Dec 12 12:52:10 2018	(r341961)
@@ -61,6 +61,7 @@ enum mlx5_fpga_id {
 	MLX5_FPGA_NEWTON = 0,
 	MLX5_FPGA_EDISON = 1,
 	MLX5_FPGA_MORSE = 2,
+	MLX5_FPGA_MORSEQ = 3,
 };
 
 enum mlx5_fpga_image {



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