bus/fslmc: cleanup the dpaa2 interrupt support
[dpdk.git] / lib / librte_eventdev / rte_eventdev.c
index a246965..bbb3805 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   BSD LICENSE
  *
- *   Copyright(c) 2016 Cavium networks. All rights reserved.
+ *   Copyright(c) 2016 Cavium, Inc. All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -13,7 +13,7 @@
  *       notice, this list of conditions and the following disclaimer in
  *       the documentation and/or other materials provided with the
  *       distribution.
- *     * Neither the name of Cavium networks nor the names of its
+ *     * Neither the name of Cavium, Inc nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
  *
@@ -298,7 +298,7 @@ rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports)
                        sizeof(dev->data->links_map[0]) * nb_ports *
                        RTE_EVENT_MAX_QUEUES_PER_DEV,
                        RTE_CACHE_LINE_SIZE);
-               if (dev->data->links_map == NULL) {
+               if (links_map == NULL) {
                        dev->data->nb_ports = 0;
                        RTE_EDEV_LOG_ERR("failed to realloc mem for port_map,"
                                        "nb_ports %u", nb_ports);
@@ -366,9 +366,10 @@ rte_event_dev_configure(uint8_t dev_id,
 
        /* Check dequeue_timeout_ns value is in limit */
        if (!(dev_conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)) {
-               if (dev_conf->dequeue_timeout_ns < info.min_dequeue_timeout_ns
+               if (dev_conf->dequeue_timeout_ns &&
+                   (dev_conf->dequeue_timeout_ns < info.min_dequeue_timeout_ns
                        || dev_conf->dequeue_timeout_ns >
-                                info.max_dequeue_timeout_ns) {
+                                info.max_dequeue_timeout_ns)) {
                        RTE_EDEV_LOG_ERR("dev%d invalid dequeue_timeout_ns=%d"
                        " min_dequeue_timeout_ns=%d max_dequeue_timeout_ns=%d",
                        dev_id, dev_conf->dequeue_timeout_ns,
@@ -426,8 +427,9 @@ rte_event_dev_configure(uint8_t dev_id,
                                        dev_id);
                return -EINVAL;
        }
-       if (dev_conf->nb_event_port_dequeue_depth >
-                        info.max_event_port_dequeue_depth) {
+       if ((info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE) &&
+                (dev_conf->nb_event_port_dequeue_depth >
+                        info.max_event_port_dequeue_depth)) {
                RTE_EDEV_LOG_ERR("dev%d nb_dq_depth=%d > max_dq_depth=%d",
                dev_id, dev_conf->nb_event_port_dequeue_depth,
                info.max_event_port_dequeue_depth);
@@ -440,8 +442,9 @@ rte_event_dev_configure(uint8_t dev_id,
                                        dev_id);
                return -EINVAL;
        }
-       if (dev_conf->nb_event_port_enqueue_depth >
-                        info.max_event_port_enqueue_depth) {
+       if ((info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE) &&
+               (dev_conf->nb_event_port_enqueue_depth >
+                        info.max_event_port_enqueue_depth)) {
                RTE_EDEV_LOG_ERR("dev%d nb_enq_depth=%d > max_enq_depth=%d",
                dev_id, dev_conf->nb_event_port_enqueue_depth,
                info.max_event_port_enqueue_depth);