summaryrefslogtreecommitdiff
path: root/drivers/net/vmxnet3
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2018-04-11 18:32:51 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-04-14 00:43:30 +0200
commitcaccf8b318cafcdafe39faa3c5ce3eef67007621 (patch)
treebbff641e52ed194e207315e9eb33a1e772ec5a3b /drivers/net/vmxnet3
parenta85a606ca501296c81c4b3a5e6b359c7ad7e0a77 (diff)
downloaddpdk-next-eventdev-caccf8b318cafcdafe39faa3c5ce3eef67007621.zip
dpdk-next-eventdev-caccf8b318cafcdafe39faa3c5ce3eef67007621.tar.gz
dpdk-next-eventdev-caccf8b318cafcdafe39faa3c5ce3eef67007621.tar.xz
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 <olivier.matz@6wind.com> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethdev.c5
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 */