bdev/compress: check PMD shareable flag for transforms
Module only supports shareable transforms, also adjusted the number to what we need, just 2. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Ieb77b5f1221878ac7a4be5176ed459d5165f8430 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458698 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
38c2a6f8fd
commit
5cffa4a988
@ -51,8 +51,7 @@
|
|||||||
#include <rte_compressdev.h>
|
#include <rte_compressdev.h>
|
||||||
#include <rte_comp.h>
|
#include <rte_comp.h>
|
||||||
|
|
||||||
/* TODO: valdiate these are good starting values */
|
#define NUM_MAX_XFORMS 2
|
||||||
#define NUM_MAX_XFORMS 16
|
|
||||||
#define NUM_MAX_INFLIGHT_OPS 128
|
#define NUM_MAX_INFLIGHT_OPS 128
|
||||||
#define DEFAULT_WINDOW_SIZE 15
|
#define DEFAULT_WINDOW_SIZE 15
|
||||||
#define MAX_MBUFS_PER_OP 16
|
#define MAX_MBUFS_PER_OP 16
|
||||||
@ -256,19 +255,24 @@ create_compress_dev(uint8_t index, uint16_t num_lcores)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = rte_compressdev_private_xform_create(cdev_id, &g_comp_xform,
|
if (device->cdev_info.capabilities->comp_feature_flags & RTE_COMP_FF_SHAREABLE_PRIV_XFORM) {
|
||||||
&device->comp_xform);
|
rc = rte_compressdev_private_xform_create(cdev_id, &g_comp_xform,
|
||||||
if (rc < 0) {
|
&device->comp_xform);
|
||||||
SPDK_ERRLOG("Failed to create private comp xform device %u: error %d\n",
|
if (rc < 0) {
|
||||||
cdev_id, rc);
|
SPDK_ERRLOG("Failed to create private comp xform device %u: error %d\n",
|
||||||
goto err;
|
cdev_id, rc);
|
||||||
}
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
rc = rte_compressdev_private_xform_create(cdev_id, &g_decomp_xform,
|
rc = rte_compressdev_private_xform_create(cdev_id, &g_decomp_xform,
|
||||||
&device->decomp_xform);
|
&device->decomp_xform);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
SPDK_ERRLOG("Failed to create private decomp xform device %u: error %d\n",
|
SPDK_ERRLOG("Failed to create private decomp xform device %u: error %d\n",
|
||||||
cdev_id, rc);
|
cdev_id, rc);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SPDK_ERRLOG("PMD does not support shared transforms\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user