ethdev: fix errno to have positive value
[dpdk.git] / lib / librte_ethdev / rte_ethdev.h
index 925ef38..a3c864a 100644 (file)
@@ -167,9 +167,6 @@ extern int rte_eth_dev_logtype;
 struct rte_mbuf;
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Initializes a device iterator.
  *
  * This iterator allows accessing a list of devices matching some devargs.
@@ -185,13 +182,9 @@ struct rte_mbuf;
  * @return
  *   0 on successful initialization, negative otherwise.
  */
-__rte_experimental
 int rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Iterates on devices with devargs filter.
  * The ownership is not checked.
  *
@@ -205,13 +198,9 @@ int rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs);
  * @return
  *   A port id if found, RTE_MAX_ETHPORTS otherwise.
  */
-__rte_experimental
 uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Free some allocated fields of the iterator.
  *
  * This function is automatically called by rte_eth_iterator_next()
@@ -223,7 +212,6 @@ uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter);
  *   Device iterator handle initialized by rte_eth_iterator_init().
  *   The fields bus_str and cls_str are freed if needed.
  */
-__rte_experimental
 void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter);
 
 /**
@@ -1318,8 +1306,6 @@ enum rte_eth_dev_state {
        RTE_ETH_DEV_UNUSED = 0,
        /** Device is attached when allocated in probing. */
        RTE_ETH_DEV_ATTACHED,
-       /** The deferred state is useless and replaced by ownership. */
-       RTE_ETH_DEV_DEFERRED,
        /** Device is in removed state when plug-out is detected. */
        RTE_ETH_DEV_REMOVED,
 };
@@ -1509,37 +1495,6 @@ uint16_t rte_eth_dev_count_avail(void);
  */
 uint16_t __rte_experimental rte_eth_dev_count_total(void);
 
-/**
- * Attach a new Ethernet device specified by arguments.
- *
- * @param devargs
- *  A pointer to a strings array describing the new device
- *  to be attached. The strings should be a pci address like
- *  '0000:01:00.0' or virtual device name like 'net_pcap0'.
- * @param port_id
- *  A pointer to a port identifier actually attached.
- * @return
- *  0 on success and port_id is filled, negative on error
- */
-__rte_deprecated
-int rte_eth_dev_attach(const char *devargs, uint16_t *port_id);
-
-/**
- * Detach a Ethernet device specified by port identifier.
- * This function must be called when the device is in the
- * closed state.
- *
- * @param port_id
- *   The port identifier of the device to detach.
- * @param devname
- *   A pointer to a buffer that will be filled with the device name.
- *   This buffer must be at least RTE_DEV_NAME_MAX_LEN long.
- * @return
- *  0 on success and devname is filled, negative on error
- */
-__rte_deprecated
-int rte_eth_dev_detach(uint16_t port_id, char *devname);
-
 /**
  * Convert a numerical speed in Mbps to a bitmap flag that can be used in
  * the bitmap link_speeds of the struct rte_eth_conf
@@ -1554,9 +1509,6 @@ int rte_eth_dev_detach(uint16_t port_id, char *devname);
 uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Get DEV_RX_OFFLOAD_* flag name.
  *
  * @param offload
@@ -1564,12 +1516,9 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
  * @return
  *   Offload name or 'UNKNOWN' if the flag cannot be recognised.
  */
-const char * __rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload);
+const char *rte_eth_dev_rx_offload_name(uint64_t offload);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Get DEV_TX_OFFLOAD_* flag name.
  *
  * @param offload
@@ -1577,7 +1526,7 @@ const char * __rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload);
  * @return
  *   Offload name or 'UNKNOWN' if the flag cannot be recognised.
  */
-const char * __rte_experimental rte_eth_dev_tx_offload_name(uint64_t offload);
+const char *rte_eth_dev_tx_offload_name(uint64_t offload);
 
 /**
  * Configure an Ethernet device.
@@ -4210,9 +4159,6 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 }
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
  * Process a burst of output packets on a transmit queue of an Ethernet device.
  *
  * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
@@ -4276,7 +4222,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
        if (!rte_eth_dev_is_valid_port(port_id)) {
                RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
-               rte_errno = -EINVAL;
+               rte_errno = EINVAL;
                return 0;
        }
 #endif
@@ -4286,7 +4232,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
        if (queue_id >= dev->data->nb_tx_queues) {
                RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
-               rte_errno = -EINVAL;
+               rte_errno = EINVAL;
                return 0;
        }
 #endif