History

net/tcp: Allow asynchronous delete for TCP-AO keys (MKTs)

Delete becomes very, very fast - almost free, but after setsockopt() syscall returns, the key is still alive until next RCU grace period. Which is fine for listen sockets as userspace needs to be aware of setsockopt(TCP_AO) and accept() race and resolve it with verification by getsockopt() after TCP connection was accepted. The benchmark results (on non-loaded box, worse with more RCU work pending): > ok 33 Worst case delete 16384 keys: min=5ms max=10ms mean=6.93904ms stddev=0.263421 > ok 34 Add a new key 16384 keys: min=1ms max=4ms mean=2.17751ms stddev=0.147564 > ok 35 Remove random-search 16384 keys: min=5ms max=10ms mean=6.50243ms stddev=0.254999 > ok 36 Remove async 16384 keys: min=0ms max=0ms mean=0.0296107ms stddev=0.0172078

Dmitry Safonov committed 3 years ago

Commit d6732b91 parent ef847032 files · +20 −4Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/tcp.h+2−1
@@ -396,7 +396,8 @@ struct tcp_ao_del { /* setsockopt(TCP_AO_DEL_KEY) */ · 395 unmodified lines
396 __s32 ifindex; /* L3 dev index for VRF */396 __s32 ifindex; /* L3 dev index for VRF */
397 __u32 set_current :1, /* corresponding ::current_key */397 __u32 set_current :1, /* corresponding ::current_key */
398 set_rnext :1, /* corresponding ::rnext */398 set_rnext :1, /* corresponding ::rnext */
399 reserved :30; /* must be 0 */399 del_async :1, /* only valid for listen sockets */
400 reserved :29; /* must be 0 */
400 __u16 reserved2; /* padding, must be 0 */401 __u16 reserved2; /* padding, must be 0 */
401 __u8 prefix; /* peer's address prefix */402 __u8 prefix; /* peer's address prefix */
402 __u8 sndid; /* SendID for outgoing segments */403 __u8 sndid; /* SendID for outgoing segments */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t