MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_compressdev_configure

Function rte_compressdev_configure

dpdk/lib/compressdev/rte_compressdev.c:416–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416int
417rte_compressdev_configure(uint8_t dev_id, struct rte_compressdev_config *config)
418{
419 struct rte_compressdev *dev;
420 int diag;
421
422 if (!rte_compressdev_is_valid_dev(dev_id)) {
423 COMPRESSDEV_LOG(ERR, "Invalid dev_id=%" PRIu8, dev_id);
424 return -EINVAL;
425 }
426
427 dev = &rte_comp_devices[dev_id];
428
429 if (dev->data->dev_started) {
430 COMPRESSDEV_LOG(ERR,
431 "device %d must be stopped to allow configuration", dev_id);
432 return -EBUSY;
433 }
434
435 if (*dev->dev_ops->dev_configure == NULL)
436 return -ENOTSUP;
437
438 /* Setup new number of queue pairs and reconfigure device. */
439 diag = rte_compressdev_queue_pairs_config(dev, config->nb_queue_pairs,
440 config->socket_id);
441 if (diag != 0) {
442 COMPRESSDEV_LOG(ERR,
443 "dev%d rte_comp_dev_queue_pairs_config = %d",
444 dev_id, diag);
445 return diag;
446 }
447
448 return (*dev->dev_ops->dev_configure)(dev, config);
449}
450
451int
452rte_compressdev_start(uint8_t dev_id)

Tested by 2

generic_ut_setupFunction · 0.68