• Tariq Toukan's avatar
    net/bonding: Implement TLS TX device offload · 89df6a81
    Tariq Toukan authored
    Implement TLS TX device offload for bonding interfaces.
    This allows kTLS sockets running on a bond to benefit from the
    device offload on capable lower devices.
    
    To allow a simple and fast maintenance of the TLS context in SW and
    lower devices, we bind the TLS socket to a specific lower dev.
    To achieve a behavior similar to SW kTLS, we support only balance-xor
    and 802.3ad modes, with xmit_hash_policy=layer3+4. This is enforced
    in bond_sk_check(), done in a previous patch.
    
    For the above configuration, the SW implementation keeps picking the
    same exact lower dev for all the socket's SKBs. The device offload
    behaves similarly, making the decision once at the connection creation.
    
    Per socket, the TLS module should work directly with the lowest netdev
    in chain, to call the tls_dev_ops operations.
    
    As the bond interface is being bypassed by the TLS module, interacting
    directly against the lower devs, there is no way for the bond interface
    to disable its device offload capabilities, as long as the mode/policy
    config allows it.
    Hence, the feature flag is not directly controllable, but just reflects
    the current offload status based on the logic under bond_sk_check().
    Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
    Reviewed-by: default avatarBoris Pismenny <borisp@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    89df6a81
bond_options.c 42.8 KB