From: Ferruh Yigit Date: Tue, 13 Jun 2017 16:42:09 +0000 (+0100) Subject: net/i40e: fix memset size X-Git-Tag: spdx-start~3010 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=92c0b132f24f9ab73aff22c4162121a145cb3f55;p=dpdk.git net/i40e: fix memset size This causes build error with gcc 7.1.1 : ...dpdk/drivers/net/i40e/i40e_flow.c:2357:2: error: ‘memset’ used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size] memset(off_arr, 0, I40E_MAX_FLXPLD_FIED); ^~~~~~ ...dpdk/drivers/net/i40e/i40e_flow.c:2358:2: error: ‘memset’ used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size] memset(len_arr, 0, I40E_MAX_FLXPLD_FIED); ^~~~~~ Fixed by providing correct size to memset. Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR") Signed-off-by: Ferruh Yigit Acked-by: Beilei Xing --- diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index c7589ce869..08c0f8e68f 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2354,8 +2354,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, uint16_t ether_type; int ret; - memset(off_arr, 0, I40E_MAX_FLXPLD_FIED); - memset(len_arr, 0, I40E_MAX_FLXPLD_FIED); + memset(off_arr, 0, sizeof(off_arr)); + memset(len_arr, 0, sizeof(len_arr)); memset(flex_mask, 0, I40E_FDIR_MAX_FLEX_LEN); outer_tpid = i40e_get_outer_vlan(dev); for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {