Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3403723rwa; Tue, 23 Aug 2022 04:19:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5mF9VMeUtHXLXRRDbdB6/6GdSgLXN2LU1Ia56EYvgvn2M9AFIRVWhpw1l8rPHEDH4Syz3y X-Received: by 2002:a17:902:cec7:b0:172:5b09:161c with SMTP id d7-20020a170902cec700b001725b09161cmr23503027plg.60.1661253572113; Tue, 23 Aug 2022 04:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253572; cv=none; d=google.com; s=arc-20160816; b=YpDQj8AmW6Yh7xjDeG/oG20hZaMtjhG9wTgvplepAC6W6VnOJMThMEUAEwCHMcMgHr WOB0cV28PRGdD4w5PC6liQRyH3WxH0o24RNJ78YZB0Ce2W3ZapU3TOpHWtxa/ZDI/hou GZOAFlr2hucYBIFuGHmVne25zIq6SLJ7Wv/7huy4NldBio2k2z5uhQ6ufLX4khsRf/bd Vg4KH+Iazq8JkiacgPzSy7UhrZ4Rw/yuwfkfWfN14XFp/hycsFDcr8G7cIiJ/eEzrllh 5lxBwkwHaBR1ZHp/wZpzpwm0JrIlkMarUDr+RypwjSbxbCJBO1l2L21Fj5znIKvLaRJJ pkAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gsaQw/5kPfFilifkvw2gzvBtyXLuZxskm/okNKxTAJ0=; b=tB+U/BzQ53g7Ucp5+m0Br7r2/UrAGOx/VTAkgHLpXS7JHvUfePIF+GWV8BdYO7HPQo r12sUGAk6N620CYJDmN51CNjLKc2yzGVdO5yNIqe+SXe4oSnVCq7uemNB38LfxgvXrAk HRuVRbDsNUkODH0t9pyb2opCo38hH/l69XpWrg2Ayw/cK/WgPB2gps54bbxMimCUBBQ1 qR712gXf0BW/517RQJn+UI0HtFBIIXgPbQn0w4vFbvr4BTQU5m8/eKtxd2DdoqQDVW51 TtRkfQBeGTtpLILnvn4V2d04ezJhKcCQbIjgsrQOuB3KOyAffyxWyjhSk5fQCBtIoKnu dkHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0UsEuYJ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a170902d35200b00171230490b8si8498891plk.129.2022.08.23.04.19.21; Tue, 23 Aug 2022 04:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0UsEuYJ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354522AbiHWKpC (ORCPT + 99 others); Tue, 23 Aug 2022 06:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355686AbiHWKgy (ORCPT ); Tue, 23 Aug 2022 06:36:54 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0383085F86; Tue, 23 Aug 2022 02:07:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 77BF3CE1B5C; Tue, 23 Aug 2022 09:07:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76FF8C433C1; Tue, 23 Aug 2022 09:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245637; bh=dY5yYAc4TF4/LkVrqeL+lzkmkOuVcol4Dx4A8WuudUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0UsEuYJ0lvVkBO4v9qtFQewQldoNAtmMmJomz3NSxCzB9dJvPYY8CiyPfkLcLBHfi mbXSbwNwpKOz2j1WiAsTQ6fUCr8CweUfjTLzLIl2e8Xf9n082kn8hgwhboW5RC/EqP qL0UoA+SbYatvHA1RCGLKigTyZ7yM4siXxdK10fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 4.19 109/287] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS Date: Tue, 23 Aug 2022 10:24:38 +0200 Message-Id: <20220823080104.047596959@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Mikityanskiy [ Upstream commit 562696c3c62c7c23dd896e9447252ce9268cb812 ] MLX5E_MAX_RQ_NUM_MTTS should be the maximum value, so that MLX5_MTT_OCTW(MLX5E_MAX_RQ_NUM_MTTS) fits into u16. The current value of 1 << 17 results in MLX5_MTT_OCTW(1 << 17) = 1 << 16, which doesn't fit into u16. This commit replaces it with the maximum value that still fits u16. Fixes: 73281b78a37a ("net/mlx5e: Derive Striding RQ size from MTU") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index d79e177f8990..ec303d4d2d7a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -95,7 +95,7 @@ struct page_pool; #define MLX5E_LOG_ALIGNED_MPWQE_PPW (ilog2(MLX5E_REQUIRED_WQE_MTTS)) #define MLX5E_REQUIRED_MTTS(wqes) (wqes * MLX5E_REQUIRED_WQE_MTTS) #define MLX5E_MAX_RQ_NUM_MTTS \ - ((1 << 16) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */ + (ALIGN_DOWN(U16_MAX, 4) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */ #define MLX5E_ORDER2_MAX_PACKET_MTU (order_base_2(10 * 1024)) #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW \ (ilog2(MLX5E_MAX_RQ_NUM_MTTS / MLX5E_REQUIRED_WQE_MTTS)) -- 2.35.1