lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 22 Jun 2022 21:44:28 +0300
From:   Constantine Gavrilov <constantine.gavrilov@...il.com>
To:     linux-kernel@...r.kernel.org
Subject: sendfile(), splice() and vmsplice() questions

I would like to clarify the behavior of zero-copy TCP sends with
sendfile() and splice() APIs
Assuming the zero copy socket option is set on a TCP socket, and
application is using a shared memory mapping of /dev/dax device or a
file in /dev/shm or /dev/hugepages, will zero copy be used when:
1. sendile() sends multiple page aligned fragments (4k aligned start
and 4k aligned size)?
2. senifile() sends multiple page aligned fragments(4k aligned start)
but the size is not 4k aligned?
3. sendfile() sends multiple fragments but the first fragment is not
page aligned?
4. If a pipe was populated with vmsplice() without SPLICE_F_GIFT, will
splice() from the pipe to a socket will do zero copy?
5. If a pipe is populated with small buffers (headers) and full pages,
will splice from a pipe to  socket will do zero copy at least on full
pages if the transfer spans both? What if the splice() falls within a
partial page (non-zero offset or size of a fragment less than the page
size)?
6. can vmsplice() populate the pipe with zero copy at least on full
pages, if it is given an iovec of headers and full pages?

And regarding completion semantics:
1. Is it true that splice() and sendfile() on socket will return when
the data is "written" to the socket buffer? If true, is there an
indication in the error queue about "wire" completion (as with
sendmsg() with MSG_ZEROCOPY)?
2. Can I use send() before and after sendfile() and know that the
order of the packets in TCP stream is preserved?

I assume that vmsplice() still does not work on sockets. Was there any
work done to provide an equivalent interface on sockets?

Much thanks for your answers.


-- 
----------------------------------------
Constantine Gavrilov
Storage Architect
Master Inventor
Tel-Aviv IBM Storage Lab
1 Azrieli Center, Tel-Aviv
----------------------------------------

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ