lib: objagg: implement optimization hints assembly and use hints for object creation
authorJiri Pirko <jiri@mellanox.com>
Thu, 7 Feb 2019 11:22:46 +0000 (11:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Feb 2019 23:02:49 +0000 (15:02 -0800)
commit9069a3817d82b01b3a55da382c774e3575946130
tree5b8aca6dbaf69345aec08b325761cdf9162ebc9b
parentbb72e68bd1f2a86c37a990e9d905f34b712ae2b6
lib: objagg: implement optimization hints assembly and use hints for object creation

Implement simple greedy algo to find more optimized root-delta tree for
a given objagg instance. This "hints" can be used by a driver to:
1) check if the hints are better (driver's choice) than the original
   objagg tree. Driver does comparison of objagg stats and hints stats.
2) use the hints to create a new objagg instance which will construct
   the root-delta tree according to the passed hints. Currently, only a
   simple greedy algorithm is implemented. Basically it finds the roots
   according to the maximal possible user count including deltas.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
include/linux/objagg.h
lib/objagg.c
lib/test_objagg.c