diff options
author | Hongjun Ni <hongjun.ni@intel.com> | 2017-09-30 05:04:33 +0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-10-06 08:22:50 +0000 |
commit | 4e5ceefb5522cfde1e916d84b56c318ec1ea614e (patch) | |
tree | be38ffb9fd08d75525ef36d4094bfae3c3d3b954 /src/plugins/pppoe/pppoe.c | |
parent | db93cd971320301eb21403caabada7a3ec6a4cce (diff) |
Separate CP and DP fib table for PPPoE
CP table: link_table
DP table: session_table
Change-Id: I2adbfd8f6a63d51d00d6dd291f32aebf20d13e4d
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Diffstat (limited to 'src/plugins/pppoe/pppoe.c')
-rw-r--r-- | src/plugins/pppoe/pppoe.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c index e09ac7d993e..fe0775ff9df 100644 --- a/src/plugins/pppoe/pppoe.c +++ b/src/plugins/pppoe/pppoe.c @@ -280,10 +280,9 @@ int vnet_pppoe_add_del_session pfx.fp_proto = FIB_PROTOCOL_IP6; } - /* Get encap_if_index and local mac address */ - pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result, - a->client_mac, clib_host_to_net_u16 (a->session_id), - &key, &bucket, &result); + /* Get encap_if_index and local mac address from link_table */ + pppoe_lookup_1 (&pem->link_table, &cached_key, &cached_result, + a->client_mac, 0, &key, &bucket, &result); a->encap_if_index = result.fields.sw_if_index; if (a->encap_if_index == ~0) @@ -292,6 +291,14 @@ int vnet_pppoe_add_del_session si = vnet_get_sw_interface (vnm, a->encap_if_index); hi = vnet_get_hw_interface (vnm, si->hw_if_index); + /* lookup session_table */ + pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result, + a->client_mac, clib_host_to_net_u16 (a->session_id), + &key, &bucket, &result); + + /* learn client session */ + pppoe_learn_process (&pem->session_table, a->encap_if_index, + &key, &cached_key, &bucket, &result); if (a->is_add) { @@ -709,6 +716,9 @@ pppoe_init (vlib_main_t * vm) pem->vlib_main = vm; /* Create the hash table */ + BV (clib_bihash_init) (&pem->link_table, "pppoe link table", + PPPOE_NUM_BUCKETS, PPPOE_MEMORY_SIZE); + BV (clib_bihash_init) (&pem->session_table, "pppoe session table", PPPOE_NUM_BUCKETS, PPPOE_MEMORY_SIZE); |