drivers/net: add generic ethdev macro to get PCI device
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index f8c8c13..d118c05 100644 (file)
@@ -1048,6 +1048,8 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
        } \
 } while (0)
 
+#define RTE_ETH_DEV_TO_PCI(eth_dev)    RTE_DEV_TO_PCI((eth_dev)->device)
+
 /**
  * l2 tunnel configuration.
  */
@@ -1282,7 +1284,7 @@ typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
 /**< @internal Remove MAC address from receive address register */
 
-typedef void (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
                                  struct ether_addr *mac_addr,
                                  uint32_t index,
                                  uint32_t vmdq);
@@ -3266,7 +3268,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id,
  *     causing N packets to be sent, and the error callback to be called for
  *     the rest.
  */
-static inline uint16_t __attribute__((always_inline))
+static __rte_always_inline uint16_t
 rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id,
                struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
 {
@@ -4587,7 +4589,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id,
 * @param port_id
 *   pointer to port identifier of the device
 * @return
-*   - (0) if successful.
+*   - (0) if successful and port_id is filled.
 *   - (-ENODEV or -EINVAL) on failure.
 */
 int