qede: Prevent VFs from using XDP
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Fri, 7 Apr 2017 08:04:59 +0000 (11:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Apr 2017 13:26:14 +0000 (06:26 -0700)
Current implementation of VFs is very tight in regard to queue
resources. VFs support for XDP would require quite a bit of additional
infrastructure in qede and qed [sharing of queue-zones between queues,
more VF cids, mapping of the doorbell bar, etc.].

For now, prevent XDP programs from being attached to VFs.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_filter.c

index 107c3fda4792c3b7f2fb83168f192b1aef35fc70..ecd5b3ab783f617cb80878e1c6a2de8ccab9e11e 100644 (file)
@@ -537,6 +537,11 @@ int qede_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 {
        struct qede_dev *edev = netdev_priv(dev);
 
+       if (IS_VF(edev)) {
+               DP_NOTICE(edev, "VFs don't support XDP\n");
+               return -EOPNOTSUPP;
+       }
+
        switch (xdp->command) {
        case XDP_SETUP_PROG:
                return qede_xdp_set(edev, xdp->prog);