From dfdeef016f8f2d4f14a3c01d183bff6170dcdbb9 Mon Sep 17 00:00:00 2001 From: Vishwesh M Rudramuni Date: Thu, 5 Oct 2017 03:37:35 +0530 Subject: common code: KW fixes for common code This patch fixes KW issues seen with the common code. Change-Id: I4f90369152345ea2ea9316b04ac946c0c69fd7d1 Signed-off-by: Vishwesh M Rudramuni --- common/VIL/pipeline_arpicmp/pipeline_arpicmp.c | 18 ++++++++++++++---- common/VIL/pipeline_arpicmp/pipeline_arpicmp_be.c | 6 +++--- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'common/VIL/pipeline_arpicmp') diff --git a/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c b/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c index 607d13d1..847e2936 100644 --- a/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c +++ b/common/VIL/pipeline_arpicmp/pipeline_arpicmp.c @@ -70,10 +70,10 @@ struct cmd_arp_add_result { }; -uint16_t str2flowtype(char *string); +uint16_t str2flowtype(const char *string); int parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num); -enum rte_eth_input_set_field str2inset(char *string); +enum rte_eth_input_set_field str2inset(const char *string); int app_pipeline_arpicmp_entry_dbg(struct app_params *app, uint32_t pipeline_id, uint8_t *msg); @@ -168,6 +168,11 @@ cmd_arp_del_parsed(void *parsed_result, arp_key.filler2 = 0; arp_key.filler3 = 0; struct arp_entry_data *new_arp_data = retrieve_arp_entry(arp_key, STATIC_ARP); + if(new_arp_data == NULL) { + /* KW Fix */ + printf("Retrieve arp returned NULL\n"); + return; + } remove_arp_entry(new_arp_data, &arp_key); } else { struct nd_key_ipv6 nd_key; @@ -177,6 +182,11 @@ cmd_arp_del_parsed(void *parsed_result, nd_key.filler2 = 0; nd_key.filler3 = 0; struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key, STATIC_ND); + if(new_nd_data == NULL) { + /* KW Fix */ + printf("Retrieve ND returned NULL\n"); + return; + } remove_nd_entry_ipv6(new_nd_data, &nd_key); } } @@ -960,7 +970,7 @@ cmdline_parse_inst_t cmd_set_fwd_mode = { #if 1 -uint16_t str2flowtype(char *string) +uint16_t str2flowtype(const char *string) { uint8_t i = 0; static const struct { @@ -1450,7 +1460,7 @@ struct cmd_set_hash_input_set_result { }; enum rte_eth_input_set_field -str2inset(char *string) +str2inset(const char *string) { uint16_t i; diff --git a/common/VIL/pipeline_arpicmp/pipeline_arpicmp_be.c b/common/VIL/pipeline_arpicmp/pipeline_arpicmp_be.c index 481f8521..61768130 100644 --- a/common/VIL/pipeline_arpicmp/pipeline_arpicmp_be.c +++ b/common/VIL/pipeline_arpicmp/pipeline_arpicmp_be.c @@ -210,7 +210,7 @@ void register_pipeline_Qs(uint8_t pipeline_num, struct pipeline *p) switch (myApp->pipeline_params[pipeline_num]. pktq_in[port_count].type){ - case APP_PKTQ_OUT_HWQ: + case APP_PKTQ_IN_HWQ: hwq = rte->ports_in[port_count].h_port; out_swq = rte->ports_out[port_count].h_port; printf("out_swq: %s\n", @@ -230,7 +230,7 @@ void register_pipeline_Qs(uint8_t pipeline_num, struct pipeline *p) } break; - case APP_PKTQ_OUT_SWQ: + case APP_PKTQ_IN_SWQ: in_swq = rte->ports_in[port_count].h_port; out_swq = rte->ports_out[port_count].h_port; printf("in_swq : %s\n", @@ -432,7 +432,7 @@ void set_phy_inport_id(uint8_t pipeline_num, struct pipeline *p, uint8_t *map) switch (myApp->pipeline_params[pipeline_num]. pktq_in[port_count].type) { - case APP_PKTQ_OUT_HWQ: + case APP_PKTQ_IN_HWQ: hwq = rte->ports_in[port_count].h_port; map[hwq->port_id] = index++; printf("outport_id[%d]:%d\n", index - 1, -- cgit 1.2.3-korg