mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control
authorMatt Johnston <matt@codeconstruct.com.au>
Wed, 9 Feb 2022 04:05:57 +0000 (12:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Feb 2022 12:00:11 +0000 (12:00 +0000)
commit63ed1aab3d40aa61aaa66819bdce9377ac7f40fa
tree6f239012c2653e6f0d89ef1ac483467e2590a339
parent0de55a7d1133d0ab1acad5d91eea6ccd8cf6d448
mctp: Add SIOCMCTP{ALLOC,DROP}TAG ioctls for tag control

This change adds a couple of new ioctls for mctp sockets:
SIOCMCTPALLOCTAG and SIOCMCTPDROPTAG.  These ioctls provide facilities
for explicit allocation / release of tags, overriding the automatic
allocate-on-send/release-on-reply and timeout behaviours. This allows
userspace more control over messages that may not fit a simple
request/response model.

In order to indicate a pre-allocated tag to the sendmsg() syscall, we
introduce a new flag to the struct sockaddr_mctp.smctp_tag value:
MCTP_TAG_PREALLOC.

Additional changes from Jeremy Kerr <jk@codeconstruct.com.au>.

Contains a fix that was:
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/mctp.rst
include/net/mctp.h
include/trace/events/mctp.h
include/uapi/linux/mctp.h
net/mctp/af_mctp.c
net/mctp/route.c