Commit 20894340 authored by Marcin Dziegielewski's avatar Marcin Dziegielewski Committed by Jim Harris
Browse files

lib/bdev/ocf: update of ocf library to version 19.06



This path updates ocf library to version 19.06 and also introduces
all necessary changes required to integrate ocf bdev adapter with
new version of ocf.

Summary of changes introduces with new OCF in ocf bdev:
- ocf_env.h increased limit for memory operations, changed behaviour
of strncpy to less restrictive, both changes are required to run new OCF
- ctx.c changed functions to new from new OCF
- added new cache mode "write only"
- added missed cache modes wa and wi to RPC scripts
- rewritten spdk_rpc_bdev_ocf_get_stats function to use asynhronus
ocf_mngt_cache_read_lock
- used new asynhronus ocf_mngt_cache_flush instead of waiting for request
- removed no longer valid filed - cfg->device.min_free_ram
- changed expected result in metadata_probe_cb

Signed-off-by: default avatarMarcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: I83e4335e16600e4d22e6bb517931102de42d39e9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468132


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 43f695d9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -163,6 +163,16 @@ Added `blobfs_mount` RPC method to mount blobfs on given bdev to a host path by
Then on the host path, user can directly do some file operations which will be mapped
to blobfs.

### ocf

Updated OCF submodule to OCF v19.06

Along with update, new cache mode 'write only' was added.

New cache modes added to use via RPC, wi - write invalidate and wa - write around.

New version of OCF provides fully asynchronous management API.

## v19.07:

### ftl
+5 −3
Original line number Diff line number Diff line
@@ -660,8 +660,8 @@ static inline uint64_t env_secs_to_ticks(uint64_t j)

/* *** STRING OPERATIONS *** */

/* 256 KB is sufficient amount of memory for OCF operations */
#define ENV_MAX_MEM (256 * 1024)
/* 512 KB is sufficient amount of memory for OCF operations */
#define ENV_MAX_MEM (512 * 1024)

static inline int env_memset(void *dest, size_t len, uint8_t value)
{
@@ -722,9 +722,11 @@ static inline int env_strncpy(char *dest, size_t dmax, const char *src, size_t l
	if (dmax == 0 || dmax > ENV_MAX_STR) {
		return 1;
	}
	if (len == 0 || len > dmax) {
	if (len == 0) {
		return 1;
	}
	/* Just copy as many characters as we can instead of return failure */
	len = min(len, dmax);

	strncpy(dest, src, len);
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ vbdev_ocf_ctx_init(void)
{
	int ret;

	ret = ocf_ctx_init(&vbdev_ocf_ctx, &vbdev_ocf_ctx_cfg);
	ret = ocf_ctx_create(&vbdev_ocf_ctx, &vbdev_ocf_ctx_cfg);
	if (ret < 0) {
		return ret;
	}
@@ -543,7 +543,7 @@ vbdev_ocf_ctx_init(void)
void
vbdev_ocf_ctx_cleanup(void)
{
	ocf_ctx_exit(vbdev_ocf_ctx);
	ocf_ctx_put(vbdev_ocf_ctx);
	vbdev_ocf_ctx = NULL;
}

+1 −17
Original line number Diff line number Diff line
@@ -40,28 +40,12 @@ vbdev_ocf_stats_get(ocf_cache_t cache, ocf_core_id_t core_id, struct vbdev_ocf_s
	int status;
	ocf_core_t core;

	if (cache == NULL) {
		assert(false);
		return -EFAULT;
	}

	status = ocf_mngt_cache_read_lock(cache);
	if (status) {
		return status;
	}

	status = ocf_core_get(cache, core_id, &core);
	if (status) {
		return status;
	}

	status = ocf_stats_collect_core(core, &stats->usage, &stats->reqs, &stats->blocks, &stats->errors);
	ocf_mngt_cache_read_unlock(cache);
	if (status) {
		return status;
	}

	return 0;
	return ocf_stats_collect_core(core, &stats->usage, &stats->reqs, &stats->blocks, &stats->errors);
}

#define WJSON_STAT(w, stats, group, field, units) \
+2 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@ static char *cache_modes[ocf_cache_mode_max] = {
	[ocf_cache_mode_wb] = "wb",
	[ocf_cache_mode_wa] = "wa",
	[ocf_cache_mode_pt] = "pt",
	[ocf_cache_mode_wi] = "wi"
	[ocf_cache_mode_wi] = "wi",
	[ocf_cache_mode_wo] = "wo",
};

ocf_cache_mode_t
Loading