aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/dpdk
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-01-23 15:24:49 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-27 19:55:09 +0000
commit50132fa8c14dd74a77b760bc603f96d7027bb73a (patch)
tree23334ce33e97dd538b5bfcd113c3a3f8eeaa82b4 /src/vnet/devices/dpdk
parent4746a5d75ebb080d15d5d743dca3a85d0265176f (diff)
dpdk : incorrect rx filter being installed
When mac address is set prior bringing interface up incorrect rx filter being installed into the e1000 mac. Change-Id: If59a2bf16f732e45221b3787d271307d369e54d3 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'src/vnet/devices/dpdk')
-rw-r--r--src/vnet/devices/dpdk/device.c10
-rw-r--r--src/vnet/devices/dpdk/dpdk.h3
-rwxr-xr-xsrc/vnet/devices/dpdk/init.c8
3 files changed, 20 insertions, 1 deletions
diff --git a/src/vnet/devices/dpdk/device.c b/src/vnet/devices/dpdk/device.c
index 0deab6aa2a9..cd32389c69d 100644
--- a/src/vnet/devices/dpdk/device.c
+++ b/src/vnet/devices/dpdk/device.c
@@ -60,6 +60,8 @@ dpdk_set_mac_address (vnet_hw_interface_t * hi, char *address)
}
else
{
+ vec_reset_length (xd->default_mac_address);
+ vec_add (xd->default_mac_address, address, sizeof (address));
return NULL;
}
}
@@ -628,7 +630,13 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
f64 now = vlib_time_now (dm->vlib_main);
if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0)
- rv = rte_eth_dev_start (xd->device_index);
+ {
+ rv = rte_eth_dev_start (xd->device_index);
+ if (!rv && xd->default_mac_address)
+ rv = rte_eth_dev_default_mac_addr_set (xd->device_index,
+ (struct ether_addr *)
+ xd->default_mac_address);
+ }
if (xd->flags & DPDK_DEVICE_FLAG_PROMISC)
rte_eth_promiscuous_enable (xd->device_index);
diff --git a/src/vnet/devices/dpdk/dpdk.h b/src/vnet/devices/dpdk/dpdk.h
index 066ec6fadbf..a91e87df4d8 100644
--- a/src/vnet/devices/dpdk/dpdk.h
+++ b/src/vnet/devices/dpdk/dpdk.h
@@ -232,6 +232,9 @@ typedef struct
struct rte_eth_xstat *last_cleared_xstats;
f64 time_last_stats_update;
dpdk_port_type_t port_type;
+
+ /* mac address */
+ u8 *default_mac_address;
} dpdk_device_t;
#define DPDK_STATS_POLL_INTERVAL (10.0)
diff --git a/src/vnet/devices/dpdk/init.c b/src/vnet/devices/dpdk/init.c
index 4c040d20af7..3fa656ea13f 100755
--- a/src/vnet/devices/dpdk/init.c
+++ b/src/vnet/devices/dpdk/init.c
@@ -125,6 +125,10 @@ dpdk_port_setup (dpdk_main_t * dm, dpdk_device_t * xd)
{
int rv;
rv = rte_eth_dev_start (xd->device_index);
+ if (!rv && xd->default_mac_address)
+ rv = rte_eth_dev_default_mac_addr_set (xd->device_index,
+ (struct ether_addr *)
+ xd->default_mac_address);
if (rv < 0)
clib_warning ("rte_eth_dev_start %d returned %d",
xd->device_index, rv);
@@ -199,6 +203,10 @@ dpdk_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, u32 flags)
if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
int rv = rte_eth_dev_start (xd->device_index);
+ if (!rv && xd->default_mac_address)
+ rv = rte_eth_dev_default_mac_addr_set (xd->device_index,
+ (struct ether_addr *)
+ xd->default_mac_address);
if (rv < 0)
clib_warning ("rte_eth_dev_start %d returned %d",
xd->device_index, rv);