On 18 Nov 2026, at 22:57, Tim Rozet via dev wrote:
> Thanks Eelco and Mike for the review. I'll include your comments and
> suggestions in a v4. There were just a couple comments from Eelco I wasn't
> sure about. See inline.
>
> On 10/30/26 12:39 PM, Eelco Chaudron wrote:
[...]
>>> @@ -3811,6 +3812,68 @@ tnl_send_arp_request(struct xlate_ctx *ctx, const
>>> struct xport *out_dev,
>>> dp_packet_uninit(&packet);
>>> }
>>>
>>> +/* Sends all tunnel neighbor refresh requests queued by the cache. */
>>> +void
>>> +xlate_tnl_neigh_refresh(void)
>>> +{
>>> + struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);
>>> + char br_name[IFNAMSIZ], out_dev_name[IFNAMSIZ];
>>> + struct in6_addr dst;
>>> +
>>> + if (!xcfg) {
>>> + return;
>>> + }
>>> +
>>> + while (tnl_neigh_get_refresh(br_name, out_dev_name, &dst)) {
>>> + char dst_s[INET6_ADDRSTRLEN];
>>> + struct in6_addr src;
>>> + struct eth_addr smac;
>>> + struct xport *out_dev = NULL;
>>> + struct xbridge *xbridge = NULL;
>>> + struct xbridge *iter;
>>> + struct xport *port;
>> Variable declarations should be in reverse Christmas tree order.
>>
>>> +
>>> + HMAP_FOR_EACH (iter, hmap_node, &xcfg->xbridges) {
>>> + if (!strcmp(iter->name, br_name)) {
>>> + xbridge = iter;
>>> + break;
>>> + }
>>> + }
>> New line
>>
>>> + if (!xbridge) {
>>> + continue;
>>> + }
>>> +
>>> + ipv6_string_mapped(dst_s, &dst);
>>> + VLOG_DBG("refreshing tunnel neighbor %s on bridge %s",
>>> + dst_s, xbridge->name);
>>> +
>>> + /* Manually inserted entries have no learned IP interface. Select
>>> + * an interface on their bridge that can address this neighbor. */
>>> + HMAP_FOR_EACH (port, ofp_node, &xbridge->xports) {
>>> + const char *name = netdev_get_name(port->netdev);
>>> +
>>> + if ((!out_dev_name[0] || !strncmp(name, out_dev_name,
>>> IFNAMSIZ))
>>> + && !ovs_router_get_netdev_source_address(&dst, name,
>>> &src)) {
>>> + out_dev = port;
>>> + break;
>> If the learned device no longer exists, the refresh silently fails and
>> retries
>> until expiry. Should we consider falling back to scanning all bridge ports,
>> the same as the empty out_dev_name case, so the entry can still be refreshed
>> through an alternative interface.
> I think we need to keep refresh tied to the interface where we learned the
> neighbor. Say br0 has two internal ports, vtep10 on VLAN 10 and vtep20 on
> VLAN 20, both with addresses in 192.0.2.0/24. If we learned 192.0.2.9 through
> vtep10 and that port disappears, a subnet scan could pick vtep20 and send the
> ARP request on VLAN 20. A host using .9 there could answer, and we would
> renew the entry with its MAC.
>
> During initial resolution, the tunnel packet gives us the context to look up
> the route and select the interface. The refresh entry only has the bridge,
> learned interface, and next hop. If the learned interface stays gone, I’d let
> the entry expire and let the next tunnel packet resolve it using the current
> route.
>>
>>> + }
>>> + }
>> New line
>>
>>> + if (!out_dev || netdev_get_etheraddr(out_dev->netdev, &smac)) {
>>> + VLOG_DBG("no output port for tunnel neighbor %s", dst_s);
>>> + continue;
>>> + }
>> Wondering if any of the failures (continues) should delete the entry?
>> Because if it can not be reached, the tunnels should probably fail.
>> Thoughts?
> I’d keep the entry until its original expiry in these cases. If we can’t
> select a source address or find the output port for a refresh, we haven’t
> sent a probe, so we haven’t learned anything new about the neighbor. If the
> failure is transient and the cached MAC is still usable, deleting it early
> could cause us to drop the next tunnel packet while we resolve the neighbor
> again.
>
> A skipped refresh doesn’t extend the entry’s lifetime. We retry while there’s
> time, and if we don’t learn the neighbor again, the entry expires at its
> original deadline. Linux has a similar property for a learned neighbor: it
> keeps the cached MAC usable while probing and marks the neighbor failed once
> the probe attempts are exhausted.
Both comments seem valid, and it makes sense to follow the same approach as
the kernel.
I'll try to set aside some time to review v4, but it might take a bit of time
due to the large upstream backlog (reviews are welcome ;)
//Eelco
>>> +
>>> + COVERAGE_INC(xlate_actions_neigh_sent);
>>> + if (IN6_IS_ADDR_V4MAPPED(&dst)) {
>>> + tnl_send_arp_request(NULL, out_dev, smac,
>>> + in6_addr_get_mapped_ipv4(&src),
>>> + in6_addr_get_mapped_ipv4(&dst));
>>> + } else {C
>>> + tnl_send_nd_request(NULL, out_dev, smac, &src, &dst);
>>> + }
>>> + }
>>> +}
>>> +
[...]
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev