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>
Showing
- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c 35 additions, 2 deletionsdrivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
- include/linux/objagg.h 18 additions, 2 deletionsinclude/linux/objagg.h
- lib/objagg.c 560 additions, 13 deletionslib/objagg.c
- lib/test_objagg.c 189 additions, 5 deletionslib/test_objagg.c
Please register or sign in to comment