Skip to contentSkip to conversation

net/ice: fix item number when pattern has ETH

PATCH Superseded Wei Zhao 2 participants 5 messages Jul 15, 2019 – Jul 16, 2019 Network drivers

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -0
index 5424223..6ec50fb 100644
@@ -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;
 
Signature · 1 line
2.7.5
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Monday, July 15, 2019 5:03 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
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.

---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +0 -0
index 5424223..6ec50fb 100644

drivers/net/ice/ice_switch_filter.c ice_create_switch_filter(struct ice_pf *pf, · line 438

Quoted 4 lines
drivers/net/ice/ice_switch_filter.c +1 -0
@@ -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.

Quoted 6 lines
drivers/net/ice/ice_switch_filter.c +1 -1
+			item_num++;
 	}
 	rule_info.tun_type = tun_type;
 
--

2.7.5

author
#2 lore raw

PATCH v2 1/1 net/ice: fix item number when pattern has ETH

In reply to Wei Zhao

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")
---
 drivers/net/ice/ice_switch_filter.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ice/ice_switch_filter.c +2 -0
index 5424223..6ec50fb 100644
@@ -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;
 
Signature · 1 line
2.7.5
author
#3 lore raw

PATCH v3 1/1 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")
---
 drivers/net/ice/ice_switch_filter.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ice/ice_switch_filter.c +5 -0
index 5424223..b88b4f5 100644
@@ -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;
 
Signature · 1 line
2.7.5
Acked-by on v3 1/1 Applied
#4 lore raw
Quoted 9 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Tuesday, July 16, 2019 10:37 AM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v3] net/ice: fix item number when pattern has ETH

Quoted 6 lines

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")

s/wei zhao/Wei Zhao

Quoted 1 line

---

Applied to dpdk-next-net-intel.

Thanks
Qi