ethdev: fix adding invalid MAC address
[dpdk.git] / drivers / net / i40e / i40e_ethdev_vf.c
index cb34023..6c081f0 100644 (file)
@@ -136,10 +136,10 @@ static int i40evf_dev_tx_queue_start(struct rte_eth_dev *dev,
                                     uint16_t tx_queue_id);
 static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev,
                                    uint16_t tx_queue_id);
-static void i40evf_add_mac_addr(struct rte_eth_dev *dev,
-                               struct ether_addr *addr,
-                               uint32_t index,
-                               uint32_t pool);
+static int i40evf_add_mac_addr(struct rte_eth_dev *dev,
+                              struct ether_addr *addr,
+                              uint32_t index,
+                              uint32_t pool);
 static void i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index);
 static int i40evf_dev_rss_reta_update(struct rte_eth_dev *dev,
                        struct rte_eth_rss_reta_entry64 *reta_conf,
@@ -855,7 +855,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev)
        return 0;
 }
 
-static void
+static int
 i40evf_add_mac_addr(struct rte_eth_dev *dev,
                    struct ether_addr *addr,
                    __rte_unused uint32_t index,
@@ -873,7 +873,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,
                            addr->addr_bytes[0], addr->addr_bytes[1],
                            addr->addr_bytes[2], addr->addr_bytes[3],
                            addr->addr_bytes[4], addr->addr_bytes[5]);
-               return;
+               return I40E_ERR_INVALID_MAC_ADDR;
        }
 
        list = (struct i40e_virtchnl_ether_addr_list *)cmd_buffer;
@@ -892,7 +892,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,
                PMD_DRV_LOG(ERR, "fail to execute command "
                            "OP_ADD_ETHER_ADDRESS");
 
-       return;
+       return err;
 }
 
 static void