• Chris Mi's avatar
    net/sched: Change cls_flower to use IDR · c15ab236
    Chris Mi authored
    Currently, all filters with the same priority are linked in a doubly
    linked list. Every filter should have a unique handle. To make the
    handle unique, we need to iterate the list every time to see if the
    handle exists or not when inserting a new filter. It is time-consuming.
    For example, it takes about 5m3.169s to insert 64K rules.
    
    This patch changes cls_flower to use IDR. With this patch, it
    takes about 0m1.127s to insert 64K rules. The improvement is huge.
    
    But please note that in this testing, all filters share the same action.
    If every filter has a unique action, that is another bottleneck.
    Follow-up patch in this patchset addresses that.
    Signed-off-by: default avatarChris Mi <chrism@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c15ab236
cls_flower.c 40.9 KB