Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
dpdk: patch ixgbe driver to solve race condition
[vpp.git]
/
src
/
vnet
/
l2
/
l2_fib.c
diff --git
a/src/vnet/l2/l2_fib.c
b/src/vnet/l2/l2_fib.c
index
b7646ca
..
57325af
100644
(file)
--- a/
src/vnet/l2/l2_fib.c
+++ b/
src/vnet/l2/l2_fib.c
@@
-95,12
+95,13
@@
format_vnet_sw_if_index_name_with_NA (u8 * s, va_list * args)
if (sw_if_index == ~0)
return format (s, "N/A");
if (sw_if_index == ~0)
return format (s, "N/A");
- vnet_sw_interface_t *swif = vnet_get_sw_interface_safe (vnm, sw_if_index);
+ vnet_sw_interface_t *swif =
+ vnet_get_sw_interface_or_null (vnm, sw_if_index);
if (!swif)
return format (s, "Stale");
return format (s, "%U", format_vnet_sw_interface_name, vnm,
if (!swif)
return format (s, "Stale");
return format (s, "%U", format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface_
safe
(vnm, sw_if_index));
+ vnet_get_sw_interface_
or_null
(vnm, sw_if_index));
}
typedef struct l2fib_dump_walk_ctx_t_
}
typedef struct l2fib_dump_walk_ctx_t_
@@
-110,7
+111,7
@@
typedef struct l2fib_dump_walk_ctx_t_
l2fib_entry_result_t *l2fe_res;
} l2fib_dump_walk_ctx_t;
l2fib_entry_result_t *l2fe_res;
} l2fib_dump_walk_ctx_t;
-static
void
+static
int
l2fib_dump_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_dump_walk_ctx_t *ctx = arg;
l2fib_dump_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_dump_walk_ctx_t *ctx = arg;
@@
-125,6
+126,8
@@
l2fib_dump_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
vec_add1 (ctx->l2fe_key, key);
vec_add1 (ctx->l2fe_res, result);
}
vec_add1 (ctx->l2fe_key, key);
vec_add1 (ctx->l2fe_res, result);
}
+
+ return (BIHASH_WALK_CONTINUE);
}
void
}
void
@@
-157,7
+160,7
@@
typedef struct l2fib_show_walk_ctx_t_
u8 now;
} l2fib_show_walk_ctx_t;
u8 now;
} l2fib_show_walk_ctx_t;
-static
void
+static
int
l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_show_walk_ctx_t *ctx = arg;
l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
{
l2fib_show_walk_ctx_t *ctx = arg;
@@
-185,10
+188,10
@@
l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
u8 *s = NULL;
if (ctx->learn && l2fib_entry_result_is_set_AGE_NOT (&result))
u8 *s = NULL;
if (ctx->learn && l2fib_entry_result_is_set_AGE_NOT (&result))
- return
;
/* skip provisioned macs */
+ return
(BIHASH_WALK_CONTINUE);
/* skip provisioned macs */
if (ctx->add && !l2fib_entry_result_is_set_AGE_NOT (&result))
if (ctx->add && !l2fib_entry_result_is_set_AGE_NOT (&result))
- return
;
/* skip learned macs */
+ return
(BIHASH_WALK_CONTINUE);
/* skip learned macs */
bd_config = vec_elt_at_index (l2input_main.bd_configs,
key.fields.bd_index);
bd_config = vec_elt_at_index (l2input_main.bd_configs,
key.fields.bd_index);
@@
-218,6
+221,8
@@
l2fib_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
ctx->vnm, result.fields.sw_if_index);
vec_free (s);
}
ctx->vnm, result.fields.sw_if_index);
vec_free (s);
}
+
+ return (BIHASH_WALK_CONTINUE);
}
/** Display the contents of the l2fib. */
}
/** Display the contents of the l2fib. */
@@
-409,6
+414,7
@@
l2fib_add_entry (const u8 * mac, u32 bd_index,
/* set up key */
key.raw = l2fib_make_key (mac, bd_index);
/* set up key */
key.raw = l2fib_make_key (mac, bd_index);
+ kv.key = key.raw;
/* check if entry already exist */
if (BV (clib_bihash_search) (&fm->mac_table, &kv, &kv))
/* check if entry already exist */
if (BV (clib_bihash_search) (&fm->mac_table, &kv, &kv))
@@
-428,7
+434,6
@@
l2fib_add_entry (const u8 * mac, u32 bd_index,
/* no aging for provisioned entry */
l2fib_entry_result_set_AGE_NOT (&result);
/* no aging for provisioned entry */
l2fib_entry_result_set_AGE_NOT (&result);
- kv.key = key.raw;
kv.value = result.raw;
BV (clib_bihash_add_del) (&fm->mac_table, &kv, 1 /* is_add */ );
kv.value = result.raw;
BV (clib_bihash_add_del) (&fm->mac_table, &kv, 1 /* is_add */ );