path: root/drivers/net/vmxnet3
diff options
authorOlivier Matz <>2018-04-11 18:32:51 +0200
committerFerruh Yigit <>2018-04-14 00:43:30 +0200
commitcaccf8b318cafcdafe39faa3c5ce3eef67007621 (patch)
treebbff641e52ed194e207315e9eb33a1e772ec5a3b /drivers/net/vmxnet3
parenta85a606ca501296c81c4b3a5e6b359c7ad7e0a77 (diff)
ethdev: return diagnostic when setting MAC address
Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a return code is added to notify the caller (librte_ether) if an error occurred in the PMD. The new default MAC address is now copied in dev->data->mac_addrs[0] only if the operation is successful. The patch also updates all the PMDs accordingly. Signed-off-by: Olivier Matz <> Signed-off-by: Ivan Malov <> Acked-by: Andrew Rybchenko <> Acked-by: Adrien Mazarguil <> Acked-by: Shreyansh Jain <> Reviewed-by: Ferruh Yigit <> Acked-by: Thomas Monjalon <> Acked-by: Nelio Laranjeiro <>
Diffstat (limited to 'drivers/net/vmxnet3')
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 93d9de1..011e262 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -72,7 +72,7 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vid, int on);
static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask);
-static void vmxnet3_mac_addr_set(struct rte_eth_dev *dev,
+static int vmxnet3_mac_addr_set(struct rte_eth_dev *dev,
struct ether_addr *mac_addr);
static void vmxnet3_interrupt_handler(void *param);
@@ -1077,13 +1077,14 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev)
return NULL;
-static void
+static int
vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
struct vmxnet3_hw *hw = dev->data->dev_private;
ether_addr_copy(mac_addr, (struct ether_addr *)(hw->perm_addr));
vmxnet3_write_mac(hw, mac_addr->addr_bytes);
+ return 0;
/* return 0 means link status changed, -1 means not changed */