be2net: avoid configuring VEPA mode on BE3
authorSuresh Reddy <suresh.reddy@avagotech.com>
Wed, 30 Dec 2015 06:28:57 +0000 (01:28 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Dec 2015 21:33:35 +0000 (16:33 -0500)
BE3 chip doesn't support VEPA mode.

Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 34e324f20d8047d987e7a93c9974f8c2482e3df4..2f76cbeab1e49b70fce50978e8e11d8a4c19cba4 100644 (file)
@@ -5108,6 +5108,9 @@ static int be_ndo_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
                        return -EINVAL;
 
                mode = nla_get_u16(attr);
+               if (BE3_chip(adapter) && mode == BRIDGE_MODE_VEPA)
+                       return -EOPNOTSUPP;
+
                if (mode != BRIDGE_MODE_VEPA && mode != BRIDGE_MODE_VEB)
                        return -EINVAL;