summaryrefslogtreecommitdiffstats
path: root/common/VIL/l2l3_stack
diff options
context:
space:
mode:
Diffstat (limited to 'common/VIL/l2l3_stack')
-rw-r--r--common/VIL/l2l3_stack/lib_arp.c19
-rw-r--r--common/VIL/l2l3_stack/lib_arp.h20
-rw-r--r--common/VIL/l2l3_stack/tsx.h6
3 files changed, 37 insertions, 8 deletions
diff --git a/common/VIL/l2l3_stack/lib_arp.c b/common/VIL/l2l3_stack/lib_arp.c
index e2f755f2..b8976d3a 100644
--- a/common/VIL/l2l3_stack/lib_arp.c
+++ b/common/VIL/l2l3_stack/lib_arp.c
@@ -71,7 +71,7 @@ uint32_t nd_buffer = ARP_BUF_DEFAULT;
#define IN6ADDRSZ 16
#define MAX_PORTS 32
-static int my_inet_pton_ipv6(int af, const char *src, void *dst);
+int my_inet_pton_ipv6(int af, const char *src, void *dst);
static int inet_pton_ipv6(const char *src, unsigned char *dst);
static int inet_pton_ipv4(const char *src, unsigned char *dst);
static void local_arp_cache_init(void);
@@ -983,10 +983,13 @@ void remove_arp_entry(struct arp_entry_data *ret_arp_data, void *arg)
struct arp_timer_key *arp_key = (struct arp_timer_key *)arg;
lib_arp_delete_called++;
- rte_timer_stop(ret_arp_data->timer);
- rte_free(ret_arp_data->timer_key);
- rte_free(ret_arp_data->buf_pkts);
- ret_arp_data->buf_pkts = NULL;
+ if (ret_arp_data->timer) {
+ rte_timer_stop(ret_arp_data->timer);
+ rte_free(ret_arp_data->timer_key);
+ rte_free(ret_arp_data->buf_pkts);
+ ret_arp_data->buf_pkts = NULL;
+ }
+
if (ARPICMP_DEBUG) {
RTE_LOG(INFO, LIBARP,
"ARP Entry Deleted for IP :%d.%d.%d.%d , port %d\n",
@@ -1164,7 +1167,7 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr,
if (new_arp_data->status == STALE) {
new_arp_data->status = PROBE;
if (ifm_chk_port_ipv4_enabled
- (new_arp_data->port)) {
+ (new_arp_data->port) != IFM_FAILURE) {
request_arp(new_arp_data->port,
new_arp_data->ip);
} else {
@@ -1894,7 +1897,7 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port)
* author:
* Paul Vixie, 1996.
*/
-static int my_inet_pton_ipv6(int af, const char *src, void *dst)
+int my_inet_pton_ipv6(int af, const char *src, void *dst)
{
switch (af) {
case AF_INET:
@@ -2618,7 +2621,7 @@ void arp_timer_callback(struct rte_timer *timer, void *arg)
}
if (ifm_chk_port_ipv4_enabled
- (ret_arp_data->port)) {
+ (ret_arp_data->port) != IFM_FAILURE) {
request_arp(ret_arp_data->port,
ret_arp_data->ip);
} else {
diff --git a/common/VIL/l2l3_stack/lib_arp.h b/common/VIL/l2l3_stack/lib_arp.h
index 49b35f3d..c635c94c 100644
--- a/common/VIL/l2l3_stack/lib_arp.h
+++ b/common/VIL/l2l3_stack/lib_arp.h
@@ -58,6 +58,26 @@ extern void prefetch(void);
extern void update_nhip_access(uint8_t);
uint32_t get_arp_buf(void);
uint32_t get_nd_buf(void);
+extern int my_inet_pton_ipv6(int af, const char *src, void *dst);
+extern struct rte_hash *arp_hash_handle;
+extern struct rte_hash *nd_hash_handle;
+extern uint32_t lib_arp_get_mac_req;
+extern uint32_t lib_arp_nh_found;
+extern uint32_t lib_arp_no_nh_found;
+extern uint32_t lib_arp_arp_entry_found;
+extern uint32_t lib_arp_no_arp_entry_found;
+extern uint32_t lib_arp_populate_called;
+extern uint32_t lib_arp_delete_called;
+extern uint32_t lib_arp_duplicate_found;
+extern uint32_t arp_route_tbl_index;
+extern uint32_t lib_nd_get_mac_req;
+extern uint32_t lib_nd_nh_found;
+extern uint32_t lib_nd_no_nh_found;
+extern uint32_t lib_nd_nd_entry_found;
+extern uint32_t lib_nd_no_arp_entry_found;
+extern uint32_t lib_nd_populate_called;
+extern uint32_t lib_nd_delete_called;
+extern uint32_t lib_nd_duplicate_found;
enum {
ARP_FOUND,
diff --git a/common/VIL/l2l3_stack/tsx.h b/common/VIL/l2l3_stack/tsx.h
index 8b748165..01bde702 100644
--- a/common/VIL/l2l3_stack/tsx.h
+++ b/common/VIL/l2l3_stack/tsx.h
@@ -16,8 +16,14 @@
#ifndef _TSX_H_
#define _RSX_H_
#include <rte_atomic.h>
+
+#ifndef TRUE
#define TRUE 1
+#endif
+
+#ifndef FALSE
#define FALSE 0
+#endif
volatile int mutex_val;