]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - include/net/mctp.h
mctp: Implement message fragmentation & reassembly
authorJeremy Kerr <jk@codeconstruct.com.au>
Thu, 29 Jul 2021 02:20:50 +0000 (10:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Jul 2021 14:06:50 +0000 (15:06 +0100)
commit4a992bbd365094730a31bae1e12a6ca695336d57
tree2e0fadd843a2f91e068b0340618eaa1f4147f5ca
parent833ef3b91de692ef33b800bca6b1569c39dece74
mctp: Implement message fragmentation & reassembly

This change implements MCTP fragmentation (based on route & device MTU),
and corresponding reassembly.

The MCTP specification only allows for fragmentation on the originating
message endpoint, and reassembly on the destination endpoint -
intermediate nodes do not need to reassemble/refragment.  Consequently,
we only fragment in the local transmit path, and reassemble
locally-bound packets. Messages are required to be in-order, so we
simply cancel reassembly on out-of-order or missing packets.

In the fragmentation path, we just break up the message into MTU-sized
fragments; the skb structure is a simple copy for now, which we can later
improve with a shared data implementation.

For reassembly, we keep track of incoming message fragments using the
existing tag infrastructure, allocating a key on the (src,dest,tag)
tuple, and reassembles matching fragments into a skb->frag_list.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/mctp.h
net/mctp/af_mctp.c
net/mctp/route.c