]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: mctp: Expose transport binding identifier via IFLA attribute
authorKhang Nguyen <khangng@os.amperecomputing.com>
Tue, 5 Nov 2024 07:19:15 +0000 (14:19 +0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 Nov 2024 17:04:54 +0000 (09:04 -0800)
commit580db513b4a9d52f306580015a1872eea0a0894e
tree2d3f737e30bc78418500e95da8bba0ca7204b780
parent4861333b42178fa3d8fd1bb4e2cfb2fedc968dba
net: mctp: Expose transport binding identifier via IFLA attribute

MCTP control protocol implementations are transport binding dependent.
Endpoint discovery is mandatory based on transport binding.
Message timing requirements are specified in each respective transport
binding specification.

However, we currently have no means to get this information from MCTP
links.

Add a IFLA_MCTP_PHYS_BINDING netlink link attribute, which represents
the transport type using the DMTF DSP0239-defined type numbers, returned
as part of RTM_GETLINK data.

We get an IFLA_MCTP_PHYS_BINDING attribute for each MCTP link, for
example:

- 0x00 (unspec) for loopback interface;
- 0x01 (SMBus/I2C) for mctpi2c%d interfaces; and
- 0x05 (serial) for mctpserial%d interfaces.

Signed-off-by: Khang Nguyen <khangng@os.amperecomputing.com>
Reviewed-by: Matt Johnston <matt@codeconstruct.com.au>
Link: https://patch.msgid.link/20241105071915.821871-1-khangng@os.amperecomputing.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mctp/mctp-i2c.c
drivers/net/mctp/mctp-i3c.c
drivers/net/mctp/mctp-serial.c
include/net/mctp.h
include/net/mctpdevice.h
include/uapi/linux/if_link.h
net/mctp/device.c