From patchwork Thu Apr 16 13:23:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 227845 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=-6.8 required=3.0 tests=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=ham 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 883E6C3815B for ; Thu, 16 Apr 2020 13:46:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C33521974 for ; Thu, 16 Apr 2020 13:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587044777; bh=i/WQ4zp2hHzop+pFU2DiVs4dApyLMmZBX3q6djS2+kI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T8D3XgSkGEytateFgvDZjxlG3YUn4hDmkG9DE5kNRdgTbEIyn7j90z3R9O/2nUTrm XF4gNdrk832QWFN6j4XJudU5+zxpAvbEwDrMawglpPFqG68nanUu1ixjSV+R/meC5S Zd8JQ11QnfAhXZShXmXxCtpA4C90TgO+t7zJAt8Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2898555AbgDPNqP (ORCPT ); Thu, 16 Apr 2020 09:46:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439547AbgDPNqN (ORCPT ); Thu, 16 Apr 2020 09:46:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 B2F5C21744; Thu, 16 Apr 2020 13:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587044772; bh=i/WQ4zp2hHzop+pFU2DiVs4dApyLMmZBX3q6djS2+kI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZIlUQcEcq/3Nc8GkkNMRs+EHKlAz2XqrgyXzSVHTynF2Yd8i51RfCuoLiNBQ9OAL8 B8v0EBIeQUoB5kl6mUV0JcW5gReVxYOZbApejlRvPj6x5/OMuQnr83LE/1itsiQFXJ O8vShyoxdfgEud5rp2aQfVTOiRoLm5ejViKgJazE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenhua Liu , Sagi Grimberg , Keith Busch Subject: [PATCH 5.4 096/232] nvmet-tcp: fix maxh2cdata icresp parameter Date: Thu, 16 Apr 2020 15:23:10 +0200 Message-Id: <20200416131326.982034058@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131316.640996080@linuxfoundation.org> References: <20200416131316.640996080@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sagi Grimberg commit 9cda34e37489244a8c8628617e24b2dbc8a8edad upstream. MAXH2CDATA is not zero based. Also no reason to limit ourselves to 1M transfers as we can do more easily. Make this an arbitrary limit of 16M. Reported-by: Wenhua Liu Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Sagi Grimberg Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/target/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -794,7 +794,7 @@ static int nvmet_tcp_handle_icreq(struct icresp->hdr.pdo = 0; icresp->hdr.plen = cpu_to_le32(icresp->hdr.hlen); icresp->pfv = cpu_to_le16(NVME_TCP_PFV_1_0); - icresp->maxdata = cpu_to_le32(0xffff); /* FIXME: support r2t */ + icresp->maxdata = cpu_to_le32(0x400000); /* 16M arbitrary limit */ icresp->cpda = 0; if (queue->hdr_digest) icresp->digest |= NVME_TCP_HDR_DIGEST_ENABLE;