On Wed, 25 Jul 2012 12:50:20 -0600
Chris Friesen <[email protected]> wrote:

> 
> Hi,
> 
> Just noticed something suspicious in ixgbe_ndo_set_vf_mac().
> 
> We set adapter->vfinfo[vf].pf_set_mac twice, once unconditionally and
> then once conditionally. Should that first one be deleted?
> 

The first MAC address you set is overwritten and replaced with the new
one.

Using the ip tool to set the VF MAC will only set its primary MAC
address.

- Greg

> 
> 
> int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
> {
>       s32 retval = 0;
>       struct ixgbe_adapter *adapter = netdev_priv(netdev);
>       if (!is_valid_ether_addr(mac) || (vf >= adapter->num_vfs))
>               return -EINVAL;
>       adapter->vfinfo[vf].pf_set_mac = true;
>       dev_info(&adapter->pdev->dev, "setting MAC %pM on VF %d\n",
> mac, vf); dev_info(&adapter->pdev->dev, "Reload the VF driver to make
> this change effective.\n"); retval = ixgbe_set_vf_mac(adapter, vf,
> mac); if (retval >= 0) {
>               adapter->vfinfo[vf].pf_set_mac = true;
>               if (test_bit(__IXGBE_DOWN, &adapter->state)) {
>                       dev_warn(&adapter->pdev->dev, "The VF MAC
> address has been set, but the PF device is not up.\n");
> dev_warn(&adapter->pdev->dev, "Bring the PF device up before
> attempting to use the VF device.\n"); } } else {
>               dev_warn(&adapter->pdev->dev, "The VF MAC address was
> NOT set due to invalid or duplicate MAC address.\n"); }
>       return retval;
> }
> 
> 
> Chris
> 
> 
> 
> 
> 
> 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to