• Vakul Garg's avatar
    Optimize sk_msg_clone() by data merge to end dst sg entry · fda497e5
    Vakul Garg authored
    Function sk_msg_clone has been modified to merge the data from source sg
    entry to destination sg entry if the cloned data resides in same page
    and is contiguous to the end entry of destination sk_msg. This improves
    kernel tls throughput to the tune of 10%.
    
    When the user space tls application calls sendmsg() with MSG_MORE, it leads
    to calling sk_msg_clone() with new data being cloned placed continuous to
    previously cloned data. Without this optimization, a new SG entry in
    the destination sk_msg i.e. rec->msg_plaintext in tls_clone_plaintext_msg()
    gets used. This leads to exhaustion of sg entries in rec->msg_plaintext
    even before a full 16K of allowable record data is accumulated. Hence we
    lose oppurtunity to encrypt and send a full 16K record.
    
    With this patch, the kernel tls can accumulate full 16K of record data
    irrespective of the size of data passed in sendmsg() with MSG_MORE.
    Signed-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fda497e5
skmsg.c 18.8 KB