Skip to content

Commit 0eb0873

Browse files
bloqaudioplappermaul
authored andcommitted
realtek: l3: log route changes at debug level
Every route that is added prints three info lines and every route that is deleted prints two. The printing holds the work queue that programs the routes: with a serial console at 115200 baud, 1800 routes through one gateway take 77 seconds to reach the hardware on RTL9303 and 53 seconds to leave it. Print these lines at debug level, and with them the warning for the addresses the driver never offloads. The same routes are then programmed in 4 seconds and removed in 5 or less. Errors stay where they were. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Quinn O'Shea <qoshea@gmail.com> Link: openwrt/openwrt#25885 Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
1 parent 208f061 commit 0eb0873

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

  • target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx

‎target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c‎

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,11 +2043,11 @@ static void otto_l3_route_update_hw(struct otto_l3_ctrl *ctrl, struct otto_l3_ro
20432043
r->nh.port == priv->r->port_ignore;
20442044
if ((no_port || no_l2) && (first || !trapped)) {
20452045
if (r->attr.type == ROUTE_TYPE_IP4UC)
2046-
dev_info(ctrl->dev, "no port for %pI4, routing %s in software\n",
2047-
&r->gw_ip.s6_addr32[3], otto_l3_route_dst(r, dst, sizeof(dst)));
2046+
dev_dbg(ctrl->dev, "no port for %pI4, routing %s in software\n",
2047+
&r->gw_ip.s6_addr32[3], otto_l3_route_dst(r, dst, sizeof(dst)));
20482048
else
2049-
dev_info(ctrl->dev, "no port for %pI6c, routing %s in software\n",
2050-
&r->gw_ip, otto_l3_route_dst(r, dst, sizeof(dst)));
2049+
dev_dbg(ctrl->dev, "no port for %pI6c, routing %s in software\n",
2050+
&r->gw_ip, otto_l3_route_dst(r, dst, sizeof(dst)));
20512051
}
20522052

20532053
trap = no_port || no_l2 || otto_l3_fwd_off(ctrl, r->attr.type) ||
@@ -2073,7 +2073,7 @@ static void otto_l3_route_update_hw(struct otto_l3_ctrl *ctrl, struct otto_l3_ro
20732073
if (!ctrl->cfg->use_l3_tables && r->pr.packet_cntr < 0) {
20742074
r->pr.packet_cntr = otto_stats_packet_cntr_alloc(priv);
20752075
if (r->pr.packet_cntr >= 0)
2076-
dev_info(ctrl->dev, "Using packet counter %d\n", r->pr.packet_cntr);
2076+
dev_dbg(ctrl->dev, "Using packet counter %d\n", r->pr.packet_cntr);
20772077
}
20782078

20792079
otto_l3_route_install(ctrl, r);
@@ -2111,11 +2111,11 @@ static void otto_l3_route_trap_hw(struct otto_l3_ctrl *ctrl, struct otto_l3_rout
21112111
return;
21122112

21132113
if (r->attr.type == ROUTE_TYPE_IP4UC)
2114-
dev_info(ctrl->dev, "no valid neighbour for %pI4, routing %s in software\n",
2115-
&r->gw_ip.s6_addr32[3], otto_l3_route_dst(r, dst, sizeof(dst)));
2114+
dev_dbg(ctrl->dev, "no valid neighbour for %pI4, routing %s in software\n",
2115+
&r->gw_ip.s6_addr32[3], otto_l3_route_dst(r, dst, sizeof(dst)));
21162116
else
2117-
dev_info(ctrl->dev, "no valid neighbour for %pI6c, routing %s in software\n",
2118-
&r->gw_ip, otto_l3_route_dst(r, dst, sizeof(dst)));
2117+
dev_dbg(ctrl->dev, "no valid neighbour for %pI6c, routing %s in software\n",
2118+
&r->gw_ip, otto_l3_route_dst(r, dst, sizeof(dst)));
21192119

21202120
otto_l3_route_rewrite(ctrl, r);
21212121
}
@@ -2218,11 +2218,11 @@ static int otto_l3_port_gw_resolve(struct otto_l3_ctrl *ctrl, struct otto_l3_rou
22182218
read_lock_bh(&n->lock);
22192219
mac = ether_addr_to_u64(n->ha);
22202220
read_unlock_bh(&n->lock);
2221-
dev_info(ctrl->dev, "resolved mac: %016llx\n", mac);
2221+
dev_dbg(ctrl->dev, "resolved mac: %016llx\n", mac);
22222222
otto_l3_route_update_hw(ctrl, r, mac);
22232223
otto_l3_fib6_flags_report(r);
22242224
} else {
2225-
dev_info(ctrl->dev, "need to wait\n");
2225+
dev_dbg(ctrl->dev, "need to wait\n");
22262226
neigh_event_send(n, NULL);
22272227
}
22282228

@@ -2723,12 +2723,12 @@ static int otto_l3_fib_check_v4(struct otto_l3_ctrl *ctrl,
27232723
if (nh->fib_nh_gw4)
27242724
snprintf(gw_message, sizeof(gw_message), "via %pI4 ", &nh->fib_nh_gw4);
27252725

2726-
dev_info(ctrl->dev, "%s IPv4 route %pI4/%d %s(VLAN %d, MAC %pM)\n",
2727-
event == FIB_EVENT_ENTRY_ADD ? "add" : "delete",
2728-
&info->dst, info->dst_len, gw_message, vlan, ndev->dev_addr);
2726+
dev_dbg(ctrl->dev, "%s IPv4 route %pI4/%d %s(VLAN %d, MAC %pM)\n",
2727+
event == FIB_EVENT_ENTRY_ADD ? "add" : "delete",
2728+
&info->dst, info->dst_len, gw_message, vlan, ndev->dev_addr);
27292729

27302730
if ((info->type == RTN_BROADCAST) || ipv4_is_loopback(info->dst) || !info->dst) {
2731-
dev_warn(ctrl->dev, "skip loopback/broadcast addresses and default routes\n");
2731+
dev_dbg(ctrl->dev, "skip loopback/broadcast addresses and default routes\n");
27322732
return -EINVAL;
27332733
}
27342734

@@ -2883,7 +2883,7 @@ static int otto_l3_fib_add_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi
28832883
ROUTE_HOST : ROUTE_PREFIX);
28842884

28852885
if (route)
2886-
dev_info(ctrl->dev, "route allocated for gw %pI4\n", &nh->fib_nh_gw4);
2886+
dev_dbg(ctrl->dev, "route allocated for gw %pI4\n", &nh->fib_nh_gw4);
28872887
else {
28882888
dev_err(ctrl->dev, "could not allocate a route for gw %pI4\n",
28892889
&nh->fib_nh_gw4);
@@ -2997,8 +2997,8 @@ static int otto_l3_fib_del_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi
29972997
&info->dst, info->dst_len, &nh->fib_nh_gw4);
29982998
return -ENOENT;
29992999
}
3000-
dev_info(ctrl->dev, "found a route with id %d, nh-id %d\n",
3001-
route->id, route->nh.id);
3000+
dev_dbg(ctrl->dev, "found a route with id %d, nh-id %d\n",
3001+
route->id, route->nh.id);
30023002

30033003
otto_l3_route_teardown(ctrl, route);
30043004

@@ -3011,10 +3011,6 @@ static int otto_l3_fib_del_v4(struct otto_l3_ctrl *ctrl, struct fib_entry_notifi
30113011
* next hop array is not allocated behind it at all, so nothing that reads
30123012
* one may run before the object itself has been ruled out.
30133013
*
3014-
* The IPv4 twin of this narrates every event at info level. IPv6 routes
3015-
* arrive in numbers IPv4 ones do not - every router advertisement brings
3016-
* some - so this one speaks at debug level instead.
3017-
*
30183014
* The members are the ones the notifier counted. The route's own sibling
30193015
* count is read later, and a member deleted in between has had it cleared,
30203016
* so it would pass for a route of its own.

0 commit comments

Comments
 (0)