* @return
* - The total number of usable Ethernet devices.
*/
-extern uint8_t rte_eth_dev_count(void);
+uint8_t rte_eth_dev_count(void);
/**
* @internal
* @return
* - The pointer to the ethdev slot, on success. NULL on error
*/
-extern struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
/**
* @internal
* The pointer to the *eth_driver* structure associated with
* the Ethernet driver.
*/
-extern void rte_eth_driver_register(struct eth_driver *eth_drv);
+void rte_eth_driver_register(struct eth_driver *eth_drv);
/**
* Configure an Ethernet device.
* - 0: Success, device configured.
* - <0: Error code returned by the driver configuration function.
*/
-extern int rte_eth_dev_configure(uint8_t port_id,
- uint16_t nb_rx_queue,
- uint16_t nb_tx_queue,
- const struct rte_eth_conf *eth_conf);
+int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue,
+ uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
/**
* Allocate and set up a receive queue for an Ethernet device.
* allocate network memory buffers from the memory pool when
* initializing receive descriptors.
*/
-extern int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
- uint16_t nb_rx_desc, unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
+int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
+ uint16_t nb_rx_desc, unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
/**
* Allocate and set up a transmit queue for an Ethernet device.
* - 0: Success, the transmit queue is correctly set up.
* - -ENOMEM: Unable to allocate the transmit ring descriptors.
*/
-extern int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
- uint16_t nb_tx_desc, unsigned int socket_id,
- const struct rte_eth_txconf *tx_conf);
+int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
+ uint16_t nb_tx_desc, unsigned int socket_id,
+ const struct rte_eth_txconf *tx_conf);
/*
* Return the NUMA socket to which an Ethernet device is connected
* a default of zero if the socket could not be determined.
* -1 is returned is the port_id value is out of range.
*/
-extern int rte_eth_dev_socket_id(uint8_t port_id);
+int rte_eth_dev_socket_id(uint8_t port_id);
/*
* Check if port_id of device is attached
* - 0 if port is out of range or not attached
* - 1 if device is attached
*/
-extern int rte_eth_dev_is_valid_port(uint8_t port_id);
+int rte_eth_dev_is_valid_port(uint8_t port_id);
/*
* Allocate mbuf from mempool, setup the DMA physical address
* - -EINVAL: The port_id or the queue_id out of range.
* - -ENOTSUP: The function not supported in PMD driver.
*/
-extern int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
+int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
/*
* Stop specified RX queue of a port
* - -EINVAL: The port_id or the queue_id out of range.
* - -ENOTSUP: The function not supported in PMD driver.
*/
-extern int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
+int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
/*
* Start TX for specified queue of a port. It is used when tx_deferred_start
* - -EINVAL: The port_id or the queue_id out of range.
* - -ENOTSUP: The function not supported in PMD driver.
*/
-extern int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
+int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
/*
* Stop specified TX queue of a port
* - -EINVAL: The port_id or the queue_id out of range.
* - -ENOTSUP: The function not supported in PMD driver.
*/
-extern int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
+int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
* - 0: Success, Ethernet device started.
* - <0: Error code of the driver device start function.
*/
-extern int rte_eth_dev_start(uint8_t port_id);
+int rte_eth_dev_start(uint8_t port_id);
/**
* Stop an Ethernet device. The device can be restarted with a call to
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_dev_stop(uint8_t port_id);
+void rte_eth_dev_stop(uint8_t port_id);
/**
* - 0: Success, Ethernet device linked up.
* - <0: Error code of the driver device link up function.
*/
-extern int rte_eth_dev_set_link_up(uint8_t port_id);
+int rte_eth_dev_set_link_up(uint8_t port_id);
/**
* Link down an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern int rte_eth_dev_set_link_down(uint8_t port_id);
+int rte_eth_dev_set_link_down(uint8_t port_id);
/**
* Close a stopped Ethernet device. The device cannot be restarted!
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_dev_close(uint8_t port_id);
+void rte_eth_dev_close(uint8_t port_id);
/**
* Enable receipt in promiscuous mode for an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_promiscuous_enable(uint8_t port_id);
+void rte_eth_promiscuous_enable(uint8_t port_id);
/**
* Disable receipt in promiscuous mode for an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_promiscuous_disable(uint8_t port_id);
+void rte_eth_promiscuous_disable(uint8_t port_id);
/**
* Return the value of promiscuous mode for an Ethernet device.
* - (0) if promiscuous is disabled.
* - (-1) on error
*/
-extern int rte_eth_promiscuous_get(uint8_t port_id);
+int rte_eth_promiscuous_get(uint8_t port_id);
/**
* Enable the receipt of any multicast frame by an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_allmulticast_enable(uint8_t port_id);
+void rte_eth_allmulticast_enable(uint8_t port_id);
/**
* Disable the receipt of all multicast frames by an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_allmulticast_disable(uint8_t port_id);
+void rte_eth_allmulticast_disable(uint8_t port_id);
/**
* Return the value of allmulticast mode for an Ethernet device.
* - (0) if allmulticast is disabled.
* - (-1) on error
*/
-extern int rte_eth_allmulticast_get(uint8_t port_id);
+int rte_eth_allmulticast_get(uint8_t port_id);
/**
* Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
* A pointer to an *rte_eth_link* structure to be filled with
* the status, the speed and the mode of the Ethernet device link.
*/
-extern void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
+void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
/**
* Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
* A pointer to an *rte_eth_link* structure to be filled with
* the status, the speed and the mode of the Ethernet device link.
*/
-extern void rte_eth_link_get_nowait(uint8_t port_id,
- struct rte_eth_link *link);
+void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link);
/**
* Retrieve the general I/O statistics of an Ethernet device.
* @return
* Zero if successful. Non-zero otherwise.
*/
-extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
+int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
/**
* Reset the general I/O statistics of an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_stats_reset(uint8_t port_id);
+void rte_eth_stats_reset(uint8_t port_id);
/**
* Retrieve extended statistics of an Ethernet device.
* shall not be used by the caller.
* - negative value on error (invalid port id)
*/
-extern int rte_eth_xstats_get(uint8_t port_id,
- struct rte_eth_xstats *xstats, unsigned n);
+int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
+ unsigned n);
/**
* Reset extended statistics of an Ethernet device.
* @param port_id
* The port identifier of the Ethernet device.
*/
-extern void rte_eth_xstats_reset(uint8_t port_id);
+void rte_eth_xstats_reset(uint8_t port_id);
/**
* Set a mapping for the specified transmit queue to the specified per-queue
* @return
* Zero if successful. Non-zero otherwise.
*/
-extern int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
- uint16_t tx_queue_id,
- uint8_t stat_idx);
+int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
+ uint16_t tx_queue_id, uint8_t stat_idx);
/**
* Set a mapping for the specified receive queue to the specified per-queue
* @return
* Zero if successful. Non-zero otherwise.
*/
-extern int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
- uint16_t rx_queue_id,
- uint8_t stat_idx);
+int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
+ uint16_t rx_queue_id,
+ uint8_t stat_idx);
/**
* Retrieve the Ethernet address of an Ethernet device.
* A pointer to a structure of type *ether_addr* to be filled with
* the Ethernet address of the Ethernet device.
*/
-extern void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
+void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
/**
* Retrieve the contextual information of an Ethernet device.
* A pointer to a structure of type *rte_eth_dev_info* to be filled with
* the contextual information of the Ethernet device.
*/
-extern void rte_eth_dev_info_get(uint8_t port_id,
- struct rte_eth_dev_info *dev_info);
+void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info);
/**
* Retrieve the MTU of an Ethernet device.
* - (0) if successful.
* - (-ENODEV) if *port_id* invalid.
*/
-extern int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
+int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
/**
* Change the MTU of an Ethernet device.
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if *mtu* invalid.
*/
-extern int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
+int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
/**
* Enable/Disable hardware filtering by an Ethernet device of received
* - (-ENOSYS) if VLAN filtering on *port_id* disabled.
* - (-EINVAL) if *vlan_id* > 4095.
*/
-extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id , int on);
+int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on);
/**
* Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device.
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if *rx_queue_id* invalid.
*/
-extern int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id,
- uint16_t rx_queue_id, int on);
+int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id,
+ int on);
/**
* Set the Outer VLAN Ether Type by an Ethernet device, it can be inserted to
* - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported.
* - (-ENODEV) if *port_id* invalid.
*/
-extern int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
+int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
/**
* Set VLAN offload configuration on an Ethernet device
* - (-ENOSUP) if hardware-assisted VLAN filtering not configured.
* - (-ENODEV) if *port_id* invalid.
*/
-extern int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
+int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
/**
* Read VLAN Offload configuration from an Ethernet device
* ETH_VLAN_EXTEND_OFFLOAD
* - (-ENODEV) if *port_id* invalid.
*/
-extern int rte_eth_dev_get_vlan_offload(uint8_t port_id);
+int rte_eth_dev_get_vlan_offload(uint8_t port_id);
/**
* Set port based TX VLAN insersion on or off.
* - (0) if successful.
* - negative if failed.
*/
-extern int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);
+int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);
/**
*
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_enable(uint8_t port_id);
+int rte_eth_timesync_enable(uint8_t port_id);
/**
* Disable IEEE1588/802.1AS timestamping for an Ethernet device.
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_disable(uint8_t port_id);
+int rte_eth_timesync_disable(uint8_t port_id);
/**
* Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
- struct timespec *timestamp,
- uint32_t flags);
+int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
+ struct timespec *timestamp, uint32_t flags);
/**
* Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
- struct timespec *timestamp);
+int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
+ struct timespec *timestamp);
/**
* Adjust the timesync clock on an Ethernet device.
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
+int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
/**
* Read the time from the timesync clock on an Ethernet device.
* @return
* - 0: Success.
*/
-extern int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
+int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
/**
* Set the time of the timesync clock on an Ethernet device.
* - -ENODEV: The port ID is invalid.
* - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-extern int rte_eth_timesync_write_time(uint8_t port_id,
- const struct timespec *time);
+int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time);
/**
* Copy pci device info to the Ethernet device data.
* @return
* - 0 on success, negative on error
*/
-extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);
-
+void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
+ struct rte_pci_device *pci_dev);
/**
* Create memzone for HW rings.