nfp: flower: get flows by host context
authorJohn Hurley <john.hurley@netronome.com>
Mon, 15 Apr 2019 14:55:58 +0000 (16:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Apr 2019 22:45:36 +0000 (15:45 -0700)
commitcf4172d5751fcf8531c3df43cbd490bac7a8c84a
tree1e1cb9e52e77f364f4fbb6b3b1b2288abe418a0d
parent45756dfedab5fd7056ae87aed66b5089f9d8b039
nfp: flower: get flows by host context

Each flow is given a context ID that the fw uses (along with its cookie)
to identity the flow. The flows stats are updated by the fw via this ID
which is a reference to a pre-allocated array entry.

In preparation for flow merge code, enable the nfp_fl_payload structure to
be accessed via this stats context ID. Rather than increasing the memory
requirements of the pre-allocated array, add a new rhashtable to associate
each active stats context ID with its rule payload.

While adding new code to the compile metadata functions, slightly
restructure the existing function to allow for cleaner, easier to read
error handling.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/main.h
drivers/net/ethernet/netronome/nfp/flower/metadata.c