[dpdk-dev,v3] test/bonding: assign non-zero MAC to null devices
Checks
Commit Message
Prevent failure in rte_eth_dev_default_mac_addr_set() that
resunts in bonding add slave failure.
Fixes: aa7791ba8de0 ("net/bonding: fix setting slave MAC addresses")
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
v3: update commit message
test/test/test_link_bonding_rssconf.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
On 2/1/2018 11:06 AM, Radu Nicolau wrote:
> Prevent failure in rte_eth_dev_default_mac_addr_set() that
> resunts in bonding add slave failure.
>
> Fixes: aa7791ba8de0 ("net/bonding: fix setting slave MAC addresses")
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
(initialization changes as below to prevent build error:
struct ether_addr mac_addr = { .addr_bytes = {0} }; )
@@ -505,6 +505,7 @@ test_setup(void)
int port_id;
char name[256];
struct slave_conf *port;
+ struct ether_addr mac_addr = {0};
if (test_params.mbuf_pool == NULL) {
@@ -536,6 +537,10 @@ test_setup(void)
TEST_ASSERT_SUCCESS(retval, "Failed to configure virtual ethdev %s\n",
name);
+ /* assign a non-zero MAC */
+ mac_addr.addr_bytes[5] = 0x10 + port->port_id;
+ rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr);
+
rte_eth_dev_info_get(port->port_id, &port->dev_info);
}