From nobody Tue May 10 08:06:31 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 85FB51AD97D3; Tue, 10 May 2022 08:06:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ky9br1mVcz4Ryk; Tue, 10 May 2022 08:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652169992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8DfJCA4jc0vssOtRwwXtssI0OQKh9uivQXAuVqW10EE=; b=VCMYCadrjarzWWOys16uWMpxEp0ofoH7m9ip7gCgodu+aOyrm3sk4Q5Ju4bI2ZUSyMKgSH Y/FfEATm0QoiNgL21XvfS6mVaU90eYKS7BmnGv0BPTCgke/0bFLecwxgQDoziA8Y1z1owR YN6OdMB1mMnLFoBni7XQDUXpfSUX03UOte32qaRdFB5+GHsqEpA1MttCyniPTxtSkzYSyR g4zPmQ85t2OIxvjy0L24W5y7Cvt5N9HwTsuGNmCyMTEUCrdCdqCFVt6Vqawubh1HWnY+Z/ gUFNrUafVt1t+Igad8XfM4lL/r5L0k7PWChVXg6O0iL5bw2/AuNR2GIdB63+6w== 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 18F1A21798; Tue, 10 May 2022 08:06:32 +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 24A86VVH029365; Tue, 10 May 2022 08:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24A86Vjm029364; Tue, 10 May 2022 08:06:31 GMT (envelope-from git) Date: Tue, 10 May 2022 08:06:31 GMT Message-Id: <202205100806.24A86Vjm029364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 51a9a42f0c0b - stable/13 - mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 51a9a42f0c0b73aaa7229aa8a2ceab09024f07c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652169992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8DfJCA4jc0vssOtRwwXtssI0OQKh9uivQXAuVqW10EE=; b=kDd6HwEbbh6ipxrC2Pit2v/9i1GxnhGAN0CpV9qZelehdREh0ZSkd68QQwP0AmkttZ/ZKB dY270BeX5rwrRvlu+N+agUBThlsHu0nf9aUEtHac/qdt9byGpVgG7iK853JFo0/n6kF6n4 nzI9maDYxNAO//ye3v4aN6JgGxS9SEWlzypPalHiD9XyyquvtjD5EDRnoyGAxtdpW1seTa NewajVDODpj4msnGLc2KN2jrQGnYbQ54MO5vwsXYfQvcSK32s7ED4eF/7gy3Xj0gzf8tHV u8fyNkQDmtcA8A3k/TcmO5xfRJ/beTOem+eei+JjSpk1iP/auLutdHMf01U8YA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652169992; a=rsa-sha256; cv=none; b=OxMWPRuyFRwpGYXIkahgq72MiCeXvWH2nGpqwYXPWxkVTfm6XHg6EQRrllVR3PsmSm6rnb EXa6aW6/ogYBpXAJAcB4HlbJ28Qg3KRIqkTUmzXwZO0hntiInMWpCIdYBjPxlOlYKezWSF wndUHLb38E33KWeLQ1bHI03ZKfFv1hhOa1tG3FOI+AcncUtgKrLaEFqyNecHbsf+TrGxij B32IKB1jxZCgTamfi+t/2Mv59kKlabwEqlxWsdU01B8t/7bhYG8H90qR+5TsmgAuBNwSbN LGTsX1/0W4EbeoxRtOyToFTvbplcUmh2ByeiOlwWkMewPY64klXQ2jYB5Np4Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=51a9a42f0c0b73aaa7229aa8a2ceab09024f07c8 commit 51a9a42f0c0b73aaa7229aa8a2ceab09024f07c8 Author: Hans Petter Selasky AuthorDate: 2022-05-02 15:14:50 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-10 08:02:28 +0000 mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ. The page size specified for RQ, SQ and CQ is always in units of 4KBytes. Make sure we subtract MLX5_ADAPTER_PAGE_SHIFT, 12, instead of PAGE_SHIFT which may vary. This fixes support for using the mlx5en driver on systems having non-4K page size. Linux commit: 68cdf5d6e91068c98d6091b193dc7a5ab7dcf5eb Sponsored by: NVIDIA Networking (cherry picked from commit d735d604f063617909d98bd0fc36a6f25a14c699) --- sys/dev/mlx5/mlx5_en/mlx5_en_iq.c | 4 ++-- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_iq.c b/sys/dev/mlx5/mlx5_en/mlx5_en_iq.c index 6553b002aa1b..678f37745c52 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_iq.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_iq.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2021 NVIDIA corporation & affiliates. All rights reserved. + * Copyright (c) 2021-2022 NVIDIA corporation & affiliates. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -279,7 +279,7 @@ mlx5e_iq_enable(struct mlx5e_iq *iq, struct mlx5e_sq_param *param, MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC); MLX5_SET(wq, wq, uar_page, bfreg->index); MLX5_SET(wq, wq, log_wq_pg_sz, iq->wq_ctrl.buf.page_shift - - PAGE_SHIFT); + MLX5_ADAPTER_PAGE_SHIFT); MLX5_SET64(wq, wq, dbr_addr, iq->wq_ctrl.db.dma); mlx5_fill_page_array(&iq->wq_ctrl.buf, diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 84fa8cd96301..7b754d901beb 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1349,7 +1349,7 @@ mlx5e_enable_rq(struct mlx5e_rq *rq, struct mlx5e_rq_param *param) if (priv->counter_set_id >= 0) MLX5_SET(rqc, rqc, counter_set_id, priv->counter_set_id); MLX5_SET(wq, wq, log_wq_pg_sz, rq->wq_ctrl.buf.page_shift - - PAGE_SHIFT); + MLX5_ADAPTER_PAGE_SHIFT); MLX5_SET64(wq, wq, dbr_addr, rq->wq_ctrl.db.dma); mlx5_fill_page_array(&rq->wq_ctrl.buf, @@ -1765,7 +1765,7 @@ mlx5e_enable_sq(struct mlx5e_sq *sq, struct mlx5e_sq_param *param, MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC); MLX5_SET(wq, wq, uar_page, bfreg->index); MLX5_SET(wq, wq, log_wq_pg_sz, sq->wq_ctrl.buf.page_shift - - PAGE_SHIFT); + MLX5_ADAPTER_PAGE_SHIFT); MLX5_SET64(wq, wq, dbr_addr, sq->wq_ctrl.db.dma); mlx5_fill_page_array(&sq->wq_ctrl.buf, @@ -2053,7 +2053,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix) MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET(cqc, cqc, log_page_size, cq->wq_ctrl.buf.page_shift - - PAGE_SHIFT); + MLX5_ADAPTER_PAGE_SHIFT); MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma); err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen, out, sizeof(out));