Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090748rwb; Mon, 15 Aug 2022 17:54:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fwk9mWQuBHtGV1Gmz4nZxpI+yyR/DQFy4BhwIatwMyBOgQB1Q5H5E1OqJZCVrI83rXm78 X-Received: by 2002:a05:6402:3509:b0:43e:d80b:44a8 with SMTP id b9-20020a056402350900b0043ed80b44a8mr17028569edd.255.1660611246974; Mon, 15 Aug 2022 17:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611246; cv=none; d=google.com; s=arc-20160816; b=jaRmjgyF49oXbyteFQJkcYYCR5sU1aAJQLdVKYzPE3/im/iEvD4SwcTvHUGMQi/ePm k9aySBJxa/r5jybQQ+8cpENtj3r8UFfQ6Peqkp98VPxvOfG+FbeO5KTk8rA/Wo8b//CK VHqBJtB+IKH+ab0uxSBdWpUjr7iwORKxBC6dgLzlI3M9tG6EkpK8v/ySRq8R4Ugrg3sv oesKaaxODuFn4nmjqZpvHKtuKA29dvtb//D0uew0o5zWNxfjQn0+UI5vPibkE0Rq7gsy TiBLDHcVkgnvmpe1704WjWUYLY1GS1+sVSiHvj+b00meisoi40myVF8Sn2vFD7od4iQw 2eJQ== 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=sE8A/fn8pTKcZxv4Q1++khIHRULS6514jXrHHAsouFA=; b=Kwlm5ogRZj9GRceUWvN02B+K3+htfSJCx35f0DIbIGCCTjlORBeDTIGuHjQiL+ei/Z I27F5FVxpL/QMCuu8o4HXqSyFOvVkOaiymBbH7vg7lDJsbgA5XFleRowFe9lxv8wCJ6X 1WXXFT7y0l3df0OcYMOV7EAYf12nhePXP5t8bMi3D4md6TF1ungW8ovSlm6yCrWhv+Fn 1Hj7F3iqpFITAQVZ1axU13FgUVInz8UfUZYjf4DdlepfiMrB1K5cAJL74AwoREIRkAJi AiHDuslPUHxpYzXbOzqY6bVvd+gnGUohfo0Q74CKdCiTy06e0/IEUBXuNEdq8VJ1Gew+ oaGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y2780FUk; 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 w1-20020a1709060a0100b0073064d1c27bsi7946308ejf.500.2022.08.15.17.53.41; Mon, 15 Aug 2022 17:54:06 -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=Y2780FUk; 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 S1352733AbiHPAJk (ORCPT + 99 others); Mon, 15 Aug 2022 20:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355564AbiHPAAy (ORCPT ); Mon, 15 Aug 2022 20:00:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063C1165708; Mon, 15 Aug 2022 13:20:45 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 86F326104A; Mon, 15 Aug 2022 20:20:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FAA9C433C1; Mon, 15 Aug 2022 20:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594843; bh=kgEPu1o3TFYT/KmIyxEnSlraWG2WA4Pp2qKV73Z1L/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2780FUkGWPENAdAfATjcKoVmeHe/T4MW3BRst7fempZdzFDnBZAKDGWF2BaZbByc G83hpxAVApSWL5cKGRSlp4628IFBGXZ2VanP1aQsA7hTz8Bi/lfFAl+O07e2dhyLgG wLDukUlFMlCOJuMxLV7cUvLcTvaQ6Pp+SLNR0q5w= 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 5.19 0549/1157] net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS Date: Mon, 15 Aug 2022 19:58:25 +0200 Message-Id: <20220815180501.609759167@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 b6c15efe92ad..f794ffaf1e04 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -109,7 +109,7 @@ struct page_pool; #define MLX5E_REQUIRED_WQE_MTTS (MLX5_ALIGN_MTTS(MLX5_MPWRQ_PAGES_PER_WQE + 1)) #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