OSDN Git Service

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)
commitd7cd421da9da2cc7b4d25b8537f66db5c8331c40
tree98eaa0b47dc43a1f0b279b272b478fc3e3d38c04
parentab6dd952b2d044d04a9906a997d16f1e6e4db48d
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