> > Looking at my alternatives for solving this, I can't see any 'good'
> > options - it seems mightily unorthodox to modify net_device_ops, I.e.,
> > add/remove an NDO function-pointer based on some device property, and
> > having multiple ops declared for the sake of a single feature seems
> > unscalable.
> 
> Multiple ops is the only thing that works right now.

What about something like - 

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c 
b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 333876c..7450c8b 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -1028,6 +1028,13 @@ int qede_xdp(struct net_device *dev, struct netdev_xdp 
*xdp)
 {
        struct qede_dev *edev = netdev_priv(dev);

+       /* Not all VFs can support XDP; But we can't fail the query */
+       if ((<Actual condition to determine XDP support>) {
+               if (xdp->command == XDP_QUERY_PROG)
+                       return 0;
+               return -EOPNOTSUPP;
+       }
+
        switch (xdp->command) {
        case XDP_SETUP_PROG:
                return qede_xdp_set(edev, xdp->prog);
--

Other than making it a bit more difficult to use the generic XDP [since the VF 
would have the NDO],
I think it would behave as it should.

Reply via email to