summaryrefslogtreecommitdiffstats
path: root/common/VIL
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2018-08-07 08:50:01 +0530
committerDeepak S <deepak.s@linux.intel.com>2018-08-07 08:51:37 +0530
commit441879cee2b4267b5b7c2f22cc586e4a45c6955f (patch)
tree69788b3097e2b055e57e76ed48a3003d87162249 /common/VIL
parent974e4b3123b7d926d548d8924b41e8b732e2732f (diff)
Enable the local cache mac address
Change-Id: If7d72f6ab3db68bc093c42d60d125fe86f8fbda7 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Diffstat (limited to 'common/VIL')
-rw-r--r--common/VIL/l2l3_stack/lib_arp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/VIL/l2l3_stack/lib_arp.c b/common/VIL/l2l3_stack/lib_arp.c
index 9ea57d77..90bcc064 100644
--- a/common/VIL/l2l3_stack/lib_arp.c
+++ b/common/VIL/l2l3_stack/lib_arp.c
@@ -294,12 +294,20 @@ struct arp_entry_data *get_dest_mac_addr_ipv4(const uint32_t nhip,
uint32_t phy_port, struct ether_addr *hw_addr)
{
struct arp_entry_data *ret_arp_data = NULL;
+ struct ether_addr *x;
uint8_t index;
/* as part of optimization we store mac address in cache
* & thus can be sent without having to retrieve
*/
if (likely(arp_cache_dest_mac_present(phy_port))) {
+ x = get_local_cache_hw_addr(phy_port, nhip);
+ if (unlikely(!x)) {
+ printf("local copy of address not stored\n");
+ return NULL;
+ }
+
+ ether_addr_copy(x, hw_addr);
return &arp_entry_data_default;
}
@@ -2488,7 +2496,7 @@ struct ether_addr *get_local_cache_hw_addr(uint8_t out_port, uint32_t nhip)
limit = p_arp_data->arp_local_cache[out_port].num_nhip;
for (i=0; i < limit; i++) {
tmp = p_arp_data->arp_local_cache[out_port].nhip[i];
- if (tmp == nhip) {
+ if (likely(tmp == nhip)) {
x = &p_arp_data->arp_local_cache[out_port].link_hw_laddr[i];
return x;
}