[v3] net/ice: fix item number when pattern has ETH
Checks
Commit Message
When pattern has ETH, maybe it will contain
MAC and ethertype two kinds of lookup parameters,
so add more item number for memory malloc in order
to reserve one more memory slot for ETH which may
consume 2 lookup items.
Fixes: 24dc00c30907 ("net/ice: enable switch filter")
Signed-off-by: wei zhao <wei.zhao1@intel.com>
---
drivers/net/ice/ice_switch_filter.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, July 16, 2019 10:37 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH v3] net/ice: fix item number when pattern has ETH
>
> When pattern has ETH, maybe it will contain MAC and ethertype two kinds of
> lookup parameters, so add more item number for memory malloc in order to
> reserve one more memory slot for ETH which may consume 2 lookup items.
>
> Fixes: 24dc00c30907 ("net/ice: enable switch filter")
> Signed-off-by: wei zhao <wei.zhao1@intel.com>
s/wei zhao/Wei Zhao
> ---
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
@@ -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;