Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2902675iog; Mon, 27 Jun 2022 05:25:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRTzVhGoylCetzrr/d5rj/2lU6yM9P00XRbTRxfV8NgV91M8e1iMe+i5j27k+qiFgOFyES X-Received: by 2002:a17:90a:4f86:b0:1ee:dd88:f3a6 with SMTP id q6-20020a17090a4f8600b001eedd88f3a6mr5306599pjh.37.1656332757212; Mon, 27 Jun 2022 05:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656332757; cv=none; d=google.com; s=arc-20160816; b=oNd7yXfaTccZ2kei2KVDs24B9pXEPe4FvSsPGYXqjoNffXpz2GxQTfHPMrkkAowRFw wVff0OugIeplADszqimEBo0sAwEV8l5xqshZwpp7Vd1ev/TfuWVTCZk3bOY5Z1UE5leV GIwbst5WHBAffBYSapDHHuf6Wm4vd64Da5hNCtOk+MPDmrSTxMNegWxx0i+br3eufm9j ehza0OAHmr7e7I5/6KC2RbJBZsJchnZ4iSU51JAu0G+UvlnnWIoJAmHkjKkBaNhk/oSW pkDkNh+AmpY0P3viYdoskgKp5Ma7dckfda3M9xW+PsjaaAebgkQZ7tabqXdk+4eG/aM0 wF6Q== 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=g8Hr9+Jr6wY508tmB8utw2RTf2Ab/cVgH1FvYGeXGbw=; b=upLgVMWZn+YgY8sfMaCaFzaYAyhIJy7DBNVAG6p4CvP44byxZTU7n2ByfVx8rSkvJ4 R0E85yz8+KlhxYABBYc0eJNCKY+ic3JZevG2BSC+pnwcUuCS39sKmcWMbJWFsfKZg9Nt ulyKPr7vYNHgToUqu1O+0LOUHDoi267okytnH39RTUpm8VhxRNgiFvtgR7OHj0/pmF2/ NzqYodlzbcnawMInYgX9cm8PLQPP71sD+iw2eaYdwUzXdbBZX1FkFjazW/tkgE+hie1l hhHpnB1mbmVIgcRblcvZ4nySQShPC/jeKXD9CZMzV9ceHPM6X/6WoHv3xjqorkhCwGMI AYBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSohV4ZT; 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 m19-20020a056a00081300b00525626fe8c0si17084458pfk.365.2022.06.27.05.25.45; Mon, 27 Jun 2022 05:25:57 -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=ZSohV4ZT; 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 S235066AbiF0L0Z (ORCPT + 99 others); Mon, 27 Jun 2022 07:26:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234954AbiF0LZi (ORCPT ); Mon, 27 Jun 2022 07:25:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F186598; Mon, 27 Jun 2022 04:25:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id 87260B81123; Mon, 27 Jun 2022 11:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F055DC341CB; Mon, 27 Jun 2022 11:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329121; bh=e4ymCOZXHGywOTnDX4ndbtuQkWK5+6M0Va1Vujg3/3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSohV4ZTleU5PHws0J5/wH6I35fF7NcLPrn/bXQdSxNNwWUhkH1U/5yg0anGJZLjn NvI0p8Gfz+O4OHgH6ufw+cd3Z/aOoKa5hcnn509FvB48QwLpi2kwp3vkBTkIg4FiEn zGw8aPIdtQrUxb1hFhWYr1/mH37gBYTA9aGe7968= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , Jens Axboe , Sagi Grimberg , Chaitanya Kulkarni , Himanshu Madhani , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 058/102] nvme-pci: allocate nvme_command within driver pdu Date: Mon, 27 Jun 2022 13:21:09 +0200 Message-Id: <20220627111935.192365232@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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: Keith Busch [ Upstream commit af7fae857ea22e9c2aef812e1321d9c5c206edde ] Except for pci, all the nvme transport drivers allocate a command within the driver's pdu. Align pci with everyone else by allocating the nvme command within pci's pdu and replace the .queue_rq() stack variable with this. Signed-off-by: Keith Busch Reviewed-by: Jens Axboe Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Himanshu Madhani Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 07a4d5d387cd..31c6938e5045 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -224,6 +224,7 @@ struct nvme_queue { */ struct nvme_iod { struct nvme_request req; + struct nvme_command cmd; struct nvme_queue *nvmeq; bool use_sgl; int aborted; @@ -917,7 +918,7 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx, struct nvme_dev *dev = nvmeq->dev; struct request *req = bd->rq; struct nvme_iod *iod = blk_mq_rq_to_pdu(req); - struct nvme_command cmnd; + struct nvme_command *cmnd = &iod->cmd; blk_status_t ret; iod->aborted = 0; @@ -931,24 +932,24 @@ static blk_status_t nvme_queue_rq(struct blk_mq_hw_ctx *hctx, if (unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags))) return BLK_STS_IOERR; - ret = nvme_setup_cmd(ns, req, &cmnd); + ret = nvme_setup_cmd(ns, req, cmnd); if (ret) return ret; if (blk_rq_nr_phys_segments(req)) { - ret = nvme_map_data(dev, req, &cmnd); + ret = nvme_map_data(dev, req, cmnd); if (ret) goto out_free_cmd; } if (blk_integrity_rq(req)) { - ret = nvme_map_metadata(dev, req, &cmnd); + ret = nvme_map_metadata(dev, req, cmnd); if (ret) goto out_unmap_data; } blk_mq_start_request(req); - nvme_submit_cmd(nvmeq, &cmnd, bd->last); + nvme_submit_cmd(nvmeq, cmnd, bd->last); return BLK_STS_OK; out_unmap_data: nvme_unmap_data(dev, req); -- 2.35.1