From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75CDFC388F9 for ; Tue, 27 Oct 2020 14:32:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3489E20719 for ; Tue, 27 Oct 2020 14:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809144; bh=G7bVG5paWlmju2PkmCPdYFjqKq5uqJ9Q/dZLNw6Wznc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YHMchQPlsNkRN5wNEC9bWDv7lKVoOAHW59vqIFEGTAmWa0JdOntmkYw/glNO6QT7c Eslx3g7Fn3zu/Huq9yQ6OYg4u19pxIZcVrKURYtBNbfkiwg6GubL8fGfZukZ1QevSS dVm/S2SURwD6k+mliQyiMHDVFnmQI/ZJpEJ1XJn4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760094AbgJ0OcW (ORCPT ); Tue, 27 Oct 2020 10:32:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:55692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759313AbgJ0O3E (ORCPT ); Tue, 27 Oct 2020 10:29:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 23CA820780; Tue, 27 Oct 2020 14:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808944; bh=G7bVG5paWlmju2PkmCPdYFjqKq5uqJ9Q/dZLNw6Wznc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=woM79kPkyVpR9QUePKloAfownMe+C3DsVl+DPZLQap2zlrJd4gA9IVhPvQbw2X2wn sx1QjYYtQFTak28Cvr/fwQFaF84D6qfmM6uv8F40woeC+Wz5VirGIKU6X3m9K/zaji eWFuM2/5i0GwVIcyriUKWbOAtlmDj2ht9w7n/Efc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Karsten Graul , Jakub Kicinski Subject: [PATCH 5.4 008/408] net/smc: fix valid DMBE buffer sizes Date: Tue, 27 Oct 2020 14:49:06 +0100 Message-Id: <20201027135455.435579536@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Karsten Graul [ Upstream commit ef12ad45880b696eb993d86c481ca891836ab593 ] The SMCD_DMBE_SIZES should include all valid DMBE buffer sizes, so the correct value is 6 which means 1MB. With 7 the registration of an ISM buffer would always fail because of the invalid size requested. Fix that and set the value to 6. Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM") Signed-off-by: Karsten Graul Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/smc/smc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -795,7 +795,7 @@ static struct smc_buf_desc *smcr_new_buf return buf_desc; } -#define SMCD_DMBE_SIZES 7 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */ +#define SMCD_DMBE_SIZES 6 /* 0 -> 16KB, 1 -> 32KB, .. 6 -> 1MB */ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr, bool is_dmb, int bufsize)