• Jakub Kicinski's avatar
    net/tls: add kernel-driven resync mechanism for TX · 50180074
    Jakub Kicinski authored
    TLS offload drivers keep track of TCP seq numbers to make sure
    the packets are fed into the HW in order.
    
    When packets get dropped on the way through the stack, the driver
    will get out of sync and have to use fallback encryption, but unless
    TCP seq number is resynced it will never match the packets correctly
    (or even worse - use incorrect record sequence number after TCP seq
    wraps).
    
    Existing drivers (mlx5) feed the entire record on every out-of-order
    event, allowing FW/HW to always be in sync.
    
    This patch adds an alternative, more akin to the RX resync.  When
    driver sees a frame which is past its expected sequence number the
    stream must have gotten out of order (if the sequence number is
    smaller than expected its likely a retransmission which doesn't
    require resync).  Driver will ask the stack to perform TX sync
    before it submits the next full record, and fall back to software
    crypto until stack has performed the sync.
    Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    50180074
tls.h 18.1 KB