From: Ido Schimmel <idosch@nvidia.com>
To: Jack Ma <jack4it@hotmail.com>
Cc: David Ahern <dsahern@kernel.org>, Roopa Prabhu <roopa@nvidia.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>
Subject: Re: VXLAN FDB nexthop groups: per-nexthop UDP dst port / VNI feasibility
Date: Thu, 9 Jul 2026 13:22:47 +0300 [thread overview]
Message-ID: <20260709102247.GA1536940@shredder> (raw)
In-Reply-To: <BL3PR17MB60675DF2E8769ABDA85CCE74E5FF2@BL3PR17MB6067.namprd17.prod.outlook.com>
Please use plain text instead of HTML. Otherwise your emails won't make
it to the list.
On Wed, Jul 08, 2026 at 05:52:05AM +0000, Jack Ma wrote:
> Hi David, Ido, Roopa,
> I am using VXLAN FDB nexthop groups (ip nexthop add ... fdb, then
> bridge fdb add ... nhid) to do L2 ECMP across a set of HA endpoints.
> In my design each leg is a distinct (VTEP IP, UDP destination port)
> pair: several endpoints live behind the same node IP and are
> disambiguated by the VXLAN UDP destination port.
> Reading the current code (v6.12), it looks like an FDB nexthop can
> only carry a gateway IP, so a per-leg port cannot be expressed:
> * vxlan_fdb_nh_path_select() copies only nhc_gw into the synthetic
> rdst; remote_port and remote_vni stay zero
> (include/net/vxlan.h).
> * vxlan_xmit_one() then falls back to the device-wide port:
> dst_port = rdst->remote_port ? rdst->remote_port
> : vxlan->cfg.dst_port
> (drivers/net/vxlan/vxlan_core.c).
> * rtm_to_nh_config() rejects NHA_ENCAP and NHA_OIF on fdb nexthops
> ("Fdb attribute can not be used with encap, oif or blackhole",
> net/ipv4/nexthop.c).
> * vxlan_fdb_parse() rejects NDA_PORT / NDA_VNI / NDA_IFINDEX when
> NDA_NH_ID is present ("DST, VNI, ifindex and port are mutually
> exclusive with NH_ID").
> The original commits (38428d68719c "nexthop: support for fdb ecmp
> nexthops" and 1274e1cc4226 "vxlan: ecmp support for mac fdb entries")
> say "these nexthops only have ip", which matches the EVPN multihoming
> use case where every VTEP in the segment shares one UDP destination
> port.
> My questions:
> 1. Was IP-only a deliberate scoping decision for the EVPN-MH use
> case, or is there a deeper reason a per-nexthop UDP destination
> port (and VNI) could not be carried on an fdb nexthop, for
> example via NHA_ENCAP / lwtunnel, which route nexthops already
> accept?
IP-only was specific for EVPN-MH and it simply reuses the gateway IP
that is already present in the nexthop structure.
> 2. If legs genuinely need distinct UDP destination ports, is the
> per-remote rdst path (bridge fdb ... dst ... port ...) the
> intended mechanism, with the understanding that it gives
> head-end replication semantics rather than nexthop-object ECMP?
Yes, but you will get packet replication instead of load balancing,
which I believe is not what you want.
> 3. Would you be open in principle to a patch that lets an fdb
> nexthop carry a per-nexthop dst port (and VNI)? If so I am happy
> to prototype it as an RFC.
I have some questions for you before I answer yours.
Can you explain why different VTEPs need to share a single IP? With
different IPs you can simply reuse the existing FDB nexthops without any
changes.
In addition, why disambiguate by the VXLAN UDP destination port and not
VNI? Even if we allow attaching tunnel encapsulation to FDB nexthops via
NHA_ENCAP, there does not seem to be uAPI in place to encode the
destination port (see ip_tun_policy).
Assuming you can live with a fixed port, I think you can achieve what
you want with BPF and no kernel changes. You can call
bpf_skb_set_tunnel_key [1] from a TC bpf program attached to the egress
of the VXLAN device (configured in "external" mode) and have it encode
the relevant VTEP based on the calculated hash.
[1] https://docs.ebpf.io/linux/helper-function/bpf_skb_set_tunnel_key/
next parent reply other threads:[~2026-07-09 10:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BL3PR17MB60675DF2E8769ABDA85CCE74E5FF2@BL3PR17MB6067.namprd17.prod.outlook.com>
2026-07-09 10:22 ` Ido Schimmel [this message]
2026-07-10 5:30 VXLAN FDB nexthop groups: per-nexthop UDP dst port / VNI feasibility Jack Ma
2026-07-11 17:26 ` David Ahern
2026-07-12 7:05 ` Ido Schimmel
2026-07-12 20:46 ` Jack Ma
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=20260709102247.GA1536940@shredder \
--to=idosch@nvidia.com \
--cc=dsahern@kernel.org \
--cc=jack4it@hotmail.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.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