]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
be2net: ignore VF mac address setting for the same mac
authorVasundhara Volam <vasundhara.volam@emulex.com>
Fri, 1 Aug 2014 12:17:31 +0000 (17:47 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Aug 2014 22:59:17 +0000 (15:59 -0700)
ndo_set_vf_mac() call may be issued for a mac-addr that is already
active on a VF. If so, silently ignore the request.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index da4d3863bd18415e8414f63ed93debcf8ab7f40a..db4ff14ff18f0adcffdcb2d8ca54b9e46f65f7c5 100644 (file)
@@ -1270,6 +1270,12 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
        if (!is_valid_ether_addr(mac) || vf >= adapter->num_vfs)
                return -EINVAL;
 
+       /* Proceed further only if user provided MAC is different
+        * from active MAC
+        */
+       if (ether_addr_equal(mac, vf_cfg->mac_addr))
+               return 0;
+
        if (BEx_chip(adapter)) {
                be_cmd_pmac_del(adapter, vf_cfg->if_handle, vf_cfg->pmac_id,
                                vf + 1);