Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R3.0 #89

Open
wants to merge 166 commits into
base: master
Choose a base branch
from
Open

R3.0 #89

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
8e61639
Adding R3.0 branch to CI Closes-Bug: 1547034
vmahuli Feb 18, 2016
b679020
Vrouter to generate EEXIST error appropriately
Feb 19, 2016
38385ba
DPDK: fix (again) hashing of fragmented packets
semihalf-berestovskyy-andriy Feb 22, 2016
99763a1
Vrouter to return error for invalid flow op
Feb 23, 2016
4d01316
Do not consider evicted flows as active flow in flow utility
krharsh Feb 23, 2016
c418fa4
DPDK: fix UDP fragments handling
semihalf-berestovskyy-andriy Feb 22, 2016
8759e5d
Merge "DPDK: fix (again) hashing of fragmented packets" into R3.0
Feb 23, 2016
5ae73c8
Merge "DPDK: fix UDP fragments handling" into R3.0
Feb 23, 2016
d40be29
List flows based on match criteria
anandhk-juniper Feb 18, 2016
81476e1
Merge "Do not consider evicted flows as active flow in flow utility" …
Feb 24, 2016
c3a9f52
Merge "List flows based on match criteria" into R3.0
Feb 24, 2016
1db4e11
DPDK: make Sandesh quiet
semihalf-berestovskyy-andriy Feb 25, 2016
747ec6e
Using the correct FMD and setting pkt_type correctly for mirrored pac…
divakardhar Feb 25, 2016
c17b8fe
Reduce the size of the RSS mempool to improve performance.
srajag Feb 26, 2016
16c05b7
Merge "Reduce the size of the RSS mempool to improve performance. The…
Feb 26, 2016
c1c472c
Dont mirror the same packet again
divakardhar Feb 26, 2016
c959ff9
Merge "Using the correct FMD and setting pkt_type correctly for mirro…
Feb 26, 2016
01dbe86
Merge "Dont mirror the same packet again" into R3.0
Feb 26, 2016
4da87fc
Keeping ingres vif id in L2 header for post GRO processing
divakardhar Feb 27, 2016
ce86dd4
Use innerpacket's destip as source ip while doing Tx Port mirroring
divakardhar Feb 27, 2016
d44296e
Disable Eviction of flow in Vrouter
Feb 27, 2016
1696925
Merge "Disable Eviction of flow in Vrouter" into R3.0
Feb 28, 2016
2bad6da
DPDK: reset virtio queue on stop
semihalf-berestovskyy-andriy Feb 29, 2016
e5e8b85
Post GRO, label in fmd can't be used to check whether the packet
anandhk-juniper Feb 29, 2016
356bc69
Do not reuse forwarding metadata post mirroring
anandhk-juniper Mar 2, 2016
4b84e39
Modify hentry flags before adding to free list
divakardhar Mar 3, 2016
c40b395
DPDK: fix high pkt drop for 16 lcores
semihalf-berestovskyy-andriy Mar 9, 2016
a2e6648
Drop ICMP error packets for ICMP errors
anandhk-juniper Mar 12, 2016
6150505
Do not swap ports for an ICMP packet inside an ICMP error
anandhk-juniper Mar 14, 2016
3dd9596
Merge "Do not swap ports for an ICMP packet inside an ICMP error" int…
Mar 15, 2016
dcc9184
Merge "Modify hentry flags before adding to free list" into R3.0
Mar 15, 2016
91e2d3a
'GET' option for 'rt' command
anandhk-juniper Feb 23, 2016
712de81
Add flow gen id info to agent header
Mar 18, 2016
aa66037
DPDK: increase max packet size from 9160B to 9kB.
semihalf-zmuda-wojciech Feb 25, 2016
d3d0e98
Pass correct forwarding metadata to mirroring
anandhk-juniper Mar 24, 2016
93dc4f6
Merge "Add flow gen id info to agent header" into R3.0
Mar 24, 2016
8337190
Fix memory corruption at the time of unloading
anandhk-juniper Mar 24, 2016
da1306d
DPDK: fix incorrect PCI address passed from the Agent
semihalf-berestovskyy-andriy Mar 24, 2016
59f39f7
DPDK: set MAC address passed by the Agent to the NIC
semihalf-berestovskyy-andriy Mar 24, 2016
fbcf0c9
Merge "Pass correct forwarding metadata to mirroring" into R3.0
Mar 25, 2016
2be1a03
Merge "Fix memory corruption at the time of unloading" into R3.0
Mar 25, 2016
a752cad
Merge "DPDK: fix incorrect PCI address passed from the Agent" into R3.0
Mar 27, 2016
37b5eec
Merge "DPDK: set MAC address passed by the Agent to the NIC" into R3.0
Mar 27, 2016
2ddf88f
Set skb network header for non-tunneled packets
anandhk-juniper Mar 31, 2016
ec6e924
Update the less specific route node with requested values
anandhk-juniper Mar 30, 2016
e019ca5
Merge "Set skb network header for non-tunneled packets" into R3.0
Apr 1, 2016
f635e2e
DPDK: dedicate an lcore for SR-IOV VF IO Edit
semihalf-berestovskyy-andriy Apr 7, 2016
77ac5a3
Use alternate APIs for some of the kernel calls
anandhk-juniper Mar 18, 2016
995596d
DPDK: Enable Vlan offload in bonded interfaces
kirankn80 Apr 8, 2016
6f0972a
Enable Vrouter Flow Eviction
Apr 1, 2016
ead9a0e
Adding new short flow drop reason(SAME_FLOW_RFLOW).
manishsing Apr 5, 2016
61241c0
Merge "Enable Vrouter Flow Eviction" into R3.0
Apr 12, 2016
f193d55
DPDK: fix NetLink thread freeze
semihalf-berestovskyy-andriy Apr 12, 2016
7101cab
Replace cpu_sibling_mask() with topology_sibling_cpumask()
Mar 10, 2016
0f8fb1c
Create a new flow if a packet hits a delete marked flow
divakardhar Apr 13, 2016
830fc5b
Display used flow table count and bridge table count in "vrouter" uti…
divakardhar Apr 13, 2016
72e7649
Treat ARP requestsas VM's requests if VRF is different when compared …
divakardhar Apr 14, 2016
4af463f
Match source and destination when both are given
anandhk-juniper Apr 15, 2016
ba7a510
Merge "Create a new flow if a packet hits a delete marked flow" into …
Apr 15, 2016
13bf183
DPDK: fix low performance of SR-IOV VF IO lcore
semihalf-berestovskyy-andriy Apr 15, 2016
fafe8b6
DPDK: fix error log
semihalf-berestovskyy-andriy Apr 15, 2016
2a7d69c
Merge "DPDK: dedicate an lcore for SR-IOV VF IO Edit" into R3.0
Apr 16, 2016
e14f021
Merge "DPDK: fix NetLink thread freeze" into R3.0
Apr 18, 2016
1afb32d
Merge "DPDK: fix low performance of SR-IOV VF IO lcore" into R3.0
Apr 18, 2016
7f26bc1
Merge "DPDK: fix error log" into R3.0
Apr 18, 2016
005e1d5
Merge "DPDK: fix high pkt drop for 16 lcores" into R3.0
Apr 18, 2016
c6b154f
Merge "DPDK: Enable Vlan offload in bonded interfaces" into R3.0
Apr 18, 2016
f411dc1
Print port mirroring index in VIF utility
divakardhar Apr 19, 2016
855510c
Merge "Treat ARP requestsas VM's requests if VRF is different when co…
Apr 20, 2016
28284f4
Merge "Display used flow table count and bridge table count in "vrout…
Apr 20, 2016
a3aa608
Dont delete BGP as a service port once set
divakardhar Apr 13, 2016
55a87d4
Incasing the overflow table size of Flow and Bridge tables
divakardhar Apr 22, 2016
a1b0753
Merge "Match source and destination when both are given" into R3.0
Apr 22, 2016
c5cbb52
DPDK: vhost jumbo frame support
kirankn80 Apr 26, 2016
b9acc14
Merge "Incasing the overflow table size of Flow and Bridge tables" in…
Apr 27, 2016
2810d11
Merge "Print port mirroring index in VIF utility" into R3.0
Apr 27, 2016
fb4c602
DPDK: check PMD name suffix to detect SR-IOV VF
semihalf-berestovskyy-andriy Apr 28, 2016
8e7127d
Before initiating eviction, wait for the reverse flow to move from
anandhk-juniper Apr 29, 2016
9e3bdfc
Dont treat all FFFF checksum packets as DIAG packets
divakardhar Apr 29, 2016
00114b5
DPDK: fix SR-IOV VF stats
semihalf-berestovskyy-andriy Apr 14, 2016
0db441a
Set size of overflow table early during vrouter-dpdk startup.
srajag May 1, 2016
de94059
Issue:
jayaramsatya Apr 13, 2016
b4034ec
Merge "Issue: ----- whenever the flow entry is getting synced to the …
May 3, 2016
9cf435f
Merge "DPDK: fix SR-IOV VF stats" into R3.0
May 4, 2016
fc830f2
DPDK: Set MTU of bonded interfaces as one of the slave's MTU in rte_e…
kirankn80 May 6, 2016
b2d164c
Merge "Before initiating eviction, wait for the reverse flow to move …
May 8, 2016
b091cbb
Do not allow agent to modify a "NEW" flow
anandhk-juniper May 13, 2016
4e0ca7b
Merge "DPDK: Set MTU of bonded interfaces as one of the slave's MTU i…
May 13, 2016
cab4c7c
Out Of Order Fragment handling fixes
anandhk-juniper May 17, 2016
fbf7525
- Set the VLAN filter for VFs if vrouter is provisioned on a VLAN.
srajag May 19, 2016
a03c7c5
Set vlan filter only when vrouter physical interface is a VF.
srajag May 19, 2016
0919fd4
Disabling GRO when mirroring is enabled
divakardhar May 13, 2016
f3bdaf2
Merge "Do not allow agent to modify a "NEW" flow" into R3.0
May 24, 2016
f9a5357
Merge "Disabling GRO when mirroring is enabled" into R3.0
May 25, 2016
306b142
Set MAC address of slave interface explicitly if it is a SR-IOV VF.
srajag May 25, 2016
0891b19
Merge "Set MAC address of slave interface explicitly if it is a SR-IO…
May 25, 2016
4e0d94a
DPDK: fix SR-IOV VF stats
semihalf-berestovskyy-andriy May 25, 2016
f65b314
Merge "Dont treat all FFFF checksum packets as DIAG packets" into R3.0
May 27, 2016
063ab3d
Keeping the mirror metadata entry in Flow entry
divakardhar May 27, 2016
66aeed6
Increase the flow hold count
divakardhar May 27, 2016
ad59139
Merge "Out Of Order Fragment handling fixes" into R3.0
May 30, 2016
9ee131f
New drop counter for Flow eviction
divakardhar May 31, 2016
df9e0ee
DPDK: Handle packets with 802.1p
kirankn80 Jun 1, 2016
d65550d
Fix a race condition which resulted in the pkt0 thread polling too soon
srajag Jun 1, 2016
8af0027
Merge "DPDK: fix SR-IOV VF stats" into R3.0
Jun 2, 2016
95f72e3
Merge "Fix a race condition which resulted in the pkt0 thread polling…
Jun 2, 2016
869f263
Inrease the Trap size of the truncated packet while Trapping to Agent
divakardhar Jun 3, 2016
60fc986
Merge "Keeping the mirror metadata entry in Flow entry" into R3.0
Jun 3, 2016
41187db
Merge "Inrease the Trap size of the truncated packet while Trapping t…
Jun 3, 2016
9e23f34
DPDK: Make the RSS mempool size as configurable through command line
kirankn80 Jun 3, 2016
3c57fad
Enabling ARP processing on Service interface
divakardhar Nov 17, 2015
cd31d22
DPDK: fix low performance of SR-IOV VF IO lcore
semihalf-berestovskyy-andriy Jun 8, 2016
7dff496
DPDK: fix LACP address add function
semihalf-berestovskyy-andriy Jun 8, 2016
ba021ac
Merge "DPDK: Make the RSS mempool size as configurable through comman…
Jun 11, 2016
bb6daac
Merge "DPDK: fix low performance of SR-IOV VF IO lcore" into R3.0
Jun 11, 2016
4692505
Merge "DPDK: fix LACP address add function" into R3.0
Jun 11, 2016
6e0b40c
Pull the SCTP header in the ICMP error headers to Head SKB
divakardhar Jun 15, 2016
f0fe573
Fix dependency issue with vrouter-dpdk
Jul 8, 2016
32821b2
Avoid building vrouter and dpdk against 4.2.0 kernel
Jul 9, 2016
353c9c5
Inline skb_frag_add_head in 4.3 later kernels.
pupapaik Jul 17, 2016
0ef8ec9
The source IP for neighbor advertisement should be same as the target…
haripk Jul 21, 2016
4154466
Merge "Inline skb_frag_add_head in 4.3 later kernels." into R3.0
Jul 31, 2016
3aa3680
Support Relax policy for pkt from tap interface
Aug 5, 2016
8852017
Fix NH flag usage for relax policy
Aug 8, 2016
6e20800
nh tool to expand composite nh recursively
ravi-bk Aug 16, 2016
f2f19eb
Update prefix len in Mtrie bucket as well
divakardhar Aug 18, 2016
c0f4500
Optimise the add_to_tree in mtrie
divakardhar Aug 26, 2016
c08c488
When in a softirq context, memory allocation should be atomic
anandhk-juniper Aug 31, 2016
93ec459
Hash table fixes
divakardhar Aug 18, 2016
7cc0122
Respond with stitched MAC for unicast ARP request
divakardhar Aug 29, 2016
54f87b0
Merge "Respond with stitched MAC for unicast ARP request" into R3.0
Sep 2, 2016
a20d45b
Merge "When in a softirq context, memory allocation should be atomic"…
Sep 2, 2016
7145759
Handle unicast ARP requests in source compute node
divakardhar Aug 29, 2016
931d74e
Trap & Flood neighbor advertisements
anandhk-juniper Jul 28, 2016
a709ccd
Fix memory allocation for interface request
anandhk-juniper Sep 9, 2016
90c9693
In HashTables, handle the error case if deferred work entry creation …
divakardhar Sep 6, 2016
8d38dc3
If a pclone fails, trap the original packet
anandhk-juniper Sep 30, 2016
e894f7e
Transmit V6 Neighbour advertisement on the receiving interface
divakardhar Oct 8, 2016
1c04f00
Calcaulte udp source port for multicast pkt using right hash
divakardhar Oct 21, 2016
8d407c8
Disable the flow processing for Neighbour Advertisements
divakardhar Oct 24, 2016
d5c7566
Change in port mirroring tap locations
anandhk-juniper Oct 6, 2016
9e5565c
Set packet type before mirroring from port
anandhk-juniper Oct 26, 2016
7f5e8b1
For port mirroring, flow index should not be set
anandhk-juniper Oct 27, 2016
afbd37c
Manipulating the TTL of the Packet
divakardhar May 27, 2016
8365502
If packet clone needs to be modified, create a copy of the DPDK mbuf.
srajag Nov 8, 2016
72d4ef3
Disable vlan offload as it causes performance degradation.
srajag Nov 12, 2016
81cf048
Merge "Manipulating the TTL of the Packet" into R3.0
Nov 16, 2016
d15a137
Fixing display of vrouter build_info for sandesh
ravi-bk Dec 5, 2016
82adb2a
Avoid flow processing for neighbor solicitation/advertisements
anandhk-juniper Dec 2, 2016
3cd1586
Make average setup rate as uint64 to prevent overflow in calculation
krharsh Jan 19, 2017
93cc9bd
Calculate checksum only for valid IP length
anandhk-juniper Jan 23, 2017
7bd4685
Do not blindly bridge link local neighbor solicitations
anandhk-juniper Jan 19, 2017
16df717
Don't look for UDP header in second fragment and later.
srajag Feb 17, 2017
e761a05
Remove the constraint of V6 prefix length to be multiple of 8
divakardhar Jan 19, 2017
590c83a
Hold packets while doing ECMP resolution
anandhk-juniper Dec 7, 2016
bd8e19a
Terminate the long_options array with an entry that is all zeros,
krharsh Mar 30, 2017
11d43bd
Fix segmentation fault in dropstats , vrmemstats utilities.
krharsh Apr 4, 2017
9900fb6
Increment Nexthop ref count atomically
divakardhar Mar 23, 2017
867e3c6
Cleanup SubVIF properly if addition fails
divakardhar Apr 6, 2017
46032c0
Merge "Cleanup SubVIF properly if addition fails" into R3.0
Apr 11, 2017
a1aa693
Reset the reach_nh pointer to original value
anandhk-juniper Apr 27, 2017
0727200
Remove Mtu from vif display .
krharsh May 5, 2017
d7ea2cc
Memset the control block to zeroes before calling skb_segment
anandhk-juniper Apr 27, 2017
ccb1df4
A cloned skbuff should not be sent to napi_gro_receive
anandhk-juniper May 8, 2017
100295e
Fill the NH of the packet in fragment assembler
divakardhar Jun 20, 2017
937d329
vif interfaces are numbered , add check for
krharsh May 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitreview
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
host=review.opencontrail.org
port=29418
project=Juniper/contrail-vrouter.git
defaultbranch=master
defaultbranch=R3.0
55 changes: 45 additions & 10 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import subprocess
import sys
import os
import copy
import re

AddOption('--kernel-dir', dest = 'kernel-dir', action='store',
help='Linux kernel source directory for vrouter.ko')
Expand All @@ -30,6 +31,10 @@ env.Append(CPPPATH = [env['TOP'] + '/vrouter/sandesh/gen-c'])
env.Append(CPPPATH = ['#tools'])
env.Append(CPPPATH = ['#tools/sandesh/library/c'])

# Make Sandesh quiet for production
if 'production' in env['OPT']:
DefaultEnvironment().Append(CPPDEFINES='SANDESH_QUIET')

vr_root = './'
makefile = vr_root + 'Makefile'
dp_dir = Dir(vr_root).srcnode().abspath + '/'
Expand Down Expand Up @@ -58,6 +63,38 @@ if sys.platform.startswith('freebsd'):
make_dir = make_dir + '/freebsd'
env['ENV']['MAKEOBJDIR'] = make_dir

# XXX Temporary/transitional support for Ubuntu14.04.4 w/ kernel v4.*
#
# The logic here has to handle two different invocation models:
# default 'scons' build model; and build via packager.py build. The
# first is typical for unit-test builds.
#
# The second comes via:
# - common/debian/Makefile in contrail-packaging, which invokes:
# - debian/contrail/debian/rules.modules in contrail-packages
# This approach always uses --kernel-dir, which works for vrouter, but
# libdpdk still defaults to installed version and thus will fail.
#
default_kernel_ver = shellCommand("uname -r").strip()
kernel_build_dir = None
if re.search('^4\.', default_kernel_ver):
print "Warn: kernel version %s not supported for vrouter and dpdk" % default_kernel_ver
kernel_build_dir = '/lib/modules/3.13.0-85-generic/build'
if os.path.isdir(kernel_build_dir):
default_kernel_ver = "3.13.0-85-generic"
print "info: libdpdk will be built against kernel version %s" % default_kernel_ver
else:
print "*** Error: Cannot find kernel v3.13.0-85, build of vrouter will likely fail"
kernel_build_dir = '/lib/modules/%s/build' % default_kernel_ver

kernel_dir = GetOption('kernel-dir')
if kernel_dir:
kern_version = shellCommand('cat %s/include/config/kernel.release' % kernel_dir)
else:
kern_version = default_kernel_ver
if kernel_build_dir: kernel_dir = kernel_build_dir
kern_version = kern_version.strip()

if sys.platform != 'darwin':

install_root = GetOption('install_root')
Expand Down Expand Up @@ -151,6 +188,12 @@ if sys.platform != 'darwin':
+ ' EXTRA_CFLAGS="' + DPDK_FLAGS + '"' \
+ ' O=' + dpdk_dst_dir \
+ ' '

# If this var is set, then we need to pass it to make cmd for libdpdk
if kernel_build_dir:
print "info: Adjusting libdpdk build to use RTE_KERNELDIR=%s" % kernel_build_dir
make_cmd += "RTE_KERNELDIR=%s " % kernel_build_dir

dpdk_lib = env.Command('dpdk_lib', None,
make_cmd + 'config T=' + DPDK_TARGET
+ ' && ' + make_cmd)
Expand All @@ -164,13 +207,12 @@ if sys.platform != 'darwin':

for sdir in subdirs:
env.SConscript(sdir + '/SConscript',
exports=' '.join(exports),
exports = exports,
variant_dir = env['TOP'] + '/vrouter/' + sdir,
duplicate = 0)

make_cmd = 'cd ' + make_dir + ' && make'
if GetOption('kernel-dir'):
make_cmd += ' KERNELDIR=' + GetOption('kernel-dir')
if kernel_dir: make_cmd += ' KERNELDIR=' + kernel_dir
make_cmd += ' SANDESH_HEADER_PATH=' + Dir(env['TOP'] + '/vrouter/').abspath
make_cmd += ' SANDESH_SRC_ROOT=' + '../build/kbuild/'
make_cmd += ' SANDESH_EXTRA_HEADER_PATH=' + Dir('#tools/').abspath
Expand Down Expand Up @@ -206,13 +248,6 @@ if sys.platform != 'darwin':
if GetOption('clean') and (not COMMAND_LINE_TARGETS or 'vrouter' in COMMAND_LINE_TARGETS):
os.system(make_cmd + ' clean')

if GetOption('kernel-dir'):
kern_version = shellCommand(
'cat %s/include/config/kernel.release' % GetOption('kernel-dir'))
else:
kern_version = shellCommand('uname -r')

kern_version = kern_version.strip()
libmod_dir = install_root
libmod_dir += '/lib/modules/%s/extra/net/vrouter' % kern_version
env.Alias('build-kmodule', env.Install(libmod_dir, kern))
Expand Down
70 changes: 65 additions & 5 deletions dp-core/vr_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct vr_bridge_entry {
} __attribute__((packed));

unsigned int vr_bridge_entries = VR_DEF_BRIDGE_ENTRIES;
unsigned int vr_bridge_oentries = VR_DEF_BRIDGE_OENTRIES;
unsigned int vr_bridge_oentries = 0;
static vr_htable_t vn_rtable;
char vr_bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

Expand Down Expand Up @@ -246,6 +246,25 @@ bridge_table_lookup(unsigned int vrf_id, struct vr_route_req *rt)
return rt->rtr_nh;
}

struct vr_nexthop *
__vrouter_bridge_lookup(unsigned int vrf_id, unsigned char *mac)
{
struct vr_route_req rt;

if (!mac)
return NULL;

rt.rtr_req.rtr_label_flags = 0;
rt.rtr_req.rtr_index = VR_BE_INVALID_INDEX;
rt.rtr_req.rtr_mac_size = VR_ETHER_ALEN;
rt.rtr_req.rtr_mac = mac;
/* If multicast L2 packet, use broadcast composite nexthop */
if (IS_MAC_BMCAST(rt.rtr_req.rtr_mac))
rt.rtr_req.rtr_mac = (int8_t *)vr_bcast_mac;
rt.rtr_req.rtr_vrf_id = vrf_id;

return vr_bridge_lookup(vrf_id, &rt);
}

unsigned short
vr_bridge_route_flags(unsigned int vrf_id, unsigned char *mac)
Expand All @@ -263,15 +282,33 @@ vr_bridge_route_flags(unsigned int vrf_id, unsigned char *mac)
return 0;
}

unsigned int
vr_bridge_table_used_total_entries(struct vrouter *router)
{
if (vn_rtable)
return vr_htable_used_total_entries(vn_rtable);

return 0;
}

unsigned int
vr_bridge_table_used_oflow_entries(struct vrouter *router)
{
if (vn_rtable)
return vr_htable_used_oflow_entries(vn_rtable);
return 0;
}

static int
bridge_table_get(unsigned int vrf_id, struct vr_route_req *rt)
{
struct vr_nexthop *nh;

nh = bridge_table_lookup(vrf_id, rt);
if (nh)
if (nh) {
rt->rtr_req.rtr_nh_id = rt->rtr_nh->nh_id;
return 0;
}

return -ENOENT;
}
Expand Down Expand Up @@ -394,6 +431,9 @@ bridge_table_init(struct vr_rtable *rtable, struct rtable_fspec *fs)
if (rtable->algo_data)
return 0;

if (!vr_bridge_oentries)
vr_bridge_oentries = ((vr_bridge_entries / 5) + 1023) & ~1023;

rtable->algo_data = vr_htable_create(vrouter_get(0), vr_bridge_entries,
vr_bridge_oentries, sizeof(struct vr_bridge_entry),
sizeof(struct vr_bridge_entry_key), 0, bridge_entry_key);
Expand Down Expand Up @@ -425,7 +465,7 @@ bridge_table_deinit(struct vr_rtable *rtable, struct rtable_fspec *fs,
if (!vn_rtable)
return;

vr_htable_trav(vn_rtable, 0, bridge_table_entry_free, NULL);
vr_htable_reset(vn_rtable, bridge_table_entry_free, NULL);

if (!soft_reset) {
vr_htable_delete(vn_rtable);
Expand All @@ -451,7 +491,8 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,
dmac = (int8_t *) pkt_data(pkt);

pull_len = 0;
if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6)) {
if ((pkt->vp_type == VP_TYPE_IP) || (pkt->vp_type == VP_TYPE_IP6) ||
(pkt->vp_type == VP_TYPE_ARP)) {
pull_len = pkt_get_network_header_off(pkt) - pkt_head_space(pkt);
if (pull_len && !pkt_pull(pkt, pull_len)) {
vr_pfree(pkt, VP_DROP_PULL);
Expand All @@ -461,7 +502,6 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,

/* Do the bridge lookup for the packets not meant for "me" */
if (!fmd->fmd_to_me) {

/*
* If DHCP packet coming from VM, Trap it to Agent before doing the bridge
* lookup itself
Expand All @@ -478,6 +518,26 @@ vr_bridge_input(struct vrouter *router, struct vr_packet *pkt,
return 0;
}
}

/*
* Handle the unicast ARP, coming from VM, not
* destined to us. Broadcast ARP requests would be handled
* in L2 multicast nexthop. Multicast ARP on fabric
* interface also would be handled in L2 multicast nexthop.
* Unicast ARP packets on fabric interface would be handled
* in plug routines of interface.
*/
if (!IS_MAC_BMCAST(dmac)) {
handled = 0;
if (pkt->vp_type == VP_TYPE_ARP) {
handled = vr_arp_input(pkt, fmd, dmac);
} else if (l4_type == L4_TYPE_NEIGHBOUR_SOLICITATION) {
handled = vr_neighbor_input(pkt, fmd, dmac);
}

if (handled)
return 0;
}
}

rt.rtr_req.rtr_label_flags = 0;
Expand Down