#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
#include <errno.h>
#include <stdint.h>
#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/queue.h>
#include <rte_string_fns.h>
-#include <rte_byteorder.h>
#include <rte_log.h>
-#include <rte_debug.h>
#include <rte_dev.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
#include <rte_common.h>
#include <rte_malloc.h>
#include <rte_errno.h>
if (caps == NULL)
return -EINVAL;
- *caps = 0;
+
+ if (dev->dev_ops->crypto_adapter_caps_get == NULL)
+ *caps = RTE_EVENT_CRYPTO_ADAPTER_SW_CAP;
+ else
+ *caps = 0;
return dev->dev_ops->crypto_adapter_caps_get ?
(*dev->dev_ops->crypto_adapter_caps_get)
- (dev, cdev, caps) : -ENOTSUP;
+ (dev, cdev, caps) : 0;
}
int
return 0;
}
+void
+rte_event_port_quiesce(uint8_t dev_id, uint8_t port_id,
+ rte_eventdev_port_flush_t release_cb, void *args)
+{
+ struct rte_eventdev *dev;
+
+ RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id);
+ dev = &rte_eventdevs[dev_id];
+
+ if (!is_valid_port(dev, port_id)) {
+ RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id);
+ return;
+ }
+
+ if (dev->dev_ops->port_quiesce)
+ (*dev->dev_ops->port_quiesce)(dev, dev->data->ports[port_id],
+ release_cb, args);
+}
+
int
rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
uint32_t *attr_value)
*attr_value = conf->schedule_type;
break;
+ case RTE_EVENT_QUEUE_ATTR_WEIGHT:
+ *attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST;
+ if (dev->dev_ops->queue_attr_get)
+ return (*dev->dev_ops->queue_attr_get)(
+ dev, queue_id, attr_id, attr_value);
+ break;
+ case RTE_EVENT_QUEUE_ATTR_AFFINITY:
+ *attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST;
+ if (dev->dev_ops->queue_attr_get)
+ return (*dev->dev_ops->queue_attr_get)(
+ dev, queue_id, attr_id, attr_value);
+ break;
default:
return -EINVAL;
};
return 0;
}
+int
+rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
+ uint64_t attr_value)
+{
+ struct rte_eventdev *dev;
+
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ dev = &rte_eventdevs[dev_id];
+ if (!is_valid_queue(dev, queue_id)) {
+ RTE_EDEV_LOG_ERR("Invalid queue_id=%" PRIu8, queue_id);
+ return -EINVAL;
+ }
+
+ if (!(dev->data->event_dev_cap &
+ RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR)) {
+ RTE_EDEV_LOG_ERR(
+ "Device %" PRIu8 "does not support changing queue attributes at runtime",
+ dev_id);
+ return -ENOTSUP;
+ }
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_attr_set, -ENOTSUP);
+ return (*dev->dev_ops->queue_attr_set)(dev, queue_id, attr_id,
+ attr_value);
+}
+
int
rte_event_port_link(uint8_t dev_id, uint8_t port_id,
const uint8_t queues[], const uint8_t priorities[],