From nobody Sun Dec 15 22:48:45 2024 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 4YBJCK3xyqz5hQYJ; Sun, 15 Dec 2024 22:48:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBJCK3NZpz4s3N; Sun, 15 Dec 2024 22:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734302925; 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=71X4J82u6PWGg37OkGxRgEI+h3jJmv/IY1fgMYiSLoY=; b=Lifr4jfL1Gxuk9FVu28XatRp0D4g8b+06xqkMygp7E7NQABhh8bMX5dV22hzSdJLAqlQev pO6IJJQhP4o0C+nlfLm0RFqODUROiZFFUOb5NutPhZHnHE5FWDUM9jy15EeCTIeNIaQyw5 vpC+yM5MJHsCXEsoGyVbDFaOhXLyb2sxNp+WR/HL5csT+XP0rlw4QBYqPp2gzIPwRQxX5d r1kxi9Q2Y1nQuPpyEqWoE1bA8eLHDg984EtmMUO51/Izy4Ek7VDwuCBq5rxuw8u8uH2uMX s2G8fQsYmq1jA6BHnEN1v8ReNiDX0ovcH5LotOf6/lW1j8fUxrBABMnzxz7RAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734302925; 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=71X4J82u6PWGg37OkGxRgEI+h3jJmv/IY1fgMYiSLoY=; b=rV5BZOyOKzouCw7Ic/h0QGR+CMSZH5MA8XIfwhvmLBzwYzCkZppyY76cJYTTlrZuV2sL6c Hzr1JNW9VTvyLWOT/Jwjx+5aZAzEXOSeHXAxi/9ShQXK5MGaOoh16bpeva49NEmMaGLP5P 50hCPMaKENhcXT/5N8h0HluGJkAzvBh/acZ7kbpmkWMTPJWUSQCsecFPmgtKEbJ5btwIEt lvo7Qm6Q1au1QsTX3xTc+fjBOOwj+u5gaZM/aAPo/gR6PyDqwVDqtMR/SG/2UiUHIZFo3S 21hOZ6CJdsBXUxtjCt9/lgotruFZUOuWIiMot6U11L0AqQZHX/Fi8fKxBb+/rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734302925; a=rsa-sha256; cv=none; b=mWhB4M20bPIZFsJCydAiJHrKV6barfuIlhhKI5NNx8jIQBiZK2OpQyqppeyKy9+x6/0fut aR9GbQeH21WeM140U7+BdJl7qeAlP2QNIH6p/j4Rh1Z/EVZSt+1gQTXFS9i0FT3yA1KIXW ql2coO2qJgzUykuTZ93EoOzt1Zz/BxTT/mNIS4EaTagP/qA30XCxAwMTZiFlu1zlkdgvQZ kwSBsGuX+XVD7nB5Usas/18n+NB3cOIgv23KiciPVFwKgvMoYBMsE/Du2sgI/Rvuned/u8 QG0g+Slp6Sge90QWNnOP0jT5V/d0mAjFMsjoL/OA1U1FTz3U5zRVRJmwLi/AvQ== 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 4YBJCK30jJzRsg; Sun, 15 Dec 2024 22:48:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BFMmjOU061789; Sun, 15 Dec 2024 22:48:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BFMmjnq061786; Sun, 15 Dec 2024 22:48:45 GMT (envelope-from git) Date: Sun, 15 Dec 2024 22:48:45 GMT Message-Id: <202412152248.4BFMmjnq061786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2fb2c0351237 - main - mlx5_core: fix "no space" error on sriov enablement 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fb2c0351237aed71abedb7eb6d737b4390b490a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2fb2c0351237aed71abedb7eb6d737b4390b490a commit 2fb2c0351237aed71abedb7eb6d737b4390b490a Author: Ariel Ehrenberg AuthorDate: 2024-11-25 13:10:41 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-15 22:27:53 +0000 mlx5_core: fix "no space" error on sriov enablement Change POOL_NEXT_SIZE define value from 0 to BIT(30), since this define is used to request the available maximum sized flow table, and zero doesn't make sense for it, whereas many places in the driver use zero explicitly expecting the smallest table size possible but instead due to this define they end up allocating the biggest table size unawarely. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_core/fs_ft_pool.h | 2 +- sys/dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/fs_ft_pool.h b/sys/dev/mlx5/mlx5_core/fs_ft_pool.h index b81e70d51bd6..a5e4df624e27 100644 --- a/sys/dev/mlx5/mlx5_core/fs_ft_pool.h +++ b/sys/dev/mlx5/mlx5_core/fs_ft_pool.h @@ -9,7 +9,7 @@ #include #include -#define POOL_NEXT_SIZE 0 +#define POOL_NEXT_SIZE BIT(30) int mlx5_ft_pool_init(struct mlx5_core_dev *dev); void mlx5_ft_pool_destroy(struct mlx5_core_dev *dev); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c index c14590acc772..70d9d235b629 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_ft_pool.c @@ -50,7 +50,8 @@ mlx5_ft_pool_get_avail_sz(struct mlx5_core_dev *dev, enum fs_flow_table_type tab int i, found_i = -1; for (i = ARRAY_SIZE(FT_POOLS) - 1; i >= 0; i--) { - if (dev->priv.ft_pool->ft_left[i] && FT_POOLS[i] >= desired_size && + if (dev->priv.ft_pool->ft_left[i] && + (FT_POOLS[i] >= desired_size || desired_size == POOL_NEXT_SIZE) && FT_POOLS[i] <= max_ft_size) { found_i = i; if (desired_size != POOL_NEXT_SIZE)