ixgbe: Deny MACVLAN requests from VFs with admin set MAC
authorGreg Rose <gregory.v.rose@intel.com>
Sat, 24 Mar 2012 00:26:44 +0000 (00:26 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 2 May 2012 09:12:52 +0000 (02:12 -0700)
If the host VMM administrator has set the virtual function device's
MAC address then also deny VF requests for MACVLAN filters.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Garrett, Robert <robertx.e.garrett@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

index 88a58cb085699fed1083c3f146152febf3efae45..39856371acb1fda056d41be86767c98f6fce5587 100644 (file)
@@ -635,6 +635,12 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
                }
                break;
        case IXGBE_VF_SET_MACVLAN:
+               if (adapter->vfinfo[vf].pf_set_mac) {
+                       e_warn(drv, "VF %d requested MACVLAN filter but is "
+                                   "administratively denied\n", vf);
+                       retval = -1;
+                       break;
+               }
                index = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) >>
                        IXGBE_VT_MSGINFO_SHIFT;
                /*