summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-05-16 15:01:34 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-05-22 09:43:49 +0000
commit233e4681830bc2a9cd40deb4b5909b4e310d1a2a (patch)
tree495c36ffbafdfaf8c85672024e2162ea8ee923ac /src/vnet
parenta29d18ae6bb7cda3923693a052c3b9208588be8e (diff)
stats: support multiple works for error counters
The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/interface_api.c16
-rw-r--r--src/vnet/ip/ip_api.c24
-rw-r--r--src/vnet/mpls/mpls_api.c7
-rw-r--r--src/vnet/pg/pg_api.c3
4 files changed, 0 insertions, 50 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 1b913823708..a91936f72de 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -392,18 +392,6 @@ done:
REPLY_MACRO (VL_API_SW_INTERFACE_ADD_DEL_ADDRESS_REPLY);
}
-void stats_dslock_with_hint (int hint, int tag) __attribute__ ((weak));
-void
-stats_dslock_with_hint (int hint, int tag)
-{
-}
-
-void stats_dsunlock (void) __attribute__ ((weak));
-void
-stats_dsunlock (void)
-{
-}
-
static void
vl_api_sw_interface_set_table_t_handler (vl_api_sw_interface_set_table_t * mp)
{
@@ -414,15 +402,11 @@ vl_api_sw_interface_set_table_t_handler (vl_api_sw_interface_set_table_t * mp)
VALIDATE_SW_IF_INDEX (mp);
- stats_dslock_with_hint (1 /* release hint */ , 4 /* tag */ );
-
if (mp->is_ipv6)
rv = ip_table_bind (FIB_PROTOCOL_IP6, sw_if_index, table_id, 1);
else
rv = ip_table_bind (FIB_PROTOCOL_IP4, sw_if_index, table_id, 1);
- stats_dsunlock ();
-
BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_SW_INTERFACE_SET_TABLE_REPLY);
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index 5a6053d1f42..f4e5d1776bd 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -119,9 +119,6 @@ _(IP_REASSEMBLY_ENABLE_DISABLE, ip_reassembly_enable_disable) \
_(IP_PUNT_REDIRECT_DUMP, ip_punt_redirect_dump)
-extern void stats_dslock_with_hint (int hint, int tag);
-extern void stats_dsunlock (void);
-
static vl_api_ip_neighbor_flags_t
ip_neighbor_flags_encode (ip_neighbor_flags_t f)
{
@@ -704,8 +701,6 @@ vl_api_ip_neighbor_add_del_t_handler (vl_api_ip_neighbor_add_del_t * mp,
VALIDATE_SW_IF_INDEX ((&mp->neighbor));
- stats_dslock_with_hint (1 /* release hint */ , 7 /* tag */ );
-
flags = ip_neighbor_flags_decode (mp->neighbor.flags);
type = ip_address_decode (&mp->neighbor.ip_address, &ip);
mac_address_decode (mp->neighbor.mac_address, &mac);
@@ -722,8 +717,6 @@ vl_api_ip_neighbor_add_del_t_handler (vl_api_ip_neighbor_add_del_t * mp,
else
rv = ip_neighbor_del (&ip, type, ntohl (mp->neighbor.sw_if_index));
- stats_dsunlock ();
-
BAD_SW_IF_INDEX_LABEL;
/* *INDENT-OFF* */
@@ -879,8 +872,6 @@ add_del_route_t_handler (u8 is_multipath,
path.frp_flags = path_flags;
- stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
-
if (is_drop || (is_local && (~0 == next_hop_sw_if_index)) ||
is_classify || is_unreach || is_prohibit)
{
@@ -910,7 +901,6 @@ add_del_route_t_handler (u8 is_multipath,
if (pool_is_free_index (cm->tables,
ntohl (classify_table_index)))
{
- stats_dsunlock ();
return VNET_API_ERROR_NO_SUCH_TABLE;
}
@@ -920,7 +910,6 @@ add_del_route_t_handler (u8 is_multipath,
}
else
{
- stats_dsunlock ();
return VNET_API_ERROR_NO_SUCH_TABLE;
}
@@ -964,7 +953,6 @@ add_del_route_t_handler (u8 is_multipath,
}
}
- stats_dsunlock ();
return (0);
}
@@ -1271,8 +1259,6 @@ mroute_add_del_handler (u8 is_add,
{
fib_node_index_t mfib_entry_index = ~0;
- stats_dslock_with_hint (1 /* release hint */ , 2 /* tag */ );
-
fib_route_path_t path = {
.frp_sw_if_index = next_hop_sw_if_index,
.frp_proto = nh_proto,
@@ -1308,7 +1294,6 @@ mroute_add_del_handler (u8 is_add,
}
done:
- stats_dsunlock ();
return (mfib_entry_index);
}
@@ -2969,8 +2954,6 @@ vl_api_proxy_arp_add_del_t_handler (vl_api_proxy_arp_add_del_t * mp)
u32 fib_index;
int rv;
- stats_dslock_with_hint (1 /* release hint */ , 6 /* tag */ );
-
fib_index = fib_table_find (FIB_PROTOCOL_IP4, ntohl (mp->proxy.table_id));
if (~0 == fib_index)
@@ -2985,7 +2968,6 @@ vl_api_proxy_arp_add_del_t_handler (vl_api_proxy_arp_add_del_t * mp)
rv = vnet_proxy_arp_add_del (&lo, &hi, fib_index, mp->is_add == 0);
out:
- stats_dsunlock ();
REPLY_MACRO (VL_API_PROXY_ARP_ADD_DEL_REPLY);
}
@@ -3166,8 +3148,6 @@ ip4_reset_fib_t_handler (vl_api_reset_fib_t * mp)
int rv = VNET_API_ERROR_NO_SUCH_FIB;
u32 target_fib_id = ntohl (mp->vrf_id);
- stats_dslock_with_hint (1 /* release hint */ , 8 /* tag */ );
-
/* *INDENT-OFF* */
pool_foreach (fib_table, im4->fibs,
({
@@ -3215,7 +3195,6 @@ ip4_reset_fib_t_handler (vl_api_reset_fib_t * mp)
})); /* pool_foreach (fib) */
/* *INDENT-ON* */
- stats_dsunlock ();
return rv;
}
@@ -3233,8 +3212,6 @@ ip6_reset_fib_t_handler (vl_api_reset_fib_t * mp)
int rv = VNET_API_ERROR_NO_SUCH_FIB;
u32 target_fib_id = ntohl (mp->vrf_id);
- stats_dslock_with_hint (1 /* release hint */ , 9 /* tag */ );
-
/* *INDENT-OFF* */
pool_foreach (fib_table, im6->fibs,
({
@@ -3273,7 +3250,6 @@ ip6_reset_fib_t_handler (vl_api_reset_fib_t * mp)
})); /* pool_foreach (fib) */
/* *INDENT-ON* */
- stats_dsunlock ();
return rv;
}
diff --git a/src/vnet/mpls/mpls_api.c b/src/vnet/mpls/mpls_api.c
index 440dc9c4640..52434dae8aa 100644
--- a/src/vnet/mpls/mpls_api.c
+++ b/src/vnet/mpls/mpls_api.c
@@ -56,9 +56,6 @@ _(MPLS_TUNNEL_DUMP, mpls_tunnel_dump) \
_(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
_(MPLS_FIB_DUMP, mpls_fib_dump)
-extern void stats_dslock_with_hint (int hint, int tag);
-extern void stats_dsunlock (void);
-
void
mpls_table_delete (u32 table_id, u8 is_api)
{
@@ -318,8 +315,6 @@ vl_api_mpls_tunnel_add_del_t_handler (vl_api_mpls_tunnel_add_del_t * mp)
clib_memset (&rpath, 0, sizeof (rpath));
- stats_dslock_with_hint (1 /* release hint */ , 5 /* tag */ );
-
if (mp->mt_next_hop_proto_is_ip4)
{
rpath.frp_proto = DPO_PROTO_IP4;
@@ -394,8 +389,6 @@ vl_api_mpls_tunnel_add_del_t_handler (vl_api_mpls_tunnel_add_del_t * mp)
vec_free (rpaths);
- stats_dsunlock ();
-
out:
/* *INDENT-OFF* */
REPLY_MACRO2(VL_API_MPLS_TUNNEL_ADD_DEL_REPLY,
diff --git a/src/vnet/pg/pg_api.c b/src/vnet/pg/pg_api.c
index 49b661e7dc4..7775343a6f5 100644
--- a/src/vnet/pg/pg_api.c
+++ b/src/vnet/pg/pg_api.c
@@ -46,9 +46,6 @@ _(PG_CREATE_INTERFACE, pg_create_interface) \
_(PG_CAPTURE, pg_capture) \
_(PG_ENABLE_DISABLE, pg_enable_disable)
-extern void stats_dslock_with_hint (int hint, int tag);
-extern void stats_dsunlock (void);
-
static void
vl_api_pg_create_interface_t_handler (vl_api_pg_create_interface_t * mp)
{