From patchwork Fri Jul 14 07:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Hindborg X-Patchwork-Id: 13313057 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 50973EB64DA for ; Fri, 14 Jul 2023 07:25:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234845AbjGNHZa (ORCPT ); Fri, 14 Jul 2023 03:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233975AbjGNHZ2 (ORCPT ); Fri, 14 Jul 2023 03:25:28 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF1A271E for ; Fri, 14 Jul 2023 00:25:25 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fb8574a3a1so2683082e87.1 for ; Fri, 14 Jul 2023 00:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1689319524; x=1689924324; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=f2Wu6QIlizBtEokw90LPWWON38SIdYdvvEsVMj5xrKM=; b=ggD3NGEx9VLtwxoCk9j9fiIuZJtmLVG2+D9Am2YHr1VsM384ZapAjgjAhCkE0/HHCN oA149LFWsngBRuUQO/9pD1rgI6DpL2fxDzk3JC5xC/YF0Gz7xg+dxAckSW+hp7DzjSh/ ksfHz0nYeaZ94hkS4dKK6uXVS64tmxK32eJcehkByczO/C5HpBqYkNoyN2k2pRRjOLzL VdYd3tjOBNXwpEwzlPW2Di7jOEpfS4pqKKi+JyLNLj4fpeCwig23brBge0G0nN7yglvs ZH4D9kMRv9YzBPBbS3gpk7MuXsucddJcs+nxKmWSz1vUTc7r6lIQTdkDmlhsrCUFig5A FydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689319524; x=1689924324; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f2Wu6QIlizBtEokw90LPWWON38SIdYdvvEsVMj5xrKM=; b=Nnmv+1d1OPMs/6MeXqUJPGjwbj4xuNz7X1A8kKttfavy5GTEa+OhFHHM80e5ARZzGY vSvJ8m8XHa9cXwA+IqzBdPF5SXr0hj3pEwSeOdvLVaDUlzFuR6wpikaJYjAEzAp0PBdm n8u44rjH9C9aB/pnNrjBD5vvVKSoSAYVgQCUEDhakBuqXyh0uP6XDvUMmFHIMo1PKb2y B5b/xnRiQ9ZnGzn6xbulWaqxusQQG/YRgYwRN/PQDWrSnvxDrBKjr9I1fSmk0+ZXmL2d x+WWWW2nty9665Ve7L7wL8w7FCLRwkdVN791OzdRLAAbrryrKm+R9LOjzRe4GT5D9USN 5gnA== X-Gm-Message-State: ABy/qLbeq3+MuXS5tOYKama59i3ZRy2dkE35hnAd+cMjlXigJp7sLHQt 5xyi2IIFFYgZ79gJU00FNA7fcg== X-Google-Smtp-Source: APBJJlFxFh9/7o0h24xSGD4XN7JrlwTI+CHcMTm73B48WcJZw7o9GcGGqI/o0/Fk1zCXlaqCGH1LSQ== X-Received: by 2002:a05:6512:304a:b0:4f3:b588:48d0 with SMTP id b10-20020a056512304a00b004f3b58848d0mr3285807lfb.14.1689319524098; Fri, 14 Jul 2023 00:25:24 -0700 (PDT) Received: from localhost ([185.108.254.55]) by smtp.gmail.com with ESMTPSA id i14-20020a056512006e00b004fb77d6cab3sm1380615lfo.261.2023.07.14.00.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 00:25:23 -0700 (PDT) From: Andreas Hindborg To: Ming Lei Cc: Matias Bjorling , linux-kernel@vger.kernel.org (open list), Damien Le Moal , Jens Axboe , gost.dev@samsung.com, Christoph Hellwig , Andreas Hindborg , Johannes Thumshirn , Aravind Ramesh , linux-block@vger.kernel.org (open list:BLOCK LAYER), Hans Holmberg , Minwoo Im Subject: [PATCH v9 0/2] ublk: enable zoned storage support Date: Fri, 14 Jul 2023 09:25:08 +0200 Message-ID: <20230714072510.47770-1-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Andreas Hindborg Hi All, This patch set adds zoned storage support to `ublk`. The first patch does some house cleaning in preparation for the last patch. The last patch adds support for report_zones and the following operations: - REQ_OP_ZONE_OPEN - REQ_OP_ZONE_CLOSE - REQ_OP_ZONE_FINISH - REQ_OP_ZONE_RESET - REQ_OP_ZONE_APPEND A user space component based on ubdsrv is available for testing [1] with the "loop" target. Read/write and zone operations are tested with zenfs [2]. The zone append path is tested with fio -> zonefs -> ublk -> null_blk. The implementation of zone append requires ublk user copy feature, and therefore the series is based on branch for-next (6afa337a3789) of [3]. Changes for v9 - Move setup of IO descriptor for zoned operations into separate function - Fix an issue in `ublk_report_zones()` where zone report size was set to `remaining_zones` instead of `zones_in_request` - Do not truncate bufsize to `queue_max_segments` pages in `ublk_alloc_report_buffer()` - Do not change signature of `ublk_dev_param_basic_apply()` (not needed) [1] https://github.com/metaspace/ubdsrv/tree/acc072e077bceea390bae14b6ccb8087f6d0cf1a [2] https://github.com/westerndigitalcorporation/zenfs [3] https://git.kernel.dk/linux.git Andreas Hindborg (2): ublk: add helper to check if device supports user copy ublk: enable zoned storage support drivers/block/ublk_drv.c | 342 ++++++++++++++++++++++++++++++++-- include/uapi/linux/ublk_cmd.h | 36 +++- 2 files changed, 360 insertions(+), 18 deletions(-) base-commit: 3261ea42710e9665c9151006049411bd23b5411f