• Ziyang Xuan's avatar
    net/tls: optimize judgement processes in tls_set_device_offload() · b1a6f56b
    Ziyang Xuan authored
    It is known that priority setting HW offload when set tls TX/RX offload
    by setsockopt(). Check netdevice whether support NETIF_F_HW_TLS_TX or
    not at the later stages in the whole tls_set_device_offload() process,
    some memory allocations have been done before that. We must release those
    memory and return error if we judge the netdevice not support
    NETIF_F_HW_TLS_TX. It is redundant.
    
    Move NETIF_F_HW_TLS_TX judgement forward, and move start_marker_record
    and offload_ctx memory allocation back slightly. Thus, we can get
    simpler exception handling process.
    Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    b1a6f56b
tls_device.c 35.8 KB