patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 2/6] net/ice/base: fix resource leak
       [not found] <20190723035115.42664-1-qi.z.zhang@intel.com>
@ 2019-07-23  3:51 ` Qi Zhang
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size Qi Zhang
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines Qi Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Qi Zhang @ 2019-07-23  3:51 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.lu
  Cc: paul.m.stillwell.jr, dev, Qi Zhang, stable, Jeb Cramer

We don't free s_rule if ice_aq_sw_rules() returns a non-zero status. If
it returned a zero status, s_rule would be freed right after, so this
implies it should be freed within the scope of the function regardless.

Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Cc: stable@dpdk.org

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 0b5b1f41d..b249a3036 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -2787,12 +2787,13 @@ ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id,
 		status = ice_aq_sw_rules(hw, s_rule,
 					 ICE_SW_RULE_RX_TX_NO_HDR_SIZE, 1,
 					 ice_aqc_opc_remove_sw_rules, NULL);
-		if (status)
-			goto exit;
 
 		/* Remove a book keeping from the list */
 		ice_free(hw, s_rule);
 
+		if (status)
+			goto exit;
+
 		LIST_DEL(&list_elem->list_entry);
 		ice_free(hw, list_elem);
 	}
-- 
2.13.6


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

* [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size
       [not found] <20190723035115.42664-1-qi.z.zhang@intel.com>
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 2/6] net/ice/base: fix resource leak Qi Zhang
@ 2019-07-23  3:51 ` Qi Zhang
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines Qi Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Qi Zhang @ 2019-07-23  3:51 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.lu
  Cc: paul.m.stillwell.jr, dev, Qi Zhang, stable, Dan Nowlin

Change ptype variable to correctly be 16-bits in ice_prof_map
structure.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")
Cc: stable@dpdk.org

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 3 ++-
 drivers/net/ice/base/ice_flex_type.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index c1f23ec02..147fa4d01 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4376,7 +4376,8 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk,
 		p->tcam[i].prof_id = map->prof_id;
 		p->tcam[i].tcam_idx = ICE_INVALID_TCAM;
 
-		ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg);
+		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg))
+			return ICE_ERR_CFG;
 
 		p->tcam[i].ptg = ptg;
 	}
diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h
index dca5cf285..837e1e872 100644
--- a/drivers/net/ice/base/ice_flex_type.h
+++ b/drivers/net/ice/base/ice_flex_type.h
@@ -526,7 +526,7 @@ struct ice_prof_map {
 	u64 context;
 	u8 prof_id;
 	u8 ptype_count;
-	u8 ptype[ICE_MAX_PTYPE_PER_PROFILE];
+	u16 ptype[ICE_MAX_PTYPE_PER_PROFILE];
 };
 
 #define ICE_INVALID_TCAM	0xFFFF
-- 
2.13.6


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

* [dpdk-stable] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines
       [not found] <20190723035115.42664-1-qi.z.zhang@intel.com>
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 2/6] net/ice/base: fix resource leak Qi Zhang
  2019-07-23  3:51 ` [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size Qi Zhang
@ 2019-07-23  3:51 ` Qi Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Qi Zhang @ 2019-07-23  3:51 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.lu
  Cc: paul.m.stillwell.jr, dev, Qi Zhang, stable, Dan Nowlin

There was an issue with ice_and_bitmap and ice_or_bitmap when
dealing with bit array sizes that are not even multiples of 32,
where some of relevant bits in the highest 32 bits were being
cleared. This patch fixes those problems.

Fixes: c9e37832c95f ("net/ice/base: rework on bit ops")
Cc: stable@dpdk.org

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_bitops.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/base/ice_bitops.h b/drivers/net/ice/base/ice_bitops.h
index c74407d9d..a3a67eb4b 100644
--- a/drivers/net/ice/base/ice_bitops.h
+++ b/drivers/net/ice/base/ice_bitops.h
@@ -191,8 +191,7 @@ ice_and_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1,
 	 * size value alone.
 	 */
 	mask = LAST_CHUNK_MASK(size);
-	dst[i] &= ~mask;
-	dst[i] |= (bmp1[i] & bmp2[i]) & mask;
+	dst[i] = (dst[i] & ~mask) | ((bmp1[i] & bmp2[i]) & mask);
 	res |= dst[i] & mask;
 
 	return res != 0;
@@ -226,8 +225,7 @@ ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1,
 	 * within the specified size.
 	 */
 	mask = LAST_CHUNK_MASK(size);
-	dst[i] &= ~mask;
-	dst[i] |= (bmp1[i] | bmp2[i]) & mask;
+	dst[i] = (dst[i] & ~mask) | ((bmp1[i] | bmp2[i]) & mask);
 }
 
 /**
-- 
2.13.6


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

* [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size
       [not found] <20190723034829.42530-1-qi.z.zhang@intel.com>
@ 2019-07-23  3:48 ` Qi Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Qi Zhang @ 2019-07-23  3:48 UTC (permalink / raw)
  To: qiming.yang, wenzhuo.luo
  Cc: paul.m.stillwell.jr, dev, Qi Zhang, stable, Dan Nowlin

Change ptype variable to correctly be 16-bits in ice_prof_map
structure.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")
Cc: stable@dpdk.org

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c | 3 ++-
 drivers/net/ice/base/ice_flex_type.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index c1f23ec02..147fa4d01 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4376,7 +4376,8 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk,
 		p->tcam[i].prof_id = map->prof_id;
 		p->tcam[i].tcam_idx = ICE_INVALID_TCAM;
 
-		ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg);
+		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg))
+			return ICE_ERR_CFG;
 
 		p->tcam[i].ptg = ptg;
 	}
diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h
index dca5cf285..837e1e872 100644
--- a/drivers/net/ice/base/ice_flex_type.h
+++ b/drivers/net/ice/base/ice_flex_type.h
@@ -526,7 +526,7 @@ struct ice_prof_map {
 	u64 context;
 	u8 prof_id;
 	u8 ptype_count;
-	u8 ptype[ICE_MAX_PTYPE_PER_PROFILE];
+	u16 ptype[ICE_MAX_PTYPE_PER_PROFILE];
 };
 
 #define ICE_INVALID_TCAM	0xFFFF
-- 
2.13.6


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

end of thread, other threads:[~2019-07-23  3:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190723035115.42664-1-qi.z.zhang@intel.com>
2019-07-23  3:51 ` [dpdk-stable] [PATCH 2/6] net/ice/base: fix resource leak Qi Zhang
2019-07-23  3:51 ` [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size Qi Zhang
2019-07-23  3:51 ` [dpdk-stable] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines Qi Zhang
     [not found] <20190723034829.42530-1-qi.z.zhang@intel.com>
2019-07-23  3:48 ` [dpdk-stable] [PATCH 3/6] net/ice/base: fix ptype variable size Qi Zhang

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