New upstream version 16.11.8
[deb_dpdk.git] / lib / librte_ether / rte_ethdev.h
index dc6d0cc..981e057 100644 (file)
@@ -1742,7 +1742,6 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
  * to that slot for the driver to use.
  *
  * @param      name    Unique identifier name for each Ethernet device
- * @param      type    Device type of this Ethernet device
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
@@ -2325,7 +2324,7 @@ void rte_eth_xstats_reset(uint8_t port_id);
  * @param stat_idx
  *   The per-queue packet statistics functionality number that the transmit
  *   queue is to be assigned.
- *   The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1].
+ *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
@@ -2345,7 +2344,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
  * @param stat_idx
  *   The per-queue packet statistics functionality number that the receive
  *   queue is to be assigned.
- *   The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1].
+ *   The value must be in the range [0, RTE_ETHDEV_QUEUE_STAT_CNTRS - 1].
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
@@ -2646,6 +2645,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,
                 struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
 {
        struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+       uint16_t nb_rx;
 
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
@@ -2656,13 +2656,14 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,
                return 0;
        }
 #endif
-       int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+       nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
                        rx_pkts, nb_pkts);
 
 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
-       struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+       if (unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) {
+               struct rte_eth_rxtx_callback *cb =
+                               dev->post_rx_burst_cbs[queue_id];
 
-       if (unlikely(cb != NULL)) {
                do {
                        nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
                                                nb_pkts, cb->param);
@@ -2692,7 +2693,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)
        struct rte_eth_dev *dev = &rte_eth_devices[port_id];
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
        RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
-        return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+        return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
 }
 
 /**
@@ -2886,8 +2887,9 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id,
 
        /* All packets sent, or to be dealt with by callback below */
        if (unlikely(sent != to_send))
-               buffer->error_callback(&buffer->pkts[sent], to_send - sent,
-                               buffer->error_userdata);
+               buffer->error_callback(&buffer->pkts[sent],
+                                      (uint16_t)(to_send - sent),
+                                      buffer->error_userdata);
 
        return sent;
 }
@@ -4345,9 +4347,9 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
 * Get the device name from port id
 *
 * @param port_id
-*   pointer to port identifier of the device
+*   Port identifier of the device.
 * @param name
-*  pci address or name of the device
+*   Buffer of size RTE_ETH_NAME_MAX_LEN to store the name.
 * @return
 *   - (0) if successful.
 *   - (-EINVAL) on failure.