qede: Split PF/VF ndos.
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Tue, 9 May 2017 12:07:51 +0000 (15:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 May 2017 15:24:22 +0000 (11:24 -0400)
commitbe47c5555778fa3354950731023deb034a9e445e
treec3a75b7fe45cc2c93c3be2a191c662abdfd2c710
parenta82dadbce47395747824971db08a128130786fdc
qede: Split PF/VF ndos.

PFs and VFs share the same structure of NDOs today,
and the VFs explicitly fails the ndo_xdp() callback stating
it doesn't support XDP.

This results in lots of:

  [qede_xdp:1032(enp131s2)]VFs don't support XDP
  ------------[ cut here ]------------
  WARNING: CPU: 4 PID: 1426 at net/core/rtnetlink.c:1637 rtnl_dump_ifinfo+0x354/0x3c0
  ...
  Call Trace:
    ? __alloc_skb+0x9b/0x1d0
    netlink_dump+0x122/0x290
    netlink_recvmsg+0x27d/0x430
    sock_recvmsg+0x3d/0x50
  ...

As every dump request for the VF interface info would fail due to
rtnl_xdp_fill() returning an error code.

To resolve this, introduce a subset of the NDOs meant for the VF
in a seperate structure and register that one instead for VFs,
and omit the ndo_xdp initialization.

Fixes: 40b8c45492ef ("qede: Prevent VFs from using XDP")
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
drivers/net/ethernet/qlogic/qede/qede_main.c