From patchwork Thu Oct 5 19:40:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13410685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 627D6E92731 for ; Thu, 5 Oct 2023 19:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231785AbjJETmu (ORCPT ); Thu, 5 Oct 2023 15:42:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbjJETmb (ORCPT ); Thu, 5 Oct 2023 15:42:31 -0400 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D28D9FC; Thu, 5 Oct 2023 12:42:15 -0700 (PDT) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1c63164a2b6so19663595ad.0; Thu, 05 Oct 2023 12:42:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696534935; x=1697139735; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ii59m5xCTgqg6QGOg5WM7rjN4QDexfLB+c1iYtMG1tY=; b=iCjk4zu2wuIChkX5jdTK6RWWoZ/sLbZGUMiq/jHwnFsIw25GzyqQ5TZwKhWCVCKSIG Vpyq6JALZHg7wg3qxApi+03K8A559Pqcf8Kd1iRZDss4TlnZloUnuaxog8hvhW1faUro Iht1FfijkFbTMPpHaMJjq5CFDx3kNXXKufyxdw9UBj7JEu/xDWt6CJpkZwuKqHBBnr/s OIphdEra6Offjq7oTA6mGtb+Ti7Y20Kin6IKJJFS/Ss1yDuzA77KFAG+pURIQIw5bYtv pUdA6C05HtGsP7b/+0L+ZysnLo3iHPFPi2SjdBmM1KNjXvz3cMKQQEjZVOxhg+/8zWQx MCrA== X-Gm-Message-State: AOJu0YzMmImIXgMeqmqS4TmnS4AncDArC0aglgZoHDqSWzBakvF91PCj /6agy7dBJGrr8W3Iq7xb52BTiPCyFks= X-Google-Smtp-Source: AGHT+IGF4CBKM5vKAPgrz5r5AqPIbvVjeU7Uaf/4EsHpv8WSXj9dglKXY5LQcsFaQCA3ac/MV6ZS3Q== X-Received: by 2002:a17:903:2352:b0:1b8:8682:62fb with SMTP id c18-20020a170903235200b001b8868262fbmr3655820plh.4.1696534935255; Thu, 05 Oct 2023 12:42:15 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:ca3e:70ef:bad:2f]) by smtp.gmail.com with ESMTPSA id u4-20020a170902e5c400b001a9b29b6759sm2129596plf.183.2023.10.05.12.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 12:42:14 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Niklas Cassel , Avri Altman , Bean Huo , Daejun Park , Bart Van Assche , Douglas Gilbert , "James E.J. Bottomley" Subject: [PATCH v2 10/15] scsi_debug: Support the block limits extension VPD page Date: Thu, 5 Oct 2023 12:40:56 -0700 Message-ID: <20231005194129.1882245-11-bvanassche@acm.org> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog In-Reply-To: <20231005194129.1882245-1-bvanassche@acm.org> References: <20231005194129.1882245-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From T10 document 23-024r3.pdf: "Reduced stream control: a) reduces the maximum number of streams that the device server supports; and b) increases the number of write commands that are able to specify a stream to be written in any write command that contains the GROUP NUMBER field in its CDB. If the RSCS bit (see 6.6.5) is set to one, then the device server shall: a) support per group stream identifier usage as described in 4.32.2; b) support the IO Advice Hints Grouping mode page (see 6.5.7); and c) set the MAXIMUM NUMBER OF STREAMS field (see 6.6.5) to a value that is less than 64. Device servers that set the RSCS bit to one may support other features (e.g., permanent streams (see 4.32.4)). 4.32.4 Permanent streams A permanent stream is a stream for which the device server does not allow closing or otherwise modifying the configuration of that stream. The PERM bit (see 5.9.2.3) indicates whether a stream is a permanent stream. If a STREAM CONTROL command (see 5.32) specifies the closing of a permanent stream, the device server terminates that command with CHECK CONDITION status instead of closing the specified stream. A permanent stream is always an open stream. Device severs should assign the lowest numbered stream identifiers to permanent streams." Report that reduced stream control is supported. Cc: Martin K. Petersen Cc: Douglas Gilbert Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_debug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 46eaa2f9e63b..88cba9374166 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1627,6 +1627,7 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) arr[n++] = 0xb2; /* LB Provisioning */ if (is_zbc) arr[n++] = 0xb6; /* ZB dev. char. */ + arr[n++] = 0xb7; /* Block limits extension */ } arr[3] = n - 4; /* number of supported VPD pages */ } else if (0x80 == cmd[2]) { /* unit serial number */ @@ -1669,6 +1670,9 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) arr[3] = inquiry_vpd_b2(&arr[4]); } else if (is_zbc && cmd[2] == 0xb6) { /* ZB dev. charact. */ arr[3] = inquiry_vpd_b6(devip, &arr[4]); + } else if (cmd[2] == 0xb7) { /* block limits extension page */ + arr[3] = 2; /* page length */ + arr[5] = 1; /* Reduced stream control support (RSCS) */ } else { mk_sense_invalid_fld(scp, SDEB_IN_CDB, 2, -1); kfree(arr);