{
uint32_t i;
- /* Init driver */
- RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
- if (rte_eal_pci_probe() < 0)
- rte_panic("Cannot probe PCI\n");
-
/* Init NIC ports, then start the ports */
for (i = 0; i < app.n_ports; i++) {
uint8_t port;
printf("fail to create mempool for kni\n");
return -1;
}
- ret = rte_eal_pci_probe();
- if (ret < 0) {
- printf("fail to probe PCI devices\n");
- return -1;
- }
nb_ports = rte_eth_dev_count();
if (nb_ports == 0) {
if (ret < 0)
return -1;
- if (rte_eal_pci_probe() < 0)
- rte_panic("Cannot probe PCI\n");
-
if (check_lcore_params() < 0)
rte_panic("check_lcore_params failed\n");
return -1;
}
- /* Scan PCI bus for recognised devices */
- ret = rte_eal_pci_probe();
- if (ret < 0)
- FATAL_ERROR("Could not probe PCI (%d)", ret);
-
/* Get number of ports found in scan */
nb_sys_ports = rte_eth_dev_count();
if (nb_sys_ports == 0)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid arguments");
- if (rte_eal_pci_probe() < 0)
- rte_panic("Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
{
uint32_t i;
- /* Init driver */
- RTE_LOG(INFO, USER1, "Initializing the PMD driver ...\n");
- if (rte_eal_pci_probe() < 0)
- rte_panic("Cannot probe PCI\n");
-
/* Init NIC ports, then start the ports */
for (i = 0; i < app.n_ports; i++) {
uint32_t port;
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid IP reassembly parameters\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
if (clone_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No physical ports!\n");
return -1;
}
- /* Scan PCI bus for recognised devices */
- ret = rte_eal_pci_probe();
- if (ret < 0)
- rte_exit(EXIT_FAILURE, "Could not probe PCI (%d)\n", ret);
-
/* Get number of ports found in scan */
nb_sys_ports = rte_eth_dev_count();
if (nb_sys_ports == 0)
if (l2fwd_ivshmem_pktmbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
if (l2fwd_pktmbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
if (ret < 0)
rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
if (ret < 0)
rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
if (ret < 0)
rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
-
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports > RTE_MAX_ETHPORTS)
nb_ports = RTE_MAX_ETHPORTS;
if (lsi_pktmbuf_pool == NULL)
rte_panic("Cannot init mbuf pool\n");
- if (rte_eal_pci_probe() < 0)
- rte_panic("Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports == 0)
rte_panic("No Ethernet port - bye\n");
int ret;
uint32_t n_rx_queues, n_tx_queues;
- if (rte_eal_pci_probe() < 0) {
- rte_panic("Cannot probe PCI\n");
- }
-
/* Init NIC ports and queues, then start the ports */
for (port = 0; port < APP_MAX_NIC_PORTS; port ++) {
struct rte_mempool *pool;
#include <rte_string_fns.h>
#include "common.h"
-#include "init_drivers.h"
/* Number of packets to attempt to read from queue */
#define PKT_READ_SIZE ((uint16_t)32)
if (parse_app_args(argc, argv) < 0)
rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n");
- if (init_drivers() < 0)
- rte_exit(EXIT_FAILURE, "Cannot get NIC ports\n");
if (rte_eth_dev_count() == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
#include <rte_cycles.h>
#include "common.h"
-#include "init_drivers.h"
#include "args.h"
#include "init.h"
#include "main.h"
argc -= retval;
argv += retval;
- /* initialise the nic drivers */
- retval = init_drivers();
- if (retval != 0)
- rte_exit(EXIT_FAILURE, "Cannot initialise drivers\n");
-
/* get total number of ports */
total_ports = rte_eth_dev_count();
+++ /dev/null
-/*-
- * BSD LICENSE
- *
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _INIT_DRIVERS_H_
-#define _INIT_DRIVERS_H_
-
-/**
- * Initialise all 1G and 10G NICs available
- */
-static inline int
-init_drivers(void)
-{
- if (rte_eal_pci_probe() < 0)
- return -1;
-
- return 0;
-}
-
-#endif
for (i = 0; i < RTE_MAX_LCORE; i++)
lcore_resource[i].lcore_id = i;
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
nb_ports = rte_eth_dev_count();
if (nb_ports == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
argc -= ret;
argv += ret;
- /* probe to determine the NIC devices available */
- proc_type = rte_eal_process_type();
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
+ /* determine the NIC devices available */
if (rte_eth_dev_count() == 0)
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
/* parse application arguments (those after the EAL ones) */
smp_parse_args(argc, argv);
+ proc_type = rte_eal_process_type();
mp = (proc_type == RTE_PROC_SECONDARY) ?
rte_mempool_lookup(_SMP_MBUF_POOL) :
rte_mempool_create(_SMP_MBUF_POOL, NB_MBUFS, MBUF_SIZE,
if (ports.num == 0)
rte_exit(EXIT_FAILURE, "no ports specified\n");
- err = rte_eal_pci_probe();
- if (err < 0)
- rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", err);
-
if (rte_eth_dev_count() < 1)
rte_exit(EXIT_FAILURE, "Not enough ethernet ports available\n");
if (pool == NULL)
rte_exit(EXIT_FAILURE, "Buffer pool creation error\n");
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "PCI probe error\n");
-
/* NIC init */
ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf);
if (ret < 0)
char ring_name[MAX_NAME_LEN];
char pool_name[MAX_NAME_LEN];
- if (rte_eal_pci_probe() < 0)
- rte_exit(EXIT_FAILURE, "Cannot probe PCI\n");
-
if (rte_eth_dev_count() == 0)
rte_exit(EXIT_FAILURE, "No Ethernet port - bye\n");
void
init_dpdk(void)
{
- int ret;
-
- /* Bind the drivers to usable devices */
- ret = rte_eal_pci_probe();
- if (ret < 0)
- rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", ret);
-
if (rte_eth_dev_count() < 2)
rte_exit(EXIT_FAILURE, "Not enough ethernet port available\n");
}
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid argument\n");
- if (rte_eal_pci_probe() != 0)
- rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n");
-
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++)
if (rte_lcore_is_enabled(lcore_id))
lcore_ids[core_id ++] = lcore_id;
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid argument\n");
- if (rte_eal_pci_probe() != 0)
- rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n");
-
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++)
if (rte_lcore_is_enabled(lcore_id))
lcore_ids[core_id ++] = lcore_id;
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid VMDQ argument\n");
- if (rte_eal_pci_probe() != 0)
- rte_exit(EXIT_FAILURE, "Error with NIC driver initialization\n");
-
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++)
if (rte_lcore_is_enabled(lcore_id))
lcore_ids[core_id ++] = lcore_id;