[ovs-dev] [PATCH] stream-ssl: Avoid unnecessary memory copies on send.

Dumitru Ceara dceara at redhat.com
Mon Nov 29 12:12:17 UTC 2021


On 11/22/21 00:46, Ilya Maximets wrote:
> ssl_send() clones the data before sending, but if SSL_write() succeeds
> at the first attempt, this is only a waste of CPU cycles.
> 
> Trying to send the original buffer instead and only copying remaining
> data if it's not possible to send it all right away.
> 
> This should save a few cycles on every send.
> 
> Note:
> It's probably possible to avoid the copy even if we can't send
> everything at once, but will, likely, require some major change
> of the stream-sll module in order to take into account all the
> corner cases related to SSL connection.  So, not trying to do that
> for now.
> 
> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
> ---

Looks good to me; this passes OVS and OVN unit tests (when
https://patchwork.ozlabs.org/project/openvswitch/list/?series=273948&state=*
is also applied).

Acked-by: Dumitru Ceara <dceara at redhat.com>

Thanks!



More information about the dev mailing list