Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp9776rdb; Mon, 18 Dec 2023 07:36:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEokq5JsBTWMSuMnSc1kuMceR0ACeWm886gVMPuP7QgXiP/NjnTDtk/TamBDLzti8rsg1kK X-Received: by 2002:a05:622a:1046:b0:425:4043:41b3 with SMTP id f6-20020a05622a104600b00425404341b3mr25424837qte.95.1702913771769; Mon, 18 Dec 2023 07:36:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702913771; cv=none; d=google.com; s=arc-20160816; b=R1HAl93MVZz7WfpSOCch7/PAagSHivJOWkCq9O2rN2dOP7WNLeBCItRWRPwS8YK7lQ Mk084t2bF+V8fTjlWeYOYC3RYpnsuM6SHnof/ZzLnqSEfF8CFOdBmCLNo9pyTemPtKJs n2Qya/iV7WcVc+TvhWJ+TnZVdGzGb40PSY+saMclWVmNbjcVUWtLRjo+V5NT632i0kWE AFxjxwNT6vMYGIONb6tb2gryUcuFPFXWbkSaciuHt26Jp+u+3z0/HMM/3nZ5TH/LVTbU 5xsu92y+zRdg3DrDgvV6XSnoZlIHfiu20YZovJ0JpftzmLyvQSIW0pJdZlNPnRAYEvTM opKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=r99rVTmaXp3PLbfDNxganSpUb1DQiRb6MbvQzK+q+Ro=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=p7dAIULHrV1y0RQUbOLj7bXVJEiaDA6aIfuowTLP/1GXdrMXf0T80IE5oc2rw+KOCX MHohBsJp8xRaO7CeEop0gbO/izVW6FxYk40FzJamA28LStR/AJgFDApdLBWjeP1V9kME wJJV8WrSb9oovDOcrbDntN+css7bMu1gtjWKAA8CeqOZ0t7ncUNcEugJPybXQ4iUad+J nOnylnxO67HlDoafCyIwp1ytWf0KESJjqW5p3b6QsA4vBtISQ7vlU/rwbKIi78eBkNPz f8nmUaOV/dkpkZH67e0impvyjnE8KshhNODbsFOn7nSWqFih4+t3Tuh96y9t6a0LYqjt 5k9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u15-20020a05622a14cf00b00425ef7a3d59si13294126qtx.464.2023.12.18.07.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:36:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5A5E51C230F5 for ; Mon, 18 Dec 2023 15:36:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA2724238C; Mon, 18 Dec 2023 15:35:52 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D20A13D563 for ; Mon, 18 Dec 2023 15:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 35F5E1F37E; Mon, 18 Dec 2023 15:35:49 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 2455E13BC8; Mon, 18 Dec 2023 15:35:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id unYoCNVmgGUTfQAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 15:35:49 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 01/16] nvmet: report ioccsz and iorcsz for disc ctrl Date: Mon, 18 Dec 2023 16:30:49 +0100 Message-ID: <20231218153105.12717-2-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 35F5E1F37E The host started to verify the ioccsz and iorcsz values. I/O controllers return valid values but not the discovery controllers. Use the same values as for I/O controllers. Fixes: 2fcd3ab39826 ("nvme-fabrics: check ioccsz and iorcsz") Signed-off-by: Daniel Wagner --- drivers/nvme/target/discovery.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c index 668d257fa986..e3c4d247dd23 100644 --- a/drivers/nvme/target/discovery.c +++ b/drivers/nvme/target/discovery.c @@ -249,6 +249,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req) { struct nvmet_ctrl *ctrl = req->sq->ctrl; struct nvme_id_ctrl *id; + u32 cmd_capsule_size; u16 status = 0; if (!nvmet_check_transfer_len(req, NVME_IDENTIFY_DATA_SIZE)) @@ -294,6 +295,18 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req) strscpy(id->subnqn, ctrl->subsys->subsysnqn, sizeof(id->subnqn)); + /* + * Max command capsule size is sqe + in-capsule data size. + * Disable in-capsule data for Metadata capable controllers. + */ + cmd_capsule_size = sizeof(struct nvme_command); + if (!ctrl->pi_support) + cmd_capsule_size += req->port->inline_data_size; + id->ioccsz = cpu_to_le32(cmd_capsule_size / 16); + + /* Max response capsule size is cqe */ + id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16); + status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id)); kfree(id); -- 2.43.0