From: Matt Johnston <matt@codeconstruct.com.au>
To: Jeremy Kerr <jk@codeconstruct.com.au>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, Matt Johnston <matt@codeconstruct.com.au>
Subject: [PATCH net-next 0/7] net: mctp: Improved bind handling
Date: Thu, 03 Jul 2025 17:11:47 +0800 [thread overview]
Message-ID: <20250703-mctp-bind-v1-0-bb7e97c24613@codeconstruct.com.au> (raw)
This series improves a couple of aspects of MCTP bind() handling.
MCTP wasn't checking whether the same MCTP type was bound by multiple
sockets. That would result in messages being received by an arbitrary
socket, which isn't useful behaviour. Instead it makes more sense to
have the duplicate binds fail, the same as other network protocols.
An exception is made for more-specific binds to particular MCTP
addresses.
It is also useful to be able to limit a bind to only receive incoming
request messages (MCTP TO bit set) from a specific peer+type, so that
individual processes can communicate with separate MCTP peers. One
example is PLDM firmware update responder, which will initiate
communication with a device, and then the device will connect back to the
responder process.
These limited binds are implemented by a connect() call on the socket
prior to bind. connect() isn't used in the general case for MCTP, since
a plain send() wouldn't provide the required MCTP tag argument for
addressing.
route-test.c will have non-trivial conflicts with Jeremy's in-review
"net: mctp: Add support for gateway routing" series - I'll post an
updated series once that lands.
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
---
Matt Johnston (7):
net: mctp: Prevent duplicate binds
net: mctp: Treat MCTP_NET_ANY specially in bind()
net: mctp: Add test for conflicting bind()s
net: mctp: Use hashtable for binds
net: mctp: Allow limiting binds to a peer address
net: mctp: Test conflicts of connect() with bind()
net: mctp: Add bind lookup test
include/net/mctp.h | 5 +-
include/net/netns/mctp.h | 15 +-
net/mctp/af_mctp.c | 145 +++++++++++++++--
net/mctp/route.c | 80 ++++++++--
net/mctp/test/route-test.c | 391 ++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 606 insertions(+), 30 deletions(-)
---
base-commit: 8b98f34ce1d8c520403362cb785231f9898eb3ff
change-id: 20250321-mctp-bind-e77968f180fd
Best regards,
--
Matt Johnston <matt@codeconstruct.com.au>
next reply other threads:[~2025-07-03 9:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 9:11 Matt Johnston [this message]
2025-07-03 9:11 ` [PATCH net-next 1/7] net: mctp: Prevent duplicate binds Matt Johnston
2025-07-03 9:11 ` [PATCH net-next 2/7] net: mctp: Treat MCTP_NET_ANY specially in bind() Matt Johnston
2025-07-03 9:11 ` [PATCH net-next 3/7] net: mctp: Add test for conflicting bind()s Matt Johnston
2025-07-04 11:55 ` kernel test robot
2025-07-03 9:11 ` [PATCH net-next 4/7] net: mctp: Use hashtable for binds Matt Johnston
2025-07-03 9:11 ` [PATCH net-next 5/7] net: mctp: Allow limiting binds to a peer address Matt Johnston
2025-07-14 19:16 ` Dan Carpenter
2025-07-15 1:13 ` Matt Johnston
2025-07-03 9:11 ` [PATCH net-next 6/7] net: mctp: Test conflicts of connect() with bind() Matt Johnston
2025-07-04 11:01 ` kernel test robot
2025-07-03 9:11 ` [PATCH net-next 7/7] net: mctp: Add bind lookup test Matt Johnston
2025-08-11 11:35 ` Alexandre Ghiti
2025-08-12 5:11 ` Matt Johnston
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250703-mctp-bind-v1-0-bb7e97c24613@codeconstruct.com.au \
--to=matt@codeconstruct.com.au \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).