]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Introduce TCP ULP support
authorTony Lu <tonylu@linux.alibaba.com>
Tue, 28 Dec 2021 13:44:36 +0000 (21:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Jan 2022 12:09:18 +0000 (12:09 +0000)
commit2e61239a750f7bd5b94bf307b34e15b899a74d1d
tree98eaa0b47dc43a1f0b279b272b478fc3e3d38c04
parent511b355cfb58fc468eb56f6d19e9306790983932
net/smc: Introduce TCP ULP support

This implements TCP ULP for SMC, helps applications to replace TCP with
SMC protocol in place. And we use it to implement transparent
replacement.

This replaces original TCP sockets with SMC, reuse TCP as clcsock when
calling setsockopt with TCP_ULP option, and without any overhead.

To replace TCP sockets with SMC, there are two approaches:

- use setsockopt() syscall with TCP_ULP option, if error, it would
  fallback to TCP.

- use BPF prog with types BPF_CGROUP_INET_SOCK_CREATE or others to
  replace transparently. BPF hooks some points in create socket, bind
  and others, users can inject their BPF logics without modifying their
  applications, and choose which connections should be replaced with SMC
  by calling setsockopt() in BPF prog, based on rules, such as TCP tuples,
  PID, cgroup, etc...

  BPF doesn't support calling setsockopt with TCP_ULP now, I will send the
  patches after this accepted.

Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c