git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/pcap: convert config option to a macro
[dpdk.git]
/
drivers
/
net
/
pcap
/
rte_eth_pcap.c
diff --git
a/drivers/net/pcap/rte_eth_pcap.c
b/drivers/net/pcap/rte_eth_pcap.c
index
c657951
..
595d4f8
100644
(file)
--- a/
drivers/net/pcap/rte_eth_pcap.c
+++ b/
drivers/net/pcap/rte_eth_pcap.c
@@
-1,7
+1,7
@@
/*-
* BSD LICENSE
*
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-201
5
Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-201
6
Intel Corporation. All rights reserved.
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
*
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
*
@@
-40,7
+40,7
@@
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
-#include <rte_dev.h>
+#include <rte_
v
dev.h>
#include <net/if.h>
#include <net/if.h>
@@
-58,6
+58,8
@@
#define ETH_PCAP_ARG_MAXLEN 64
#define ETH_PCAP_ARG_MAXLEN 64
+#define RTE_PMD_PCAP_MAX_QUEUES 16
+
static char errbuf[PCAP_ERRBUF_SIZE];
static unsigned char tx_pcap_data[RTE_ETH_PCAP_SNAPLEN];
static struct timeval start_time;
static char errbuf[PCAP_ERRBUF_SIZE];
static unsigned char tx_pcap_data[RTE_ETH_PCAP_SNAPLEN];
static struct timeval start_time;
@@
-87,22
+89,22
@@
struct pcap_tx_queue {
struct rx_pcaps {
unsigned num_of_rx;
struct rx_pcaps {
unsigned num_of_rx;
- pcap_t *pcaps[RTE_PMD_
RING_MAX_RX_RING
S];
- const char *names[RTE_PMD_
RING_MAX_RX_RING
S];
- const char *types[RTE_PMD_
RING_MAX_RX_RING
S];
+ pcap_t *pcaps[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ const char *names[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ const char *types[RTE_PMD_
PCAP_MAX_QUEUE
S];
};
struct tx_pcaps {
unsigned num_of_tx;
};
struct tx_pcaps {
unsigned num_of_tx;
- pcap_dumper_t *dumpers[RTE_PMD_
RING_MAX_TX_RING
S];
- pcap_t *pcaps[RTE_PMD_
RING_MAX_RX_RING
S];
- const char *names[RTE_PMD_
RING_MAX_RX_RING
S];
- const char *types[RTE_PMD_
RING_MAX_RX_RING
S];
+ pcap_dumper_t *dumpers[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ pcap_t *pcaps[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ const char *names[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ const char *types[RTE_PMD_
PCAP_MAX_QUEUE
S];
};
struct pmd_internals {
};
struct pmd_internals {
- struct pcap_rx_queue rx_queue[RTE_PMD_
RING_MAX_RX_RING
S];
- struct pcap_tx_queue tx_queue[RTE_PMD_
RING_MAX_TX_RING
S];
+ struct pcap_rx_queue rx_queue[RTE_PMD_
PCAP_MAX_QUEUE
S];
+ struct pcap_tx_queue tx_queue[RTE_PMD_
PCAP_MAX_QUEUE
S];
int if_index;
int single_iface;
};
int if_index;
int single_iface;
};
@@
-126,6
+128,7
@@
static struct rte_eth_link pmd_link = {
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
.link_speed = ETH_SPEED_NUM_10G,
.link_duplex = ETH_LINK_FULL_DUPLEX,
.link_status = ETH_LINK_DOWN,
+ .link_autoneg = ETH_LINK_SPEED_FIXED,
};
static int
};
static int
@@
-821,7
+824,7
@@
rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues,
goto error;
/* reserve an ethdev entry */
goto error;
/* reserve an ethdev entry */
- *eth_dev = rte_eth_dev_allocate(name
, RTE_ETH_DEV_VIRTUAL
);
+ *eth_dev = rte_eth_dev_allocate(name);
if (*eth_dev == NULL)
goto error;
if (*eth_dev == NULL)
goto error;
@@
-977,8
+980,8
@@
rte_pmd_pcap_devinit(const char *name, const char *params)
unsigned numa_node, using_dumpers = 0;
int ret;
struct rte_kvargs *kvlist;
unsigned numa_node, using_dumpers = 0;
int ret;
struct rte_kvargs *kvlist;
- struct rx_pcaps pcaps;
- struct tx_pcaps dumpers;
+ struct rx_pcaps pcaps
= {0}
;
+ struct tx_pcaps dumpers
= {0}
;
RTE_LOG(INFO, PMD, "Initializing pmd_pcap for %s\n", name);
RTE_LOG(INFO, PMD, "Initializing pmd_pcap for %s\n", name);
@@
-1082,11
+1085,15
@@
rte_pmd_pcap_devuninit(const char *name)
return 0;
}
return 0;
}
-static struct rte_driver pmd_pcap_drv = {
- .name = "eth_pcap",
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_pcap_drv = {
.init = rte_pmd_pcap_devinit,
.uninit = rte_pmd_pcap_devuninit,
};
.init = rte_pmd_pcap_devinit,
.uninit = rte_pmd_pcap_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_pcap_drv);
+DRIVER_REGISTER_VDEV(net_pcap, pmd_pcap_drv);
+DRIVER_REGISTER_PARAM_STRING(net_pcap,
+ "rx_pcap=<string> "
+ "tx_pcap=<string> "
+ "rx_iface=<ifc> "
+ "tx_iface=<ifc> "
+ "iface=<ifc>");