bdev/nvme: Remove OCSSD support

As far as we're aware, this is not in use by anyone. OCSSD has largely
been replaced by ZNS and no OCSSD drives made it to the market.

Change-Id: I020ee277da5292f8c4777f224acafd87586f8238
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2021-08-27 13:23:56 -07:00 committed by Tomasz Zawadzki
parent 5deb77ad89
commit d39c4443d4
20 changed files with 18 additions and 3242 deletions

View File

@ -22,6 +22,10 @@ with new `spdk_bdev_module_fini_start_done` API.
Deprecated `spdk_bdev_module_finish_done()` API, which will be removed in SPDK 22.01.
Bdev modules should use `spdk_bdev_module_fini_done()` instead.
The `ocssd` bdev has been removed. The Open Channel specification has been largely superceded by
zoned namespaces, few if any devices have been brough to market, and there is little reason to
continue to support this. OCSSD support in the nvme driver will remain for now.
### dma
A new library, lib/dma, has been added. This library provides the necessary infrastructure for

View File

@ -150,62 +150,6 @@ Both interfaces require the same arguments which are described by the `--help` o
- base bdev's name (base bdev must implement bdev_zone API)
- UUID of the FTL device (if the FTL is to be restored from the SSD)
### FTL usage with OCSSD nvme bdev {#ftl_ocssd}
This option requires an Open Channel SSD, which can be emulated using QEMU.
The QEMU with the patches providing Open Channel support can be found on the SPDK's QEMU fork
on [spdk-3.0.0](https://github.com/spdk/qemu/tree/spdk-3.0.0) branch.
## Configuring QEMU {#ftl_qemu_config}
To emulate an Open Channel device, QEMU expects parameters describing the characteristics and
geometry of the SSD:
- `serial` - serial number,
- `lver` - version of the OCSSD standard (0 - disabled, 1 - "1.2", 2 - "2.0"), libftl only supports
2.0,
- `lba_index` - default LBA format. Possible values can be found in the table below (libftl only supports lba_index >= 3):
- `lnum_ch` - number of groups,
- `lnum_lun` - number of parallel units
- `lnum_pln` - number of planes (logical blocks from all planes constitute a chunk)
- `lpgs_per_blk` - number of pages (smallest programmable unit) per chunk
- `lsecs_per_pg` - number of sectors in a page
- `lblks_per_pln` - number of chunks in a parallel unit
- `laer_thread_sleep` - timeout in ms between asynchronous events requesting the host to relocate
the data based on media feedback
- `lmetadata` - metadata file
|lba_index| data| metadata|
|---------|-----|---------|
| 0 | 512B| 0B |
| 1 | 512B| 8B |
| 2 | 512B| 16B |
| 3 |4096B| 0B |
| 4 |4096B| 64B |
| 5 |4096B| 128B |
| 6 |4096B| 16B |
For more detailed description of the available options, consult the `hw/block/nvme.c` file in
the QEMU repository.
Example:
```
$ /path/to/qemu [OTHER PARAMETERS] -drive format=raw,file=/path/to/data/file,if=none,id=myocssd0
-device nvme,drive=myocssd0,serial=deadbeef,lver=2,lba_index=3,lnum_ch=1,lnum_lun=8,lnum_pln=4,
lpgs_per_blk=1536,lsecs_per_pg=4,lblks_per_pln=512,lmetadata=/path/to/md/file
```
In the above example, a device is created with 1 channel, 8 parallel units, 512 chunks per parallel
unit, 24576 (`lnum_pln` * `lpgs_per_blk` * `lsecs_per_pg`) logical blocks in each chunk with logical
block being 4096B. Therefore the data file needs to be at least 384G `(8 * 512 * 24576 * 4096B)`
of size and can be created with the following command:
```
fallocate -l 384G /path/to/data/file
```
## Configuring SPDK {#ftl_spdk_config}
To verify that the drive is emulated correctly, one can check the output of the NVMe identify app
@ -226,40 +170,6 @@ Model Number: QEMU NVMe Ctrl
... other info ...
Namespace OCSSD Geometry
=======================
OC version: maj:2 min:0
... other info ...
Groups (channels): 1
PUs (LUNs) per group: 8
Chunks per LUN: 512
Logical blks per chunk: 24576
... other info ...
```
In order to create FTL on top Open Channel SSD, the following steps are required:
1) Attach OCSSD NVMe controller
2) Create OCSSD bdev on the controller attached in step 1 (user could specify parallel unit range
and create multiple OCSSD bdevs on single OCSSD NVMe controller)
3) Create FTL bdev on top of bdev created in step 2
Example:
```
$ scripts/rpc.py bdev_nvme_attach_controller -b nvme0 -a 00:0a.0 -t pcie
$ scripts/rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1
nvme0n1
$ scripts/rpc.py bdev_ftl_create -b ftl0 -d nvme0n1
{
"name": "ftl0",
"uuid": "3b469565-1fa5-4bfb-8341-747ec9fca9b9"
}
```
## FTL usage with zone block bdev {#ftl_zone_block}

View File

@ -4137,79 +4137,6 @@ Example response:
}
~~~
### bdev_ocssd_create {#rpc_bdev_ocssd_create}
Create Open Channel zoned bdev on specified Open Channel controller.
#### Parameters
Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
ctrlr_name | Required | string | OC NVMe controller
name | Required | string | Bdev name to create
nsid | Optional | string | namespace ID
#### Example
Example request:
~~~
{
"jsonrpc": "2.0",
"method": "bdev_ocssd_create",
"id": 1,
"params": {
"ctrlr_name": "nvme0",
"bdev_name": "nvme0n1"
}
}
~~~
Example response:
~~~
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
~~~
### bdev_ocssd_delete {#rpc_bdev_ocssd_delete}
Delete Open Channel zoned bdev.
#### Parameters
Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
name | Required | string | Bdev name to delete
#### Example
Example request:
~~~
{
"jsonrpc": "2.0",
"method": "bdev_ocssd_delete",
"id": 1,
"params": {
"name": "nvme0n1"
}
}
~~~
Example response:
~~~
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
~~~
### bdev_pmem_create_pool {#rpc_bdev_pmem_create_pool}
Create a @ref bdev_config_pmem blk pool file. It is equivalent of following `pmempool create` command:

View File

@ -37,7 +37,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
SO_VER := 4
SO_MINOR := 0
C_SRCS = bdev_nvme.c bdev_nvme_rpc.c nvme_rpc.c common.c bdev_ocssd.c bdev_ocssd_rpc.c
C_SRCS = bdev_nvme.c bdev_nvme_rpc.c nvme_rpc.c common.c
C_SRCS-$(CONFIG_NVME_CUSE) += bdev_nvme_cuse_rpc.c
ifeq ($(OS),Linux)

View File

@ -35,7 +35,6 @@
#include "spdk/stdinc.h"
#include "bdev_nvme.h"
#include "bdev_ocssd.h"
#include "spdk/accel_engine.h"
#include "spdk/config.h"
@ -203,7 +202,6 @@ static void nvme_ctrlr_populate_standard_namespace(struct nvme_ctrlr *nvme_ctrlr
static populate_namespace_fn g_populate_namespace_fn[] = {
NULL,
nvme_ctrlr_populate_standard_namespace,
bdev_ocssd_populate_namespace,
};
typedef void (*depopulate_namespace_fn)(struct nvme_ns *nvme_ns);
@ -212,7 +210,6 @@ static void nvme_ctrlr_depopulate_standard_namespace(struct nvme_ns *nvme_ns);
static depopulate_namespace_fn g_depopulate_namespace_fn[] = {
NULL,
nvme_ctrlr_depopulate_standard_namespace,
bdev_ocssd_depopulate_namespace,
};
typedef void (*config_json_namespace_fn)(struct spdk_json_write_ctx *w,
@ -223,7 +220,6 @@ static void nvme_ctrlr_config_json_standard_namespace(struct spdk_json_write_ctx
static config_json_namespace_fn g_config_json_namespace_fn[] = {
NULL,
nvme_ctrlr_config_json_standard_namespace,
bdev_ocssd_namespace_config_json,
};
struct spdk_nvme_qpair *
@ -1083,13 +1079,6 @@ bdev_nvme_create_ctrlr_channel_cb(void *io_device, void *ctx_buf)
TAILQ_INIT(&ctrlr_ch->pending_resets);
if (spdk_nvme_ctrlr_is_ocssd_supported(nvme_ctrlr->ctrlr)) {
rc = bdev_ocssd_create_io_channel(ctrlr_ch);
if (rc != 0) {
goto err_ocssd_ch;
}
}
ctrlr_ch->ctrlr = nvme_ctrlr;
rc = bdev_nvme_create_qpair(ctrlr_ch);
@ -1100,10 +1089,6 @@ bdev_nvme_create_ctrlr_channel_cb(void *io_device, void *ctx_buf)
return 0;
err_qpair:
if (ctrlr_ch->ocssd_ch) {
bdev_ocssd_destroy_io_channel(ctrlr_ch);
}
err_ocssd_ch:
spdk_put_io_channel(pg_ch);
return rc;
@ -1116,10 +1101,6 @@ bdev_nvme_destroy_ctrlr_channel_cb(void *io_device, void *ctx_buf)
assert(ctrlr_ch->group != NULL);
if (ctrlr_ch->ocssd_ch != NULL) {
bdev_ocssd_destroy_io_channel(ctrlr_ch);
}
bdev_nvme_destroy_qpair(ctrlr_ch);
spdk_put_io_channel(spdk_io_channel_from_ctx(ctrlr_ch->group));
@ -1852,11 +1833,7 @@ nvme_ctrlr_populate_namespaces(struct nvme_ctrlr *nvme_ctrlr,
if (!nvme_ns->populated && ns_is_active) {
nvme_ns->id = nsid;
nvme_ns->ctrlr = nvme_ctrlr;
if (spdk_nvme_ctrlr_is_ocssd_supported(ctrlr)) {
nvme_ns->type = NVME_NS_OCSSD;
} else {
nvme_ns->type = NVME_NS_STANDARD;
}
nvme_ns->type = NVME_NS_STANDARD;
nvme_ns->bdev = NULL;
@ -1996,10 +1973,6 @@ aer_cb(void *arg, const struct spdk_nvme_cpl *cpl)
if ((event.bits.async_event_type == SPDK_NVME_ASYNC_EVENT_TYPE_NOTICE) &&
(event.bits.async_event_info == SPDK_NVME_ASYNC_EVENT_NS_ATTR_CHANGED)) {
nvme_ctrlr_populate_namespaces(nvme_ctrlr, NULL);
} else if ((event.bits.async_event_type == SPDK_NVME_ASYNC_EVENT_TYPE_VENDOR) &&
(event.bits.log_page_identifier == SPDK_OCSSD_LOG_CHUNK_NOTIFICATION) &&
spdk_nvme_ctrlr_is_ocssd_supported(nvme_ctrlr->ctrlr)) {
bdev_ocssd_handle_chunk_notification(nvme_ctrlr);
} else if ((event.bits.async_event_type == SPDK_NVME_ASYNC_EVENT_TYPE_NOTICE) &&
(event.bits.async_event_info == SPDK_NVME_ASYNC_EVENT_ANA_CHANGE)) {
nvme_ctrlr_read_ana_log_page(nvme_ctrlr);
@ -2172,11 +2145,9 @@ nvme_ctrlr_create(struct spdk_nvme_ctrlr *ctrlr,
}
if (spdk_nvme_ctrlr_is_ocssd_supported(ctrlr)) {
rc = bdev_ocssd_init_ctrlr(nvme_ctrlr);
if (spdk_unlikely(rc != 0)) {
SPDK_ERRLOG("Unable to initialize OCSSD controller\n");
goto err;
}
SPDK_ERRLOG("OCSSDs are not supported");
rc = -ENOTSUP;
goto err;
}
nvme_ctrlr->prchk_flags = prchk_flags;

File diff suppressed because it is too large Load Diff

View File

@ -1,61 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SPDK_BDEV_OCSSD_H
#define SPDK_BDEV_OCSSD_H
#include "spdk/stdinc.h"
#include "common.h"
typedef void (*bdev_ocssd_create_cb)(const char *bdev_name, int status, void *ctx);
typedef void (*bdev_ocssd_delete_cb)(int status, void *ctx);
void bdev_ocssd_create_bdev(const char *ctrlr_name, const char *bdev_name, uint32_t nsid,
bdev_ocssd_create_cb cb_fn, void *cb_arg);
void bdev_ocssd_delete_bdev(const char *bdev_name, bdev_ocssd_delete_cb cb_fn, void *cb_arg);
void bdev_ocssd_populate_namespace(struct nvme_ctrlr *nvme_ctrlr,
struct nvme_ns *nvme_ns,
struct nvme_async_probe_ctx *ctx);
void bdev_ocssd_depopulate_namespace(struct nvme_ns *nvme_ns);
void bdev_ocssd_namespace_config_json(struct spdk_json_write_ctx *w, struct nvme_ns *nvme_ns);
int bdev_ocssd_create_io_channel(struct nvme_ctrlr_channel *ioch);
void bdev_ocssd_destroy_io_channel(struct nvme_ctrlr_channel *ioch);
int bdev_ocssd_init_ctrlr(struct nvme_ctrlr *nvme_ctrlr);
void bdev_ocssd_fini_ctrlr(struct nvme_ctrlr *nvme_ctrlr);
void bdev_ocssd_handle_chunk_notification(struct nvme_ctrlr *nvme_ctrlr);
#endif /* SPDK_BDEV_OCSSD_H */

View File

@ -1,177 +0,0 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "spdk/stdinc.h"
#include "spdk/rpc.h"
#include "spdk/string.h"
#include "spdk/util.h"
#include "spdk/log.h"
#include "spdk/likely.h"
#include "bdev_ocssd.h"
#define BDEV_OCSSD_DEFAULT_NSID 1
struct rpc_create_ocssd_bdev {
char *ctrlr_name;
char *bdev_name;
uint32_t nsid;
};
static const struct spdk_json_object_decoder rpc_create_ocssd_bdev_decoders[] = {
{"ctrlr_name", offsetof(struct rpc_create_ocssd_bdev, ctrlr_name), spdk_json_decode_string},
{"bdev_name", offsetof(struct rpc_create_ocssd_bdev, bdev_name), spdk_json_decode_string},
{"nsid", offsetof(struct rpc_create_ocssd_bdev, nsid), spdk_json_decode_uint32, true},
};
static void
free_rpc_create_ocssd_bdev(struct rpc_create_ocssd_bdev *rpc)
{
free(rpc->ctrlr_name);
free(rpc->bdev_name);
}
struct rpc_bdev_ocssd_create_ctx {
struct spdk_jsonrpc_request *request;
struct rpc_create_ocssd_bdev rpc;
};
static void
rpc_bdev_ocssd_create_done(const char *bdev_name, int status, void *_ctx)
{
struct rpc_bdev_ocssd_create_ctx *ctx = _ctx;
struct spdk_json_write_ctx *w;
if (status != 0) {
spdk_jsonrpc_send_error_response(ctx->request, status, spdk_strerror(-status));
goto out;
}
w = spdk_jsonrpc_begin_result(ctx->request);
spdk_json_write_string(w, bdev_name);
spdk_jsonrpc_end_result(ctx->request, w);
out:
free_rpc_create_ocssd_bdev(&ctx->rpc);
free(ctx);
}
static void
rpc_bdev_ocssd_create(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params)
{
struct rpc_bdev_ocssd_create_ctx *ctx;
ctx = calloc(1, sizeof(*ctx));
if (!ctx) {
spdk_jsonrpc_send_error_response(request, -ENOMEM, spdk_strerror(ENOMEM));
return;
}
ctx->rpc.nsid = BDEV_OCSSD_DEFAULT_NSID;
ctx->request = request;
if (spdk_json_decode_object(params, rpc_create_ocssd_bdev_decoders,
SPDK_COUNTOF(rpc_create_ocssd_bdev_decoders),
&ctx->rpc)) {
spdk_jsonrpc_send_error_response(request, -EINVAL, "Failed to parse the request");
goto out;
}
bdev_ocssd_create_bdev(ctx->rpc.ctrlr_name, ctx->rpc.bdev_name, ctx->rpc.nsid,
rpc_bdev_ocssd_create_done, ctx);
return;
out:
free_rpc_create_ocssd_bdev(&ctx->rpc);
free(ctx);
}
SPDK_RPC_REGISTER("bdev_ocssd_create", rpc_bdev_ocssd_create, SPDK_RPC_RUNTIME)
struct rpc_delete_ocssd_bdev {
char *name;
};
static const struct spdk_json_object_decoder rpc_delete_ocssd_bdev_decoders[] = {
{"name", offsetof(struct rpc_delete_ocssd_bdev, name), spdk_json_decode_string},
};
static void
free_rpc_delete_ocssd_bdev(struct rpc_delete_ocssd_bdev *rpc)
{
free(rpc->name);
}
struct rpc_bdev_ocssd_delete_ctx {
struct spdk_jsonrpc_request *request;
struct rpc_delete_ocssd_bdev rpc;
};
static void
rpc_bdev_ocssd_delete_done(int status, void *_ctx)
{
struct rpc_bdev_ocssd_delete_ctx *ctx = _ctx;
if (status != 0) {
spdk_jsonrpc_send_error_response(ctx->request, status, spdk_strerror(-status));
goto out;
}
spdk_jsonrpc_send_bool_response(ctx->request, true);
out:
free_rpc_delete_ocssd_bdev(&ctx->rpc);
free(ctx);
}
static void
rpc_bdev_ocssd_delete(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params)
{
struct rpc_bdev_ocssd_delete_ctx *ctx;
ctx = calloc(1, sizeof(*ctx));
if (!ctx) {
spdk_jsonrpc_send_error_response(request, -ENOMEM, spdk_strerror(ENOMEM));
return;
}
ctx->request = request;
if (spdk_json_decode_object(params, rpc_delete_ocssd_bdev_decoders,
SPDK_COUNTOF(rpc_delete_ocssd_bdev_decoders),
&ctx->rpc)) {
spdk_jsonrpc_send_error_response(request, -EINVAL, "Failed to parse the request");
free_rpc_delete_ocssd_bdev(&ctx->rpc);
free(ctx);
return;
}
bdev_ocssd_delete_bdev(ctx->rpc.name, rpc_bdev_ocssd_delete_done, ctx);
}
SPDK_RPC_REGISTER("bdev_ocssd_delete", rpc_bdev_ocssd_delete, SPDK_RPC_RUNTIME)

View File

@ -32,7 +32,6 @@
*/
#include "spdk/env.h"
#include "bdev_ocssd.h"
#include "common.h"
struct nvme_ctrlrs g_nvme_ctrlrs = TAILQ_HEAD_INITIALIZER(g_nvme_ctrlrs);
@ -130,10 +129,6 @@ nvme_ctrlr_delete(struct nvme_ctrlr *nvme_ctrlr)
nvme_ctrlr->opal_dev = NULL;
}
if (nvme_ctrlr->ocssd_ctrlr) {
bdev_ocssd_fini_ctrlr(nvme_ctrlr);
}
pthread_mutex_lock(&g_bdev_nvme_mutex);
TAILQ_REMOVE(&g_nvme_ctrlrs, nvme_ctrlr, tailq);
pthread_mutex_unlock(&g_bdev_nvme_mutex);

View File

@ -84,13 +84,11 @@ struct nvme_ns {
struct spdk_nvme_ns *ns;
struct nvme_ctrlr *ctrlr;
struct nvme_bdev *bdev;
void *type_ctx;
uint32_t ana_group_id;
enum spdk_nvme_ana_state ana_state;
};
struct nvme_bdev_io;
struct ocssd_bdev_ctrlr;
struct nvme_ctrlr_trid {
struct spdk_nvme_transport_id trid;
@ -129,8 +127,6 @@ struct nvme_ctrlr {
struct spdk_poller *adminq_timer_poller;
struct spdk_thread *thread;
struct ocssd_bdev_ctrlr *ocssd_ctrlr;
bdev_nvme_reset_cb reset_cb_fn;
void *reset_cb_arg;
struct spdk_nvme_ctrlr_reset_ctx *reset_ctx;
@ -166,14 +162,11 @@ struct nvme_poll_group {
uint64_t end_ticks;
};
struct ocssd_io_channel;
struct nvme_ctrlr_channel {
struct nvme_ctrlr *ctrlr;
struct spdk_nvme_qpair *qpair;
struct nvme_poll_group *group;
TAILQ_HEAD(, spdk_bdev_io) pending_resets;
struct ocssd_io_channel *ocssd_ch;
};
struct nvme_bdev_channel {

View File

@ -2362,30 +2362,6 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
help='How often the hotplug is processed for insert and remove events', type=int)
p.set_defaults(func=bdev_virtio_blk_set_hotplug)
# OCSSD
def bdev_ocssd_create(args):
nsid = int(args.nsid) if args.nsid is not None else None
print_json(rpc.bdev.bdev_ocssd_create(args.client,
ctrlr_name=args.ctrlr_name,
bdev_name=args.name,
nsid=nsid))
p = subparsers.add_parser('bdev_ocssd_create',
help='Creates zoned bdev on specified Open Channel controller')
p.add_argument('-c', '--ctrlr_name', help='Name of the OC NVMe controller', required=True)
p.add_argument('-b', '--name', help='Name of the bdev to create', required=True)
p.add_argument('-n', '--nsid', help='Namespace ID', required=False)
p.set_defaults(func=bdev_ocssd_create)
def bdev_ocssd_delete(args):
print_json(rpc.bdev.bdev_ocssd_delete(args.client,
name=args.name))
p = subparsers.add_parser('bdev_ocssd_delete',
help='Deletes Open Channel bdev')
p.add_argument('name', help='Name of the Open Channel bdev')
p.set_defaults(func=bdev_ocssd_delete)
# ioat
def ioat_scan_accel_engine(args):
rpc.ioat.ioat_scan_accel_engine(args.client)

View File

@ -1115,34 +1115,6 @@ def bdev_ftl_delete(client, name):
return client.call('bdev_ftl_delete', params)
def bdev_ocssd_create(client, ctrlr_name, bdev_name, nsid=None, range=None):
"""Creates Open Channel zoned bdev on specified Open Channel controller
Args:
ctrlr_name: name of the OC NVMe controller
bdev_name: name of the bdev to create
nsid: namespace ID
"""
params = {'ctrlr_name': ctrlr_name,
'bdev_name': bdev_name}
if nsid is not None:
params['nsid'] = nsid
return client.call('bdev_ocssd_create', params)
def bdev_ocssd_delete(client, name):
"""Deletes Open Channel bdev
Args:
name: name of the bdev
"""
params = {'name': name}
return client.call('bdev_ocssd_delete', params)
@deprecated_alias('get_bdevs')
def bdev_get_bdevs(client, name=None):
"""Get information about block devices.

View File

@ -5,6 +5,11 @@ ftl_dirty_shutdown
ftl_fio_basic
ftl_fio_extended
ftl_restore_nv_cache
ftl_bdevperf
ftl_bdevperf_append
ftl_json
ftl_fio
ftl_restore
# Waiting for test refactor
iscsi_tgt_fio_remote_nvme

View File

@ -5,6 +5,9 @@ rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $testdir/common.sh
# The FTL tests are currently disabled, pending conversion to ZNS from OCSSD.
exit 0
function at_ftl_exit() {
# restore original driver
PCI_ALLOWED="$device" PCI_BLOCKED="" DRIVER_OVERRIDE="$ocssd_original_dirver" $rootdir/scripts/setup.sh

View File

@ -175,11 +175,6 @@ min_disk_size=$((1024 ** 3 * 2)) # 2GB
for block in "/sys/block/nvme"*; do
pci=$(readlink -f "$block/device/device")
pci=${pci##*/}
# Skip OCSSD drives if somehow some are still bound to the
# nvme driver.
for ocssd in $OCSSD_PCI_DEVICES; do
[[ $pci == "$ocssd" ]] && continue 2
done
# Skip devices that are in use - simple blkid it to see if
# there's any metadata (pt, fs, etc.) present on the drive.
# If the drive's size is less than 2G, skip it as we need

View File

@ -34,7 +34,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y = bdev_nvme.c bdev_ocssd.c
DIRS-y = bdev_nvme.c
.PHONY: all clean $(DIRS-y)

View File

@ -207,24 +207,6 @@ DEFINE_STUB(spdk_opal_dev_construct, struct spdk_opal_dev *, (struct spdk_nvme_c
DEFINE_STUB_V(spdk_opal_dev_destruct, (struct spdk_opal_dev *dev));
DEFINE_STUB_V(bdev_ocssd_populate_namespace, (struct nvme_ctrlr *nvme_ctrlr,
struct nvme_ns *nvme_ns, struct nvme_async_probe_ctx *ctx));
DEFINE_STUB_V(bdev_ocssd_depopulate_namespace, (struct nvme_ns *nvme_ns));
DEFINE_STUB_V(bdev_ocssd_namespace_config_json, (struct spdk_json_write_ctx *w,
struct nvme_ns *nvme_ns));
DEFINE_STUB(bdev_ocssd_create_io_channel, int, (struct nvme_ctrlr_channel *ioch), 0);
DEFINE_STUB_V(bdev_ocssd_destroy_io_channel, (struct nvme_ctrlr_channel *ioch));
DEFINE_STUB(bdev_ocssd_init_ctrlr, int, (struct nvme_ctrlr *nvme_ctrlr), 0);
DEFINE_STUB_V(bdev_ocssd_fini_ctrlr, (struct nvme_ctrlr *nvme_ctrlr));
DEFINE_STUB_V(bdev_ocssd_handle_chunk_notification, (struct nvme_ctrlr *nvme_ctrlr));
DEFINE_STUB(spdk_accel_submit_crc32cv, int, (struct spdk_io_channel *ch, uint32_t *dst,
struct iovec *iov,
uint32_t iov_cnt, uint32_t seed, spdk_accel_completion_cb cb_fn, void *cb_arg), 0);

View File

@ -1,38 +0,0 @@
#
# BSD LICENSE
#
# Copyright (c) Intel Corporation.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../../..)
TEST_FILE = bdev_ocssd_ut.c
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,6 @@ cd "$rootdir"
function unittest_bdev() {
$valgrind $testdir/lib/bdev/bdev.c/bdev_ut
$valgrind $testdir/lib/bdev/nvme/bdev_ocssd.c/bdev_ocssd_ut
$valgrind $testdir/lib/bdev/nvme/bdev_nvme.c/bdev_nvme_ut
$valgrind $testdir/lib/bdev/raid/bdev_raid.c/bdev_raid_ut
$valgrind $testdir/lib/bdev/bdev_zone.c/bdev_zone_ut