net/ice: fix item number when pattern has ETH

Message ID 1563181362-29513-1-git-send-email-wei.zhao1@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fix item number when pattern has ETH |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Zhao1, Wei July 15, 2019, 9:02 a.m. UTC
  When pattern has ETH, maybe it will contain
MAC and ethertype two kinds of lookup parameters,
so add more item number for memory malloc.

Signed-off-by: wei zhao <wei.zhao1@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Qi Zhang July 16, 2019, 1:13 a.m. UTC | #1
> -----Original Message-----
> From: Zhao1, Wei
> Sent: Monday, July 15, 2019 5:03 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] 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.
> 
> Signed-off-by: wei zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index 5424223..6ec50fb 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -435,6 +435,8 @@ 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;
> +		if (item->type == RTE_FLOW_ITEM_TYPE_ETH)

I would suggest add some comment here like 
"reserve one more slot for ETH which may consume 2 lookup items" 
to help others easy to understand.

> +			item_num++;
>  	}
>  	rule_info.tun_type = tun_type;
> 
> --
> 2.7.5
  

Patch

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 5424223..6ec50fb 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -435,6 +435,8 @@  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;
+		if (item->type == RTE_FLOW_ITEM_TYPE_ETH)
+			item_num++;
 	}
 	rule_info.tun_type = tun_type;