net/sfc/base: improve API to get supported filter matches
authorMark Spender <mspender@solarflare.com>
Thu, 9 Mar 2017 15:26:24 +0000 (15:26 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 13:52:52 +0000 (15:52 +0200)
commit23c6d0dbac80e6396679b831de1f1063a2111132
treeedf3354efba30327b1fc587204ca8ca39bdcbe19
parentdaa007afd04b40f903b02035b73c945b4a25efff
net/sfc/base: improve API to get supported filter matches

The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.

To improve it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return
  the required length
- ensure that the list contents are valid and add comments describing it

It is safe to change this API as, unsurprisingly, it has no users.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/ef10_filter.c
drivers/net/sfc/base/ef10_impl.h
drivers/net/sfc/base/efx.h
drivers/net/sfc/base/efx_filter.c
drivers/net/sfc/base/efx_impl.h