aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/uhd-dpdk/uhd_dpdk.c
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2018-08-31 11:52:04 -0700
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-15 17:14:57 -0800
commite2cde21ceb7497dcc1ef25156afa6472fe64f009 (patch)
tree43def88d4d1e3950236dad44812d27f08ee9e232 /host/lib/transport/uhd-dpdk/uhd_dpdk.c
parent853c2a2263e54c1e1fd9562b479a17122a6d9b37 (diff)
downloaduhd-e2cde21ceb7497dcc1ef25156afa6472fe64f009.tar.gz
uhd-e2cde21ceb7497dcc1ef25156afa6472fe64f009.tar.bz2
uhd-e2cde21ceb7497dcc1ef25156afa6472fe64f009.zip
uhd-dpdk: Add ARP responder, set MTU, and clean up API
Set MTU of Ethernet ports: Some NICs (like the Mellanox ones) require this to work. Add ARP responder to uhd-dpdk. Clean up pending ARP request list when done: Threads waiting for an ARP request to complete would be woken up when the request completed, but they wouldn't get removed from the list of pending requests. This fixes the issue.
Diffstat (limited to 'host/lib/transport/uhd-dpdk/uhd_dpdk.c')
-rw-r--r--host/lib/transport/uhd-dpdk/uhd_dpdk.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/host/lib/transport/uhd-dpdk/uhd_dpdk.c b/host/lib/transport/uhd-dpdk/uhd_dpdk.c
index 2ee74a201..d6a8a5aa6 100644
--- a/host/lib/transport/uhd-dpdk/uhd_dpdk.c
+++ b/host/lib/transport/uhd-dpdk/uhd_dpdk.c
@@ -87,6 +87,12 @@ static inline int uhd_dpdk_port_init(struct uhd_dpdk_port *port,
return -ENODEV;
/* Set up Ethernet device with defaults (1 RX ring, 1 TX ring) */
+ retval = rte_eth_dev_set_mtu(port->id, mtu);
+ if (retval) {
+ RTE_LOG(WARNING, EAL, "%d: Could not set mtu to %d\n", retval, mtu);
+ rte_eth_dev_get_mtu(port->id, &mtu);
+ RTE_LOG(WARNING, EAL, "Current mtu=%d\n", mtu);
+ }
/* FIXME: Check if hw_ip_checksum is possible */
struct rte_eth_conf port_conf = {
.rxmode = {
@@ -194,7 +200,7 @@ static int uhd_dpdk_thread_init(struct uhd_dpdk_thread *thread, unsigned int id)
}
-int uhd_dpdk_init(int argc, char **argv, unsigned int num_ports,
+int uhd_dpdk_init(int argc, const char **argv, unsigned int num_ports,
int *port_thread_mapping, int num_mbufs, int mbuf_cache_size,
int mtu)
{
@@ -207,7 +213,7 @@ int uhd_dpdk_init(int argc, char **argv, unsigned int num_ports,
}
/* Grabs arguments intended for DPDK's EAL */
- int ret = rte_eal_init(argc, argv);
+ int ret = rte_eal_init(argc, (char **) argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Error with EAL initialization\n");