patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 19.11 v1 0/1] fix filters on memory allocation failure
@ 2020-11-04  8:40 Xiaoyun wang
  2020-11-04  8:40 ` [dpdk-stable] [PATCH 19.11 v1 1/1] net/hinic: " Xiaoyun wang
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaoyun wang @ 2020-11-04  8:40 UTC (permalink / raw)
  To: stable; +Cc: bluca, yin.yinshi, zhouguoyang, luoxianjun, Xiaoyun wang

If rte_zmalloc failed, pmd driver should also delete the ntuple
filter or ethertype filter or normal and tcam filter that already
added before.

--

v1:
  - fix filters on memory allocation failure

Xiaoyun wang (1):
  net/hinic: fix filters on memory allocation failure

 drivers/net/hinic/hinic_pmd_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
1.8.3.1


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

* [dpdk-stable] [PATCH 19.11 v1 1/1] net/hinic: fix filters on memory allocation failure
  2020-11-04  8:40 [dpdk-stable] [PATCH 19.11 v1 0/1] fix filters on memory allocation failure Xiaoyun wang
@ 2020-11-04  8:40 ` Xiaoyun wang
  2020-11-05  9:41   ` Luca Boccassi
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaoyun wang @ 2020-11-04  8:40 UTC (permalink / raw)
  To: stable; +Cc: bluca, yin.yinshi, zhouguoyang, luoxianjun, Xiaoyun wang

[ upstream commit 0c87a15f5f1ccb9eefb6231aea9d095686f2def4 ]

If rte_zmalloc failed, pmd driver should also delete the ntuple
filter or ethertype filter or normal and tcam filter that already
added before.

Fixes: d7964ce192e7 ("net/hinic: check memory allocations in flow creation")

Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/hinic_pmd_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index 7bbdcc9..f820be4 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -683,6 +683,7 @@ static int hinic_ntuple_item_check_end(const struct rte_flow_item *item,
 			item, "Not supported by ntuple filter");
 		return -rte_errno;
 	}
+
 	return 0;
 }
 
@@ -2116,6 +2117,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 				sizeof(struct hinic_ntuple_filter_ele), 0);
 			if (ntuple_filter_ptr == NULL) {
 				PMD_DRV_LOG(ERR, "Failed to allocate ntuple_filter_ptr");
+				(void)hinic_add_del_ntuple_filter(dev,
+							&ntuple_filter, FALSE);
 				goto out;
 			}
 			rte_memcpy(&ntuple_filter_ptr->filter_info,
@@ -2146,6 +2149,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 				sizeof(struct hinic_ethertype_filter_ele), 0);
 			if (ethertype_filter_ptr == NULL) {
 				PMD_DRV_LOG(ERR, "Failed to allocate ethertype_filter_ptr");
+				(void)hinic_add_del_ethertype_filter(dev,
+						&ethertype_filter, FALSE);
 				goto out;
 			}
 			rte_memcpy(&ethertype_filter_ptr->filter_info,
@@ -2174,6 +2179,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
 				sizeof(struct hinic_fdir_rule_ele), 0);
 			if (fdir_rule_ptr == NULL) {
 				PMD_DRV_LOG(ERR, "Failed to allocate fdir_rule_ptr");
+				hinic_add_del_fdir_filter(dev,
+						&fdir_rule, FALSE);
 				goto out;
 			}
 			rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
-- 
1.8.3.1


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

* Re: [dpdk-stable] [PATCH 19.11 v1 1/1] net/hinic: fix filters on memory allocation failure
  2020-11-04  8:40 ` [dpdk-stable] [PATCH 19.11 v1 1/1] net/hinic: " Xiaoyun wang
@ 2020-11-05  9:41   ` Luca Boccassi
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Boccassi @ 2020-11-05  9:41 UTC (permalink / raw)
  To: Xiaoyun wang, stable; +Cc: yin.yinshi, zhouguoyang, luoxianjun

On Wed, 2020-11-04 at 16:40 +0800, Xiaoyun wang wrote:
> [ upstream commit 0c87a15f5f1ccb9eefb6231aea9d095686f2def4 ]
> 
> If rte_zmalloc failed, pmd driver should also delete the ntuple
> filter or ethertype filter or normal and tcam filter that already
> added before.
> 
> Fixes: d7964ce192e7 ("net/hinic: check memory allocations in flow creation")
> 
> Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
> ---
>  drivers/net/hinic/hinic_pmd_flow.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Acked-by: Luca Boccassi <luca.boccassi@microsoft.com>

Thanks, applied and pushed.

-- 
Kind regards,
Luca Boccassi

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

end of thread, other threads:[~2020-11-05  9:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  8:40 [dpdk-stable] [PATCH 19.11 v1 0/1] fix filters on memory allocation failure Xiaoyun wang
2020-11-04  8:40 ` [dpdk-stable] [PATCH 19.11 v1 1/1] net/hinic: " Xiaoyun wang
2020-11-05  9:41   ` Luca Boccassi

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