nfp: parse vNIC TLV capabilities at alloc time
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 9 Nov 2018 03:50:35 +0000 (19:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 04:48:00 +0000 (20:48 -0800)
commit83ec8857a00ff11cb3abc4d7c003de8ea103b715
treee505a279b5c18810f98ab66954a60489a1566324
parente38f5d11b98fa65a23301c28567bd786e4a97e75
nfp: parse vNIC TLV capabilities at alloc time

In certain cases initialization logic which follows allocation of
the vNIC structure may want to validate the capabilities of that vNIC.
This is easy before vNIC is initialized for normal capabilities which
are at fixed offsets in control memory, easy to locate and read, but
poses a challenge if the capabilities are in form of TLVs.  Parse
the TLVs early on so other code can just access parsed info, instead
of having to do the parsing by itself.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c