ethdev: return diagnostic when setting MAC address
[dpdk.git] / drivers / net / i40e / i40e_ethdev_vf.c
index 03b7b5b..031c706 100644 (file)
@@ -120,7 +120,7 @@ static int i40evf_dev_rss_hash_update(struct rte_eth_dev *dev,
 static int i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
                                        struct rte_eth_rss_conf *rss_conf);
 static int i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
-static void i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
+static int i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
                                        struct ether_addr *mac_addr);
 static int
 i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id);
@@ -2183,7 +2183,6 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
        memset(dev_info, 0, sizeof(*dev_info));
-       dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
        dev_info->max_rx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
@@ -2203,6 +2202,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_RX_OFFLOAD_CRC_STRIP |
                DEV_RX_OFFLOAD_SCATTER;
 
+       dev_info->tx_queue_offload_capa = 0;
        dev_info->tx_offload_capa =
                DEV_TX_OFFLOAD_VLAN_INSERT |
                DEV_TX_OFFLOAD_QINQ_INSERT |
@@ -2666,7 +2666,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
        return ret;
 }
 
-static void
+static int
 i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
                            struct ether_addr *mac_addr)
 {
@@ -2675,17 +2675,19 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
 
        if (!is_valid_assigned_ether_addr(mac_addr)) {
                PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
-               return;
+               return -EINVAL;
        }
 
        if (vf->flags & I40E_FLAG_VF_MAC_BY_PF)
-               return;
+               return -EPERM;
 
        i40evf_del_mac_addr_by_addr(dev, (struct ether_addr *)hw->mac.addr);
 
-       i40evf_add_mac_addr(dev, mac_addr, 0, 0);
+       if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0)
+               return -EIO;
 
        ether_addr_copy(mac_addr, (struct ether_addr *)hw->mac.addr);
+       return 0;
 }
 
 static int