summaryrefslogtreecommitdiffstats
path: root/src/vnet/classify/vnet_classify.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-09-10 04:39:11 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-11 10:14:36 +0000
commit1500254bee11355bbd69cc1dd9705be4f002f2bd (patch)
treec403642105f399baccb3a727020232b5732fe8f7 /src/vnet/classify/vnet_classify.c
parenta7191840beeb2c3a0f2598707ed1051a9f23c45f (diff)
FIB table add/delete API
part 2; - this adds the code to create an IP and MPLS table via the API. - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass. Change-Id: Id124d884ade6cb7da947225200e3bb193454c555 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/classify/vnet_classify.c')
-rw-r--r--src/vnet/classify/vnet_classify.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vnet/classify/vnet_classify.c b/src/vnet/classify/vnet_classify.c
index 879fba3c6d9..57d8674884c 100644
--- a/src/vnet/classify/vnet_classify.c
+++ b/src/vnet/classify/vnet_classify.c
@@ -368,10 +368,10 @@ vnet_classify_entry_claim_resource (vnet_classify_entry_t *e)
switch (e->action)
{
case CLASSIFY_ACTION_SET_IP4_FIB_INDEX:
- fib_table_lock (e->metadata, FIB_PROTOCOL_IP4);
+ fib_table_lock (e->metadata, FIB_PROTOCOL_IP4, FIB_SOURCE_CLASSIFY);
break;
case CLASSIFY_ACTION_SET_IP6_FIB_INDEX:
- fib_table_lock (e->metadata, FIB_PROTOCOL_IP6);
+ fib_table_lock (e->metadata, FIB_PROTOCOL_IP6, FIB_SOURCE_CLASSIFY);
break;
}
}
@@ -382,10 +382,10 @@ vnet_classify_entry_release_resource (vnet_classify_entry_t *e)
switch (e->action)
{
case CLASSIFY_ACTION_SET_IP4_FIB_INDEX:
- fib_table_unlock (e->metadata, FIB_PROTOCOL_IP4);
+ fib_table_unlock (e->metadata, FIB_PROTOCOL_IP4, FIB_SOURCE_CLASSIFY);
break;
case CLASSIFY_ACTION_SET_IP6_FIB_INDEX:
- fib_table_unlock (e->metadata, FIB_PROTOCOL_IP6);
+ fib_table_unlock (e->metadata, FIB_PROTOCOL_IP6, FIB_SOURCE_CLASSIFY);
break;
}
}
@@ -2096,9 +2096,13 @@ int vnet_classify_add_del_session (vnet_classify_main_t * cm,
e->flags = 0;
e->action = action;
if (e->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX)
- e->metadata = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP4, metadata);
+ e->metadata = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP4,
+ metadata,
+ FIB_SOURCE_CLASSIFY);
else if (e->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX)
- e->metadata = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP6, metadata);
+ e->metadata = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP6,
+ metadata,
+ FIB_SOURCE_CLASSIFY);
else
e->metadata = 0;