Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1559878pxf; Fri, 9 Apr 2021 11:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9yr+Bc+37DylwFWfbNVB4K89OUbFY/Xpe77kWAeWIMhAxkuZHy2NdUxmLGB/z3z9a/XjH X-Received: by 2002:a17:906:1f89:: with SMTP id t9mr17191545ejr.144.1617992486866; Fri, 09 Apr 2021 11:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617992486; cv=none; d=google.com; s=arc-20160816; b=ua8ipdlePcrOiJJk/7Lk4f9Lvh4LpiXQaqpTBZXQWdYY4jGt1ANvp6GUqgIsNY4ZcC 6JYwDOiBN14zClJpM4qklU3ff+Y5QzPvmRRmOobPhTnY0CBNV82mU1qlTg55zvmP2okH NJAaXkV+iANykzueoyRLmnIZ1lqaL3erHIrOamOZGHth1y+1AAChw5Kt/00xD1NUgaOc mbY0qB7PfczTLRYufuPoSmlHj14Qy6SpaxMV0O698Ofsw1NSd6WIvxLYhpUe1dC6Xq5K st0FfizrXxBot6eNTQJ5hFNz0vTIrsuyfDINHOkv9nuBUtsL8/t/aqTsVhwiIEcmhPat +D9w== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=d9+NVrEhCD/F0hqwPtTi0LWkrNwo6qZA/Ms9P1Fu/dE=; b=JHh6JhWHtx+vbzG2k55aEI3bK9L81olneb7Km+n3BSCzVBMIISldngx2Ro9GADIQ8A k6K/c2Oidsa/a+y793AL77o4Qaet+bpLZt/30JsXniqfSINx4TTc3KL5Xe4FkDcOqWgo BAFR+uiy6B+Ea/xJr75Vw3/gWmRFlxA8xGQIa4djxWIG9fkMQ28vRA2qraVemjiLlP/v khuVj14GQL9jE/5X7iufNe5qH7gkaded2XDtEIZJkFl2X6pLwq0cM4D7JLFbXkmj0fzX uS7eJsS9PNuyzzwubClvh85A5yNPj4hFM6DNPl83JJRckFBZpb3bXD70ydm6C6f7k7DN KpiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@flawful.org header.s=mail header.b=W5fQs61k; dkim=pass (test mode) header.i=@flawful.org header.s=mail header.b=vWJAMXWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca23si2822461edb.92.2021.04.09.11.21.03; Fri, 09 Apr 2021 11:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@flawful.org header.s=mail header.b=W5fQs61k; dkim=pass (test mode) header.i=@flawful.org header.s=mail header.b=vWJAMXWS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234490AbhDISU0 (ORCPT + 99 others); Fri, 9 Apr 2021 14:20:26 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:50970 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233332AbhDISUZ (ORCPT ); Fri, 9 Apr 2021 14:20:25 -0400 X-Greylist: delayed 380 seconds by postgrey-1.27 at vger.kernel.org; Fri, 09 Apr 2021 14:20:24 EDT Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id A3EB03F63C for ; Fri, 9 Apr 2021 20:13:43 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=flawful.org header.i=@flawful.org header.b=W5fQs61k; dkim=pass (1024-bit key) header.d=flawful.org header.i=@flawful.org header.b=vWJAMXWS; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.099 X-Spam-Level: X-Spam-Status: No, score=-2.099 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=flawful.org header.b=W5fQs61k; dkim=pass (1024-bit key) header.d=flawful.org header.b=vWJAMXWS Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id juMtM90bmg-9 for ; Fri, 9 Apr 2021 20:13:43 +0200 (CEST) Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 303063F5B2 for ; Fri, 9 Apr 2021 20:13:43 +0200 (CEST) Received: by flawful.org (Postfix, from userid 112) id 7F5A7E74; Fri, 9 Apr 2021 20:13:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flawful.org; s=mail; t=1617992028; bh=d9+NVrEhCD/F0hqwPtTi0LWkrNwo6qZA/Ms9P1Fu/dE=; h=From:To:Cc:Subject:Date:From; b=W5fQs61k2qA8w4299LVpNjMKu/KMwVSAm/KD9wsQ51wXTojlqx8fNpbWZFJqohx1d TDE6xsGW1ykOGbH7CdRL6n3vNCimdv4lhoUW8lTNnXMipGo5tODKSYiAzSeb8Sh7Rk F08TyCsP4/+JxWPaWiifmTrry4x32RlHw+SuY7SY= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id D2C50902; Fri, 9 Apr 2021 20:13:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flawful.org; s=mail; t=1617992012; bh=d9+NVrEhCD/F0hqwPtTi0LWkrNwo6qZA/Ms9P1Fu/dE=; h=From:To:Cc:Subject:Date:From; b=vWJAMXWS8k0oAnUQExQned5Wptkii57LjTBKwvRlPAMI1YVsn4yfgyBm47hLLqzP9 wLJ0HZr2lszjuHIFj1jAnpMXThqG/jRDy6bmp9yJ3YiSUpE5vfzrF6ScmWL8LJpzNo aQiEAESB4hYsIK/qOu8ZTT2iAsk2wbCNPfkOEN+k= From: Niklas Cassel To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni Cc: Niklas Cassel , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme-pci: don't simple map sgl when sgls are disabled Date: Fri, 9 Apr 2021 20:12:55 +0200 Message-Id: <20210409181255.101847-1-nks@flawful.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel According to the module parameter description for sgl_threshold, a value of 0 means that SGLs are disabled. If SGLs are disabled, we should respect that, even for the case where the request is made up of a single physical segment. Fixes: 297910571f08 ("nvme-pci: optimize mapping single segment requests using SGLs") Signed-off-by: Niklas Cassel --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d47bb18b976a..b06e685d1250 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -854,7 +854,7 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req, return nvme_setup_prp_simple(dev, req, &cmnd->rw, &bv); - if (iod->nvmeq->qid && + if (iod->nvmeq->qid && sgl_threshold && dev->ctrl.sgls & ((1 << 0) | (1 << 1))) return nvme_setup_sgl_simple(dev, req, &cmnd->rw, &bv); -- 2.30.2