From: Wei Zhao Date: Tue, 16 Jul 2019 02:36:38 +0000 (+0800) Subject: net/ice: fix flow API switch filter X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a3ffaccbf6d242021f231d0b7b313f2768562b4d;p=dpdk.git net/ice: fix flow API switch filter When pattern has ETH, it may contain two kinds of lookup parameters, MAC and ethertype. So increasing item number for memory malloc in order to reserve one more memory slot for ETH which may consume 2 lookup items. Fixes: 57c4f2693588 ("net/ice: enable switch filter") Signed-off-by: Wei Zhao Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 5424223b63..b88b4f59a3 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -435,6 +435,11 @@ ice_create_switch_filter(struct ice_pf *pf, tun_type = ICE_SW_TUN_VXLAN; if (item->type == RTE_FLOW_ITEM_TYPE_NVGRE) tun_type = ICE_SW_TUN_NVGRE; + /* reserve one more memory slot for ETH which may + * consume 2 lookup items. + */ + if (item->type == RTE_FLOW_ITEM_TYPE_ETH) + item_num++; } rule_info.tun_type = tun_type;