To remove assumption, do like followings.
This patch adds "RTE_PCI_DRV_DETACHABLE" to drv_flags of rte_pci_driver
structure. The flags indicate the driver can detach devices at runtime.
Also, remove assumption that port will not be detached.
To remove the assumption.
- Add 'attached' member to rte_eth_dev structure.
This member is used for indicating the port is attached, or not.
DEV_ATTACHED indicates a port is attached.
DEV_DETACHED indicates a port is detached.
- Add rte_eth_dev_allocate_new_port().
This function is used for allocating new port.
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
#define RTE_PCI_DRV_FORCE_UNBIND 0x0004
/** Device driver supports link state interrupt */
#define RTE_PCI_DRV_INTR_LSC 0x0008
#define RTE_PCI_DRV_FORCE_UNBIND 0x0004
/** Device driver supports link state interrupt */
#define RTE_PCI_DRV_INTR_LSC 0x0008
+/** Device driver supports detaching capability */
+#define RTE_PCI_DRV_DETACHABLE 0x0010
/**< Internal use only - Macro used by pci addr parsing functions **/
#define GET_PCIADDR_FIELD(in, fd, lim, dlm) \
/**< Internal use only - Macro used by pci addr parsing functions **/
#define GET_PCIADDR_FIELD(in, fd, lim, dlm) \
+enum {
+ DEV_DETACHED = 0,
+ DEV_ATTACHED
+};
+
static inline void
rte_eth_dev_data_alloc(void)
{
static inline void
rte_eth_dev_data_alloc(void)
{
- for (i = 0; i < nb_ports; i++) {
- if (strcmp(rte_eth_devices[i].data->name, name) == 0)
+ for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
+ if ((rte_eth_devices[i].attached == DEV_ATTACHED) &&
+ strcmp(rte_eth_devices[i].data->name, name) == 0)
return &rte_eth_devices[i];
}
return NULL;
}
return &rte_eth_devices[i];
}
return NULL;
}
+static uint8_t
+rte_eth_dev_find_free_port(void)
+{
+ unsigned i;
+
+ for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
+ if (rte_eth_devices[i].attached == DEV_DETACHED)
+ return i;
+ }
+ return RTE_MAX_ETHPORTS;
+}
+
struct rte_eth_dev *
rte_eth_dev_allocate(const char *name)
{
struct rte_eth_dev *
rte_eth_dev_allocate(const char *name)
{
struct rte_eth_dev *eth_dev;
struct rte_eth_dev *eth_dev;
- if (nb_ports == RTE_MAX_ETHPORTS) {
+ port_id = rte_eth_dev_find_free_port();
+ if (port_id == RTE_MAX_ETHPORTS) {
PMD_DEBUG_TRACE("Reached maximum number of Ethernet ports\n");
return NULL;
}
PMD_DEBUG_TRACE("Reached maximum number of Ethernet ports\n");
return NULL;
}
- eth_dev = &rte_eth_devices[nb_ports];
- eth_dev->data = &rte_eth_dev_data[nb_ports];
+ eth_dev = &rte_eth_devices[port_id];
+ eth_dev->data = &rte_eth_dev_data[port_id];
snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name);
snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name);
- eth_dev->data->port_id = nb_ports++;
+ eth_dev->data->port_id = port_id;
+ eth_dev->attached = DEV_ATTACHED;
+ nb_ports++;
(unsigned) pci_dev->id.device_id);
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
(unsigned) pci_dev->id.device_id);
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
+ eth_dev->attached = DEV_DETACHED;
nb_ports--;
return diag;
}
nb_ports--;
return diag;
}
rte_eal_pci_register(ð_drv->pci_drv);
}
rte_eal_pci_register(ð_drv->pci_drv);
}
+static int
+rte_eth_dev_is_valid_port(uint8_t port_id)
+{
+ if (port_id >= RTE_MAX_ETHPORTS ||
+ rte_eth_devices[port_id].attached != DEV_ATTACHED)
+ return 0;
+ else
+ return 1;
+}
+
int
rte_eth_dev_socket_id(uint8_t port_id)
{
int
rte_eth_dev_socket_id(uint8_t port_id)
{
- if (port_id >= nb_ports)
+ if (!rte_eth_dev_is_valid_port(port_id))
return -1;
return rte_eth_devices[port_id].pci_dev->numa_node;
}
return -1;
return rte_eth_devices[port_id].pci_dev->numa_node;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports || port_id >= RTE_MAX_ETHPORTS) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_infos_get, -ENOTSUP);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
- PMD_DEBUG_TRACE("Invalid port_id=%" PRIu8 "\n", port_id);
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP);
* in a multi-process setup*/
PROC_PRIMARY_OR_RET();
* in a multi-process setup*/
PROC_PRIMARY_OR_RET();
- if (port_id >= nb_ports) {
- PMD_DEBUG_TRACE("Invalid port_id=%" PRIu8 "\n", port_id);
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_up, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_up, -ENOTSUP);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -EINVAL;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_down, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_down, -ENOTSUP);
* in a multi-process setup*/
PROC_PRIMARY_OR_RET();
* in a multi-process setup*/
PROC_PRIMARY_OR_RET();
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
dev = &rte_eth_devices[port_id];
if (rx_queue_id >= dev->data->nb_rx_queues) {
PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id);
dev = &rte_eth_devices[port_id];
if (rx_queue_id >= dev->data->nb_rx_queues) {
PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
* in a multi-process setup*/
PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
- if (port_id >= RTE_MAX_ETHPORTS || port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
dev = &rte_eth_devices[port_id];
if (tx_queue_id >= dev->data->nb_tx_queues) {
PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", tx_queue_id);
dev = &rte_eth_devices[port_id];
if (tx_queue_id >= dev->data->nb_tx_queues) {
PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", tx_queue_id);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->promiscuous_enable);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->promiscuous_enable);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->promiscuous_disable);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->promiscuous_disable);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->allmulticast_enable);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->allmulticast_enable);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->allmulticast_disable);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->allmulticast_disable);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
if (dev->data->dev_conf.intr_conf.lsc != 0)
dev = &rte_eth_devices[port_id];
if (dev->data->dev_conf.intr_conf.lsc != 0)
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
if (dev->data->dev_conf.intr_conf.lsc != 0)
dev = &rte_eth_devices[port_id];
if (dev->data->dev_conf.intr_conf.lsc != 0)
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
memset(stats, 0, sizeof(*stats));
dev = &rte_eth_devices[port_id];
memset(stats, 0, sizeof(*stats));
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset);
uint64_t val;
char *stats_ptr;
uint64_t val;
char *stats_ptr;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -1;
}
dev = &rte_eth_devices[port_id];
/* implemented by the driver */
dev = &rte_eth_devices[port_id];
/* implemented by the driver */
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
/* implemented by the driver */
dev = &rte_eth_devices[port_id];
/* implemented by the driver */
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_stats_mapping_set, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_stats_mapping_set, -ENOTSUP);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
dev = &rte_eth_devices[port_id];
memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return;
}
dev = &rte_eth_devices[port_id];
ether_addr_copy(&dev->data->mac_addrs[0], mac_addr);
}
dev = &rte_eth_devices[port_id];
ether_addr_copy(&dev->data->mac_addrs[0], mac_addr);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
int ret;
struct rte_eth_dev *dev;
int ret;
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
if (! (dev->data->dev_conf.rxmode.hw_vlan_filter)) {
PMD_DEBUG_TRACE("port %d: vlan-filtering disabled\n", port_id);
dev = &rte_eth_devices[port_id];
if (! (dev->data->dev_conf.rxmode.hw_vlan_filter)) {
PMD_DEBUG_TRACE("port %d: vlan-filtering disabled\n", port_id);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
int mask = 0;
int cur, org = 0;
int mask = 0;
int cur, org = 0;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
struct rte_eth_dev *dev;
int ret = 0;
struct rte_eth_dev *dev;
int ret = 0;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_pvid_set, -ENOTSUP);
(*dev->dev_ops->vlan_pvid_set)(dev, pvid, on);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_pvid_set, -ENOTSUP);
(*dev->dev_ops->vlan_pvid_set)(dev, pvid, on);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
struct rte_eth_dev *dev;
int ret;
struct rte_eth_dev *dev;
int ret;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
struct rte_eth_dev *dev;
uint16_t rss_hash_protos;
struct rte_eth_dev *dev;
uint16_t rss_hash_protos;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
rss_hash_protos = rss_conf->rss_hf;
if ((rss_hash_protos != 0) &&
((rss_hash_protos & ETH_RSS_PROTO_MASK) == 0)) {
rss_hash_protos = rss_conf->rss_hf;
if ((rss_hash_protos != 0) &&
((rss_hash_protos & ETH_RSS_PROTO_MASK) == 0)) {
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);
return (*dev->dev_ops->rss_hash_conf_get)(dev, rss_conf);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);
return (*dev->dev_ops->rss_hash_conf_get)(dev, rss_conf);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
dev = &rte_eth_devices[port_id];
if (udp_tunnel == NULL) {
dev = &rte_eth_devices[port_id];
if (udp_tunnel == NULL) {
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
int index;
uint64_t pool_mask;
int index;
uint64_t pool_mask;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_add, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_add, -ENOTSUP);
struct rte_eth_dev *dev;
int index;
struct rte_eth_dev *dev;
int index;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_remove, -ENOTSUP);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_remove, -ENOTSUP);
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("set VF RX mode:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
PMD_DEBUG_TRACE("set VF RX mode:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
int ret;
struct rte_eth_dev *dev;
int ret;
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("unicast hash setting:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
PMD_DEBUG_TRACE("unicast hash setting:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("unicast hash setting:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
PMD_DEBUG_TRACE("unicast hash setting:Invalid port_id=%d\n",
port_id);
return (-ENODEV);
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
struct rte_eth_dev *dev;
struct rte_eth_dev_info dev_info;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("set pool tx:Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("set pool tx:Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("VF VLAN filter:invalid port id=%d\n",
port_id);
return (-ENODEV);
PMD_DEBUG_TRACE("VF VLAN filter:invalid port id=%d\n",
port_id);
return (-ENODEV);
struct rte_eth_dev_info dev_info;
struct rte_eth_link link;
struct rte_eth_dev_info dev_info;
struct rte_eth_link link;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("set queue rate limit:invalid port id=%d\n",
port_id);
return -ENODEV;
PMD_DEBUG_TRACE("set queue rate limit:invalid port id=%d\n",
port_id);
return -ENODEV;
if (q_msk == 0)
return 0;
if (q_msk == 0)
return 0;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("set VF rate limit:invalid port id=%d\n",
port_id);
return -ENODEV;
PMD_DEBUG_TRACE("set VF rate limit:invalid port id=%d\n",
port_id);
return -ENODEV;
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
if (queue_id >= dev->data->nb_rx_queues) {
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
if (queue_id >= dev->data->nb_rx_queues) {
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return 0;
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0);
return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, 0);
return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
return (*dev->dev_ops->rx_descriptor_done)( \
dev = &rte_eth_devices[port_id];
FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
return (*dev->dev_ops->rx_descriptor_done)( \
if (!cb_fn)
return (-EINVAL);
if (!cb_fn)
return (-EINVAL);
- if (port_id >= nb_ports) {
+
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
if (!cb_fn)
return (-EINVAL);
if (!cb_fn)
return (-EINVAL);
- if (port_id >= nb_ports) {
+
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-EINVAL);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return (-ENODEV);
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
{
struct rte_eth_dev *dev;
{
struct rte_eth_dev *dev;
- if (port_id >= nb_ports) {
+ if (!rte_eth_dev_is_valid_port(port_id)) {
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
return -ENODEV;
}
* received packets before passing them to the driver for transmission.
*/
struct rte_eth_rxtx_callback **pre_tx_burst_cbs;
* received packets before passing them to the driver for transmission.
*/
struct rte_eth_rxtx_callback **pre_tx_burst_cbs;
+ uint8_t attached; /**< Flag indicating the port is attached */
};
struct rte_eth_dev_sriov {
};
struct rte_eth_dev_sriov {
* Get the total number of Ethernet devices that have been successfully
* initialized by the [matching] Ethernet driver during the PCI probing phase.
* All devices whose port identifier is in the range
* Get the total number of Ethernet devices that have been successfully
* initialized by the [matching] Ethernet driver during the PCI probing phase.
* All devices whose port identifier is in the range
- * [0, rte_eth_dev_count() - 1] can be operated on by network applications.
+ * [0, rte_eth_dev_count() - 1] can be operated on by network applications
+ * immediately after invoking rte_eal_init().
+ * If the application unplugs a port using hotplug function, The enabled port
+ * numbers may be noncontiguous. In the case, the applications need to manage
+ * enabled port by themselves.
*
* @return
* - The total number of usable Ethernet devices.
*
* @return
* - The total number of usable Ethernet devices.