Comments (3)
I think the best approach would be to:
- extend
tcp_read_sock()
with MSG_PEEK flag - introduce
udp_read_sock()
with MSG_PEEK support for UDP
Using directly skbuffs is not nice, since there should be appropriate operations on UDP/TCP sockets to encapsulate such logic (and make it possible to reuse these operations in other parts of the kernel).
from af_ktls.
When run "splice echo time" scenario for 2 seconds a simple ping-pong with server [1]:
splice(ksd, NULL, pipe, NULL, 1400, 0);
splice(pie, NULL, ksd, NULL, 1400, 0);
With MTU 1400:
I am getting following results:
- 44.24% of total time spent in
kernel_sendmsg()
- 38.28% of total time spent in
tcp_push
- on actual sending - 1.15% of total time spent in allocation socket buffers
skb_stream_alloc_skb
- cca 2% on copy from kernel vector (
copy_from_iter
,memcpy_erms
)
- 38.28% of total time spent in
- 33.14% of total time spent in
tls_splice_read
- 13.14% of total time spent in
kernel_recvmsg
- cca 2% on copy and allocation (
skb_copy_datagram_iter
,copy_page_to_iter
)
- 13.14% of total time spent in
With MTU 16000:
I am getting following results:
- 22.29% of total time spent in
kernel_sendmsg()
- 16.30% of total time spent in
tcp_push
- on actual sending - 0.69% of total time spent in allocation socket buffers
skb_stream_alloc_skb
- 3.03% on copy from kernel vector (
copy_from_iter
,memcpy_erms
)
- 16.30% of total time spent in
- 42.25% of total time spent in
tls_splice_read
- 9.02% of total time spent in
kernel_recvmsg
- 4.02 % on copy and allocation (
skb_copy_datagram_iter
,copy_page_to_iter
)
- 9.02% of total time spent in
Ideally we could save:
- for 1400 MTU:
- cca 2% by avoiding
kernel_recvmsg()
- cca 3.15% by avoiding
kernel_sendmsg()
- cca 2% by avoiding
- for 16000 MTU:
- 3.72% by avoiding
kernel_sendmsg()
- 4.02% by avoiding
kernel_recvmsg()
- 3.72% by avoiding
We have to consider addional logic within kernel_sendmsg()
and kernel_recvmsg()
(locking, ...). Using kernel_sendpage()
and tcp_read_sock()
(udp_read_sock()
) can have different logic which could have positive/negative impact as well.
perf
reporting context switches not expensive at all (0.30% of total)
related: https://github.com/fridex/af_ktls/issues/22
[1] https://github.com/fridex/af_ktls-tool/blob/master/action.c#L795
from af_ktls.
fixed by #62
from af_ktls.
Related Issues (20)
- Test suite HOT 6
- new ciphersuite: chacha20-poly1305 HOT 1
- license is GPLv3
- Copy data from multiple TLS records to userspace buffer HOT 9
- Buffer changes HOT 6
- kernel fault when decrypting to user buffer HOT 7
- Crypto API scatterwalk copy HOT 2
- MTU handling HOT 8
- Allocating too many pages HOT 1
- Sleeping with lock held HOT 1
- possible lock inversion surrounding splice HOT 2
- Remove rx async work HOT 6
- Race condition in KTLS_RECV_READY HOT 2
- peek tcp data using tcp_read_sock HOT 2
- check sock_queue_rcv_skb return value HOT 4
- DTLS sliding window should always advance
- Investigate using a single FD
- DTLS window check needs to happen after decrypt
- Support async crypto API
- Paper might also wish to cite Plan 9's devtls as related work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from af_ktls.