summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/node.c
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-06-20 14:00:26 +0200
committerJohn Lo <loj@cisco.com>2017-08-01 14:44:13 +0000
commit15ac81c16fba83033090299413a3a2dbb848a0f9 (patch)
treeca9617e0faa21847be31e47c0c65ffc0cacf47eb /src/vnet/ethernet/node.c
parent5b311202b82a827c712d2cb7604c56049266adc9 (diff)
P2P Ethernet
Change-Id: Idb97e573961b3bc2acdeef77582314590795f8c3 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/node.c')
-rwxr-xr-xsrc/vnet/ethernet/node.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 421d501adda..f216216d3d7 100755
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -40,6 +40,7 @@
#include <vlib/vlib.h>
#include <vnet/pg/pg.h>
#include <vnet/ethernet/ethernet.h>
+#include <vnet/ethernet/p2p_ethernet.h>
#include <vppinfra/sparse_vec.h>
#include <vnet/l2/l2_bvi.h>
@@ -823,7 +824,21 @@ ethernet_sw_interface_get_config (vnet_main_t * vnm,
// Locate the subint for the given ethernet config
si = vnet_get_sw_interface (vnm, sw_if_index);
- if (si->sub.eth.flags.default_sub)
+ if (si->type == VNET_SW_INTERFACE_TYPE_P2P)
+ {
+ p2p_ethernet_main_t *p2pm = &p2p_main;
+ u32 p2pe_sw_if_index =
+ p2p_ethernet_lookup (hi->hw_if_index, si->p2p.client_mac);
+ if (p2pe_sw_if_index == ~0)
+ {
+ pool_get (p2pm->p2p_subif_pool, subint);
+ si->p2p.pool_index = subint - p2pm->p2p_subif_pool;
+ }
+ else
+ subint = vec_elt_at_index (p2pm->p2p_subif_pool, si->p2p.pool_index);
+ *flags = SUBINT_CONFIG_P2P;
+ }
+ else if (si->sub.eth.flags.default_sub)
{
subint = &main_intf->default_subint;
*flags = SUBINT_CONFIG_MATCH_0_TAG |