• Tuong Lien's avatar
    tipc: optimize key switching time and logic · f779bf79
    Tuong Lien authored
    We reduce the lasting time for a pending TX key to be active as well as
    for a passive RX key to be freed which generally helps speed up the key
    switching. It is not expected to be too fast but should not be too slow
    either. Also the key handling logic is simplified that a pending RX key
    will be removed automatically if it is found not working after a number
    of times; the probing for a pending TX key is now carried on a specific
    message user ('LINK_PROTOCOL' or 'LINK_CONFIG') which is more efficient
    than using a timer on broadcast messages, the timer is reserved for use
    later as needed.
    
    The kernel logs or 'pr***()' are now made as clear as possible to user.
    Some prints are added, removed or changed to the debug-level. The
    'TIPC_CRYPTO_DEBUG' definition is removed, and the 'pr_debug()' is used
    instead which will be much helpful in runtime.
    
    Besides we also optimize the code in some other places as a preparation
    for later commits.
    
    v2: silent more kernel logs, also use 'info->extack' for a message
    emitted due to netlink operations instead (- David's comments).
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f779bf79
crypto.c 51.2 KB