compress: Add RPC option to enable mlx5_pci PMD

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I31efa2f9dd1aafdb87904083e56d693a699af526
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8781
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Alexey Marchuk 2021-06-18 12:23:14 +03:00 committed by Tomasz Zawadzki
parent e269bf4e84
commit 6479ddb358
4 changed files with 19 additions and 2 deletions

View File

@ -82,7 +82,12 @@ for detailed information.
The vbdev module relies on the DPDK CompressDev Framework to provide all compression
functionality. The framework provides support for many different software only
compression modules as well as hardware assisted support for Intel QAT. At this
time the vbdev module supports the DPDK drivers for ISAL and QAT.
time the vbdev module supports the DPDK drivers for ISAL, QAT and mlx5_pci.
mlx5_pci driver works with BlueField 2 SmartNIC and requires additional configuration of DPDK
environment to enable compression function. It can be done via SPDK event library by configuring
`env_context` member of `spdk_app_opts` structure or by passing corresponding CLI arguments in the
following form: `--allow=BDF,class=compress`, e.g. `--allow=0000:01:00.0,class=compress`.
Persistent memory is used to store metadata associated with the layout of the data on the
backing device. SPDK relies on [PMDK](http://pmem.io/pmdk/) to interface persistent memory so any hardware

View File

@ -1979,7 +1979,7 @@ Example response:
## bdev_compress_set_pmd {#rpc_bdev_compress_set_pmd}
Select the DPDK polled mode driver (pmd) for a compressed bdev,
0 = auto-select, 1= QAT only, 2 = ISAL only.
0 = auto-select, 1= QAT only, 2 = ISAL only, 3 = mlx5_pci only.
### Parameters

View File

@ -3,6 +3,7 @@
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -73,6 +74,7 @@ static int g_mbuf_offset;
#define ISAL_PMD "compress_isal"
#define QAT_PMD "compress_qat"
#define MLX5_PMD "mlx5_pci"
#define NUM_MBUFS 8192
#define POOL_CACHE_SIZE 256
@ -170,6 +172,7 @@ static struct rte_mempool *g_comp_op_mp = NULL; /* comp operations, must be rt
static struct rte_mbuf_ext_shared_info g_shinfo = {}; /* used by DPDK mbuf macros */
static bool g_qat_available = false;
static bool g_isal_available = false;
static bool g_mlx5_pci_available = false;
/* Create shared (between all ops per PMD) compress xforms. */
static struct rte_comp_xform g_comp_xform = {
@ -325,6 +328,9 @@ create_compress_dev(uint8_t index)
if (strcmp(device->cdev_info.driver_name, ISAL_PMD) == 0) {
g_isal_available = true;
}
if (strcmp(device->cdev_info.driver_name, MLX5_PMD) == 0) {
g_mlx5_pci_available = true;
}
return 0;
@ -1359,6 +1365,8 @@ _set_pmd(struct vbdev_compress *comp_dev)
if (g_opts == COMPRESS_PMD_AUTO) {
if (g_qat_available) {
comp_dev->drv_name = QAT_PMD;
} else if (g_mlx5_pci_available) {
comp_dev->drv_name = MLX5_PMD;
} else {
comp_dev->drv_name = ISAL_PMD;
}
@ -1366,6 +1374,8 @@ _set_pmd(struct vbdev_compress *comp_dev)
comp_dev->drv_name = QAT_PMD;
} else if (g_opts == COMPRESS_PMD_ISAL_ONLY && g_isal_available) {
comp_dev->drv_name = ISAL_PMD;
} else if (g_opts == COMPRESS_PMD_MLX5_PCI_ONLY && g_mlx5_pci_available) {
comp_dev->drv_name = MLX5_PMD;
} else {
SPDK_ERRLOG("Requested PMD is not available.\n");
return false;

View File

@ -3,6 +3,7 @@
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -76,6 +77,7 @@ enum compress_pmd {
COMPRESS_PMD_AUTO = 0,
COMPRESS_PMD_QAT_ONLY,
COMPRESS_PMD_ISAL_ONLY,
COMPRESS_PMD_MLX5_PCI_ONLY,
COMPRESS_PMD_MAX
};