[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aAnz4J1CkoLw518t@shredder>
Date: Thu, 24 Apr 2025 11:18:40 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
edumazet@...gle.com, andrew+netdev@...n.ch, horms@...nel.org,
petrm@...dia.com, razor@...ckwall.org
Subject: Re: [PATCH net-next 13/15] vxlan: Do not treat dst cache
initialization errors as fatal
On Tue, Apr 22, 2025 at 10:49:12AM +0200, Paolo Abeni wrote:
> Note for a possible follow-up: AFAICS, when the allocation fail the
> user-space will have no way to detect it, except for slow down on tx
> using this specific FDB entry, which could be surprising/hard to debug
> or investigate. What about adding an explicit pr_info() message here?
Are you OK with [1]? Using ratelimited() variant as allocation can
be triggered from the data path. Example output:
vxlan: vx1: Failed to initialize dst cache for {00:00:00:0d:02:4f, 10010} -> 198.51.100.20. Tx performance might be degraded
[1]
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index a56d7239b127..a042d69b3f55 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -569,7 +569,7 @@ static int vxlan_fdb_replace(struct vxlan_fdb *f,
}
/* Add/update destinations for multicast */
-static int vxlan_fdb_append(struct vxlan_fdb *f,
+static int vxlan_fdb_append(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
union vxlan_addr *ip, __be16 port, __be32 vni,
__u32 ifindex, struct vxlan_rdst **rdp)
{
@@ -586,7 +586,10 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
/* The driver can work correctly without a dst cache, so do not treat
* dst cache initialization errors as fatal.
*/
- dst_cache_init(&rd->dst_cache, GFP_ATOMIC | __GFP_NOWARN);
+ if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC | __GFP_NOWARN))
+ net_info_ratelimited("%s: Failed to initialize dst cache for {%pM, %u} -> %pISc. Tx performance might be degraded\n",
+ netdev_name(vxlan->dev), &f->key.eth_addr,
+ __be32_to_cpu(f->key.vni), &ip->sa);
rd->remote_ip = *ip;
rd->remote_port = port;
@@ -875,7 +878,7 @@ int vxlan_fdb_create(struct vxlan_dev *vxlan,
if (nhid)
rc = vxlan_fdb_nh_update(vxlan, f, nhid, extack);
else
- rc = vxlan_fdb_append(f, ip, port, vni, ifindex, &rd);
+ rc = vxlan_fdb_append(vxlan, f, ip, port, vni, ifindex, &rd);
if (rc < 0)
goto errout;
@@ -1028,7 +1031,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
if ((flags & NLM_F_APPEND) &&
(is_multicast_ether_addr(f->key.eth_addr) ||
is_zero_ether_addr(f->key.eth_addr))) {
- rc = vxlan_fdb_append(f, ip, port, vni, ifindex, &rd);
+ rc = vxlan_fdb_append(vxlan, f, ip, port, vni, ifindex, &rd);
if (rc < 0)
return rc;
Powered by blists - more mailing lists