Lines Matching refs:device
51 struct rte_compressdev_info cdev_info; /* includes device friendly name */
52 uint8_t cdev_id; /* identifier for the device */
62 /* Global list and lock for unique device/queue pair combos */
64 struct compress_dev *device; /* ptr to compression device */
73 char *drv_name; /* name of the compression device driver */
121 /* Called by accel_init_compress_drivers() to init each discovered compression device */
125 struct compress_dev *device;
132 device = calloc(1, sizeof(struct compress_dev));
133 if (!device) {
137 /* Get details about this device. */
138 rte_compressdev_info_get(index, &device->cdev_info);
140 cdev_id = device->cdev_id = index;
143 if (device->cdev_info.max_nb_queue_pairs == 0) {
146 q_pairs = spdk_min(device->cdev_info.max_nb_queue_pairs, MAX_NUM_QP);
149 /* Configure the compression device. */
188 SPDK_ERRLOG("Failed to start device %u: error %d\n",
193 if (device->cdev_info.capabilities->comp_feature_flags & RTE_COMP_FF_SHAREABLE_PRIV_XFORM) {
195 &device->comp_xform);
197 SPDK_ERRLOG("Failed to create private comp xform device %u: error %d\n",
203 &device->decomp_xform);
205 SPDK_ERRLOG("Failed to create private decomp xform device %u: error %d\n",
214 /* Build up list of device/qp combinations */
221 dev_qp->device = device;
227 TAILQ_INSERT_TAIL(&g_compress_devs, device, link);
229 if (strcmp(device->cdev_info.driver_name, QAT_PMD) == 0) {
233 if (strcmp(device->cdev_info.driver_name, MLX5_PMD) == 0) {
237 if (strcmp(device->cdev_info.driver_name, UADK_PMD) == 0) {
252 free(device);
262 struct compress_dev *device;
271 SPDK_ERRLOG("invalid device count from rte_compressdev_count()\n");
315 TAILQ_FOREACH_SAFE(device, &g_compress_devs, link, tmp_dev) {
316 TAILQ_REMOVE(&g_compress_devs, device, link);
317 free(device);
448 assert(chan->device_qp->device != NULL);
449 cdev_id = chan->device_qp->device->cdev_id;
489 if (!chan->device_qp->device->sgl_in && src_mbuf_total > 1) {
505 if (!chan->device_qp->device->sgl_out && dst_mbuf_total > 1) {
516 comp_op->private_xform = chan->device_qp->device->comp_xform;
518 comp_op->private_xform = chan->device_qp->device->decomp_xform;
546 /* There was an error sending the op to the device, most
571 assert(chan->device_qp->device != NULL);
572 cdev_id = chan->device_qp->device->cdev_id;
777 if (strcmp(device_qp->device->cdev_info.driver_name, chan->drv_name) == 0) {
795 chan->device_qp->device->sgl_in = true;
799 chan->device_qp->device->sgl_out = true;
914 /* Callback for unregistering the IO device. */
919 struct compress_dev *device;
921 while ((device = TAILQ_FIRST(&g_compress_devs))) {
922 TAILQ_REMOVE(&g_compress_devs, device, link);
923 rte_compressdev_stop(device->cdev_id);
924 rte_compressdev_close(device->cdev_id);
925 free(device);