netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Matt Johnston <matt@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
Subject: [PATCH net-next 00/13] net: mctp: Add support for gateway routing
Date: Wed, 11 Jun 2025 14:30:27 +0800	[thread overview]
Message-ID: <20250611-dev-forwarding-v1-0-6b69b1feb37f@codeconstruct.com.au> (raw)

This series adds a gatweay route type for the MCTP core, allowing
non-local EIDs as the match for a route.

Example setup using the mctp tools:

    mctp route add 9 via mctpi2c0
    mctp neigh add 9 dev mctpi2c0 lladdr 0x1d
    mctp route add 10 gw 9

- will route packets to eid 10 through mctpi2c0, using a dest lladdr
of 0x1d (ie, that of the directly-attached eid 9).

The core change to support this is the introduction of a struct
mctp_dst, which represents the result of a route lookup. Since this
involves a bit of surgery through the routing code, we add a few tests
along the way.

We're introducing an ABI change in the new RTM_{NEW,GET,DEL}ROUTE
netlink formats, with the support for a RTA_GATEWAY attribute. Because
we need a network ID specified to fully-qualify a gateway EID, the
RTA_GATEWAY attribute carries the (net, eid) tuple in full:

    struct mctp_fq_addr {
        unsigned int net;
        mctp_eid_t eid;
    }

Of course, any questions, comments etc are most welcome.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
Jeremy Kerr (13):
      net: mctp: don't use source cb data when forwarding, ensure pkt_type is set
      net: mctp: separate routing database from routing operations
      net: mctp: separate cb from direct-addressing routing
      net: mctp: test: Add an addressed device constructor
      net: mctp: test: Add extaddr routing output test
      net: mctp: test: move functions into utils.[ch]
      net: mctp: test: add sock test infrastructure
      net: mctp: test: Add initial socket tests
      net: mctp: pass net into route creation
      net: mctp: remove routes by netid, not by device
      net: mctp: allow NL parsing directly into a struct mctp_route
      net: mctp: add gateway routing support
      net: mctp: test: Add tests for gateway routes

 include/net/mctp.h         |  52 +++-
 include/uapi/linux/mctp.h  |   8 +
 net/mctp/af_mctp.c         |  62 ++---
 net/mctp/route.c           | 563 ++++++++++++++++++++++++++++--------------
 net/mctp/test/route-test.c | 604 +++++++++++++++++++++++++++++----------------
 net/mctp/test/sock-test.c  | 229 +++++++++++++++++
 net/mctp/test/utils.c      | 196 ++++++++++++++-
 net/mctp/test/utils.h      |  44 ++++
 8 files changed, 1307 insertions(+), 451 deletions(-)
---
base-commit: 0097c4195b1d0ca57d15979626c769c74747b5a0
change-id: 20250520-dev-forwarding-0711973470bf

Best regards,
-- 
Jeremy Kerr <jk@codeconstruct.com.au>


             reply	other threads:[~2025-06-11  6:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11  6:30 Jeremy Kerr [this message]
2025-06-11  6:30 ` [PATCH net-next 01/13] net: mctp: don't use source cb data when forwarding, ensure pkt_type is set Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 02/13] net: mctp: separate routing database from routing operations Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 03/13] net: mctp: separate cb from direct-addressing routing Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 04/13] net: mctp: test: Add an addressed device constructor Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 05/13] net: mctp: test: Add extaddr routing output test Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 06/13] net: mctp: test: move functions into utils.[ch] Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 07/13] net: mctp: test: add sock test infrastructure Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 08/13] net: mctp: test: Add initial socket tests Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 09/13] net: mctp: pass net into route creation Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 10/13] net: mctp: remove routes by netid, not by device Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 11/13] net: mctp: allow NL parsing directly into a struct mctp_route Jeremy Kerr
2025-06-11  6:30 ` [PATCH net-next 12/13] net: mctp: add gateway routing support Jeremy Kerr
2025-06-13 17:11   ` Simon Horman
2025-06-18 17:26   ` Dan Carpenter
2025-06-11  6:30 ` [PATCH net-next 13/13] net: mctp: test: Add tests for gateway routes Jeremy Kerr
2025-06-12  8:56   ` kernel test robot

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=20250611-dev-forwarding-v1-0-6b69b1feb37f@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=matt@codeconstruct.com.au \
    --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).