From owner-dev-commits-src-all@freebsd.org Fri Jan 8 17:37:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B73B4D0A31; Fri, 8 Jan 2021 17:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC9KG2b0Rz4hbj; Fri, 8 Jan 2021 17:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B346271A5; Fri, 8 Jan 2021 17:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 108HbMA1080178; Fri, 8 Jan 2021 17:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 108HbMNQ080177; Fri, 8 Jan 2021 17:37:22 GMT (envelope-from git) Date: Fri, 8 Jan 2021 17:37:22 GMT Message-Id: <202101081737.108HbMNQ080177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 431980466ff0 - main - Don't offset the UAR map twice in mlx5en(4). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 431980466ff05947975cae6a85188b6a54c05939 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2021 17:37:22 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=431980466ff05947975cae6a85188b6a54c05939 commit 431980466ff05947975cae6a85188b6a54c05939 Author: Hans Petter Selasky AuthorDate: 2021-01-08 17:32:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-01-08 17:35:49 +0000 Don't offset the UAR map twice in mlx5en(4). The new UAR API already offsets the UAR map pointer the mlx5en(4) is using. While at it remove some no longer needed variables for keeping track of the current BF offset. This fixes a regression issue after the new UAR allocation APIs were introduced. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/mlx5/mlx5_en/en.h | 8 +------- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 1 - sys/dev/mlx5/mlx5_en/mlx5_en_rl.c | 5 ----- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index b7c05264008a..b990bb754962 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -807,7 +807,6 @@ struct mlx5e_sq { /* dirtied @xmit */ u16 pc __aligned(MLX5E_CACHELINE_SIZE); - u16 bf_offset; u16 cev_counter; /* completion event counter */ u16 cev_factor; /* completion event factor */ u16 cev_next_state; /* next completion event state */ @@ -830,7 +829,6 @@ struct mlx5e_sq { void __iomem *uar_map; struct ifnet *ifp; u32 sqn; - u32 bf_buf_size; u32 mkey_be; u16 max_inline; u8 min_inline_mode; @@ -1130,8 +1128,6 @@ void mlx5e_del_all_vlan_rules(struct mlx5e_priv *priv); static inline void mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe) { - u16 ofst = MLX5_BF_OFFSET + sq->bf_offset; - /* ensure wqe is visible to device before updating doorbell record */ wmb(); @@ -1143,10 +1139,8 @@ mlx5e_tx_notify_hw(struct mlx5e_sq *sq, u32 *wqe) */ wmb(); - mlx5_write64(wqe, sq->uar_map + ofst, + mlx5_write64(wqe, sq->uar_map, MLX5_GET_DOORBELL_LOCK(&sq->priv->doorbell_lock)); - - sq->bf_offset ^= sq->bf_buf_size; } static inline void diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 9fc3af186c0d..0d4028e240ca 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1668,7 +1668,6 @@ mlx5e_create_sq(struct mlx5e_channel *c, goto err_free_dma_tag; sq->wq.db = &sq->wq.db[MLX5_SND_DBR]; - sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2; err = mlx5e_alloc_sq_db(sq); if (err) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c index 7291253b8168..95fb59726e24 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -124,11 +124,6 @@ mlx5e_rl_create_sq(struct mlx5e_priv *priv, struct mlx5e_sq *sq, goto err_free_dma_tag; sq->wq.db = &sq->wq.db[MLX5_SND_DBR]; - /* - * The sq->bf_buf_size variable is intentionally left zero so - * that the doorbell writes will occur at the same memory - * location. - */ err = mlx5e_alloc_sq_db(sq); if (err)