From: Shahaji Bhosle Date: Wed, 3 Nov 2021 00:52:42 +0000 (-0700) Subject: net/bnxt: fix type casting X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4d2c429177004e38591484bf6c27f96085ef472f;p=dpdk.git net/bnxt: fix type casting Typecast flow_item type, action_item type and the ENUMs to uint32_t before comparing. Bugzilla ID: 821 Fixes: bdf4a3c6316b ("net/bnxt: support tunnel offload") Signed-off-by: Shahaji Bhosle Signed-off-by: Venkat Duvvuru Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 605c29223c..d21c088d59 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -137,10 +137,10 @@ bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[], /* Parse all the items in the pattern */ while (item && item->type != RTE_FLOW_ITEM_TYPE_END) { - if (item->type >= (uint32_t) + if (item->type >= (typeof(item->type)) BNXT_RTE_FLOW_ITEM_TYPE_END) { if (item->type >= - (uint32_t)BNXT_RTE_FLOW_ITEM_TYPE_LAST) + (typeof(item->type))BNXT_RTE_FLOW_ITEM_TYPE_LAST) goto hdr_parser_error; /* get the header information */ hdr_info = &ulp_vendor_hdr_info[item->type - @@ -186,9 +186,9 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[], /* Parse all the items in the pattern */ while (action_item && action_item->type != RTE_FLOW_ACTION_TYPE_END) { if (action_item->type >= - (uint32_t)BNXT_RTE_FLOW_ACTION_TYPE_END) { + (typeof(action_item->type))BNXT_RTE_FLOW_ACTION_TYPE_END) { if (action_item->type >= - (uint32_t)BNXT_RTE_FLOW_ACTION_TYPE_LAST) + (typeof(action_item->type))BNXT_RTE_FLOW_ACTION_TYPE_LAST) goto act_parser_error; /* get the header information from bnxt actinfo table */ hdr_info = &ulp_vendor_act_info[action_item->type -