• Jakub Kicinski's avatar
    net: manage napi add/del idempotence explicitly · 4d092dd2
    Jakub Kicinski authored
    To RCUify napi->dev_list we need to replace list_del_init()
    with list_del_rcu(). There is no _init() version for RCU for
    obvious reasons. Up until now netif_napi_del() was idempotent
    so to make sure it remains such add a bit which is set when
    NAPI is listed, and cleared when it removed. Since we don't
    expect multiple calls to netif_napi_add() to be correct,
    add a warning on that side.
    
    Now that napi_hash_add / napi_hash_del are only called by
    napi_add / del we can actually steal its bit. We just need
    to make sure hash node is initialized correctly.
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4d092dd2
dev.c 274 KB