From a3ffaccbf6d242021f231d0b7b313f2768562b4d Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Tue, 16 Jul 2019 10:36:38 +0800 Subject: [PATCH] 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 --- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.20.1