DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] net/ice: fix memory allocation issue of packet flag
@ 2022-06-28  4:06 Yuying Zhang
  2022-06-28  6:40 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Yuying Zhang @ 2022-06-28  4:06 UTC (permalink / raw)
  To: dev, qi.z.zhang; +Cc: Yuying Zhang, stable

Current code doesn't allocate memory of lookup element to add packet
flag. This patch adds one lookup item in the list to fix this memory
issue.

Fixes: 8b95092b7f69 ("net/ice/base: fix direction of flow that matches any")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 36c9bffb73..e84283fec1 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1863,7 +1863,10 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
 	else if (vlan_num == 2)
 		tun_type = ICE_NON_TUN_QINQ;
 
-	list = rte_zmalloc(NULL, item_num * sizeof(*list), 0);
+	/* reserve one more memory slot for direction flag which may
+	 * consume 1 lookup item.
+	 */
+	list = rte_zmalloc(NULL, (item_num + 1) * sizeof(*list), 0);
 	if (!list) {
 		rte_flow_error_set(error, EINVAL,
 				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH v1] net/ice: fix memory allocation issue of packet flag
  2022-06-28  4:06 [PATCH v1] net/ice: fix memory allocation issue of packet flag Yuying Zhang
@ 2022-06-28  6:40 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-06-28  6:40 UTC (permalink / raw)
  To: Zhang, Yuying, dev; +Cc: stable



> -----Original Message-----
> From: Zhang, Yuying <yuying.zhang@intel.com>
> Sent: Tuesday, June 28, 2022 12:07 PM
> To: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Zhang, Yuying <yuying.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v1] net/ice: fix memory allocation issue of packet flag
> 
> Current code doesn't allocate memory of lookup element to add packet flag.
> This patch adds one lookup item in the list to fix this memory issue.
> 
> Fixes: 8b95092b7f69 ("net/ice/base: fix direction of flow that matches any")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-28  6:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28  4:06 [PATCH v1] net/ice: fix memory allocation issue of packet flag Yuying Zhang
2022-06-28  6:40 ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).