Skip to content

Commit 0b8d6da

Browse files
committed
Log which loadbalancer already exists when adding fails
1 parent c239f1a commit 0b8d6da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/dp_lb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ int dp_create_lb(struct dpgrpc_lb *lb, const union dp_ipv6 *ul_ip)
7171
lb_key.vni = lb->vni;
7272
dp_copy_ipaddr(&lb_key.ip, &lb->addr);
7373

74-
if (DP_SUCCESS(rte_hash_lookup(lb_table, &lb_key)))
74+
if (DP_SUCCESS(rte_hash_lookup_data(lb_table, &lb_key, (void **)&lb_val))) {
75+
DPS_LOG_WARNING("Loadbalancer for this IP already exists",
76+
DP_LOG_IPV4(lb->addr.ipv4), DP_LOG_VNI(lb->vni), DP_LOG_LBID(lb_val->lb_id));
7577
return DP_GRPC_ERR_ALREADY_EXISTS;
78+
}
7679

7780
lb_val = rte_zmalloc("lb_val", sizeof(struct lb_value), RTE_CACHE_LINE_SIZE);
7881
if (!lb_val)

0 commit comments

Comments
 (0)