From owner-svn-src-head@freebsd.org Wed Dec 5 14:18:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F49C1315476; Wed, 5 Dec 2018 14:18:54 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4EFA74AB7; Wed, 5 Dec 2018 14:18:53 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D459157DF; Wed, 5 Dec 2018 14:18:53 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB5EIr6n098924; Wed, 5 Dec 2018 14:18:53 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB5EIrDe098922; Wed, 5 Dec 2018 14:18:53 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201812051418.wB5EIrDe098922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Wed, 5 Dec 2018 14:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341574 - in head/sys/dev/mlx5: . mlx5_fpga X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_fpga X-SVN-Commit-Revision: 341574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4EFA74AB7 X-Spamd-Result: default: False [-0.80 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.52)[-0.521,0]; NEURAL_HAM_SHORT(-0.25)[-0.249,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.03)[-0.031,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2018 14:18:54 -0000 Author: slavash Date: Wed Dec 5 14:18:52 2018 New Revision: 341574 URL: https://svnweb.freebsd.org/changeset/base/341574 Log: mlx5fpga: Support MorseQ board Added and supported new enum "morseQ = 4" for fpga_id field Submitted by: kib@ Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c head/sys/dev/mlx5/mlx5io.h Modified: head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c ============================================================================== --- head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c Wed Dec 5 14:17:22 2018 (r341573) +++ head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_core.c Wed Dec 5 14:18:52 2018 (r341574) @@ -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: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed Dec 5 14:17:22 2018 (r341573) +++ head/sys/dev/mlx5/mlx5io.h Wed Dec 5 14:18:52 2018 (r341574) @@ -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 {