From: Chas Williams Date: Mon, 19 Feb 2018 00:39:55 +0000 (-0500) Subject: net/e1000: add MAC address set to em X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1b8287b62265b0bc488ed09391e1f1262bde0d35;p=dpdk.git net/e1000: add MAC address set to em Based on the equivalent code in the igb driver. Signed-off-by: Chas Williams Reviewed-by: David Marchand Acked-by: Wei Zhao --- diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 087c192d53..ffdc7fd57e 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -93,6 +93,8 @@ static int em_get_rx_buffer_size(struct e1000_hw *hw); static int eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, uint32_t index, uint32_t pool); static void eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index); +static void eth_em_default_mac_addr_set(struct rte_eth_dev *dev, + struct ether_addr *addr); static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, @@ -189,6 +191,7 @@ static const struct eth_dev_ops eth_em_ops = { .dev_led_off = eth_em_led_off, .flow_ctrl_get = eth_em_flow_ctrl_get, .flow_ctrl_set = eth_em_flow_ctrl_set, + .mac_addr_set = eth_em_default_mac_addr_set, .mac_addr_add = eth_em_rar_set, .mac_addr_remove = eth_em_rar_clear, .set_mc_addr_list = eth_em_set_mc_addr_list, @@ -1771,6 +1774,15 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index) e1000_rar_set(hw, addr, index); } +static void +eth_em_default_mac_addr_set(struct rte_eth_dev *dev, + struct ether_addr *addr) +{ + eth_em_rar_clear(dev, 0); + + eth_em_rar_set(dev, (void *)addr, 0, 0); +} + static int eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {