From nobody Tue May 03 11:49:17 2022 X-Original-To: dev-commits-src-main@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 45A5E1ABBB35; Tue, 3 May 2022 11:49:18 +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 4Ksyt61T0hz4nlZ; Tue, 3 May 2022 11:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651578558; 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=s1FwOovOSep6V7xL7UEv3SAcab8IJU8EDU5vxGCfj9E=; b=gGhnu1XdELfeEgcyqT2jYEZn6lyYblwtticn0P36pR2yDVvOrn+GpRRua+2+cHiZFaSAYi ym/S8DDak2J6IEARjH8eN2EHoZ7WXHEKY+SIT4B9qfJOsp70RnErDl7AFg5W1H1XJbmNHL 11jfkujARFoaT9dqgJH0DjBEvHAIiGWXGO1t/etk+c6Wv/YOpIfIsM5wgSfnIgBkVkpKMV IyFNWvFHKlax41RhUcpUqfal4uMfIxJvehJ9km2XuCCnysZQKUtph2blVRlar/a4cFa27s X0hG6VfokUHKPmww64+D2q9jQoofzJO9qMSefLMeKIr1DubsdVmUzwP6qHKCyg== 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 137421DD24; Tue, 3 May 2022 11:49:18 +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 243BnHEw087960; Tue, 3 May 2022 11:49:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243BnHwB087959; Tue, 3 May 2022 11:49:17 GMT (envelope-from git) Date: Tue, 3 May 2022 11:49:17 GMT Message-Id: <202205031149.243BnHwB087959@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: d735d604f063 - main - mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: d735d604f063617909d98bd0fc36a6f25a14c699 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651578558; 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=s1FwOovOSep6V7xL7UEv3SAcab8IJU8EDU5vxGCfj9E=; b=eNoGgDycQb4h/5pIqPnyp2mjWQX8MAuK12cSgcmqJNv2bmGdUjD1Ia2xTGQ1nptX9MIVkm cvi36KLusVKr2MWJWAkKlLji/oq/x0uXgbx3DYEuzqHkdK2peHlsoaY8y77SUbFIOSx7Tt 5Uofvs7E9KRuOO/q0sBDQzvyelb56KqN8cW3gYPITKl5XDCUmqY5m95VpQYNsxy2yND3NP VtXOZXxMOIplOiR567jnp8DpeVbkOZGyDrd/n70Z7Owhmzu66aAdwz1TH6bVmC+CtHXflH lRa/tT684upnyi/fLBSo6phFRXAG3+m3Zn44nJKW0ff5JwIlAj3xP0aHNonrZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651578558; a=rsa-sha256; cv=none; b=MDjxLLD35C7LkyGpM3rUQLyWZeKgm2LjC9ZJRo6wJ7llybm8m1gxG5hDeBRE4oaF1TTEqU /1cEMC8AJNpyatp4alpoMKLo4ieqR/9w7MjlnoyOae6+hSW69Xh07Ae1L0uf/vcLE2rZ8E wtadqXk7Y6MuhIf8RzqXhu5zUQAnwZFoM6lR+haUGW/op9U9eoZW8negPSlxU9jurWrfyT fukYTna8GQrirxfLfDz/5nl+7AXmRwflGeEcYbEEUJBtrS2rdTXNxAA5ia0zAhqIH6zgyG aikQwivCNxYQc6fmD/y1ReGpaVR/GWuwmOE9IiYEjE5qWQFtiySclAsYWg2j7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d735d604f063617909d98bd0fc36a6f25a14c699 commit d735d604f063617909d98bd0fc36a6f25a14c699 Author: Hans Petter Selasky AuthorDate: 2022-05-02 15:14:50 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-03 11:48:43 +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 MFC after: 1 week Sponsored by: NVIDIA Networking --- 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 aedf9ba9e79e..32d5d761674f 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1363,7 +1363,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, @@ -1779,7 +1779,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, @@ -2067,7 +2067,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));