[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BLUPR0701MB20042DD110A79E49C2BC0DD78DE40@BLUPR0701MB2004.namprd07.prod.outlook.com>
Date: Thu, 18 May 2017 04:58:25 +0000
From: "Mintz, Yuval" <Yuval.Mintz@...ium.com>
To: David Miller <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net 5/5] qede: Split PF/VF ndos.
> > 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.
Powered by blists - more mailing lists