[dpdk-dev] [PATCH v2] ethdev: return diagnostic when setting MAC address

Ferruh Yigit ferruh.yigit at intel.com
Tue Apr 3 18:19:06 CEST 2018


On 4/3/2018 1:41 PM, Olivier Matz wrote:
> diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
> index 6ab515ca9..87748f789 100644
> --- a/drivers/net/mvpp2/mrvl_ethdev.c
> +++ b/drivers/net/mvpp2/mrvl_ethdev.c
> @@ -987,7 +987,7 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
>  		return;
>  
>  	if (priv->isolated)
> -		return;
> +		return -ENOTSUP;
>  
>  	ret = pp2_ppio_remove_mac_addr(priv->ppio,
>  				       dev->data->mac_addrs[index].addr_bytes);
> @@ -996,6 +996,8 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
>  				  &dev->data->mac_addrs[index]);
>  		RTE_LOG(ERR, PMD, "Failed to remove mac %s\n", buf);
>  	}
> +
> +	return ret;
>  }

I guess mrvl_mac_addr_remove() updated by mistake?

>  
>  /**
> @@ -1061,18 +1063,21 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
>   *   Pointer to Ethernet device structure.
>   * @param mac_addr
>   *   MAC address to register.
> + *
> + * @return
> + *   0 on success, negative error value otherwise.
>   */
> -static void
> +static int
>  mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
>  {
>  	struct mrvl_priv *priv = dev->data->dev_private;
>  	int ret;
>  
>  	if (!priv->ppio)
> -		return;
> +		return 0;
>  
>  	if (priv->isolated)
> -		return;
> +		return -ENOTSUP;
>  
>  	ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes);
>  	if (ret) {
> @@ -1080,6 +1085,8 @@ mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
>  		ether_format_addr(buf, sizeof(buf), mac_addr);
>  		RTE_LOG(ERR, PMD, "Failed to set mac to %s\n", buf);
>  	}
> +
> +	return ret;
>  }
>  
>  /**



More information about the dev mailing list