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?



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






-- 

Chris Friesen
Software Designer

3500 Carling Avenue
Ottawa, Ontario K2H 8E9
www.genband.com

------------------------------------------------------------------------------
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® Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to