patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 18/63] net/ice/base: resolve static analysis issues
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
@ 2019-08-26 10:50 ` Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 19/63] net/ice/base: fix memory leak issue Qi Zhang
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Dan Nowlin, Paul M Stillwell Jr

Coverity complains first_free can be -1 resulting in a negative shift left
when k equals 0; i.e. the expression 1 << (first_free - k). Fix this by
explicitly checking for this case.

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 29888df76..73362c909 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4200,7 +4200,7 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es)
 				index = i + 1;
 
 			/* check for room */
-			if (first_free + 1 < ice_fd_pairs[index].count)
+			if (first_free + 1 < (s8)ice_fd_pairs[index].count)
 				return ICE_ERR_MAX_LIMIT;
 
 			/* place in extraction sequence */
@@ -4210,6 +4210,9 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es)
 				es[first_free - k].off =
 					ice_fd_pairs[index].off + (k * 2);
 
+				if (k > first_free)
+					return ICE_ERR_OUT_OF_RANGE;
+
 				/* keep track of non-relevant fields */
 				mask_sel |= 1 << (first_free - k);
 			}
-- 
2.13.6


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

* [dpdk-stable] [PATCH 19/63] net/ice/base: fix memory leak issue
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 18/63] net/ice/base: resolve static analysis issues Qi Zhang
@ 2019-08-26 10:50 ` Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 21/63] net/ice/base: fix type-mismatch Qi Zhang
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Paul M Stillwell Jr

Need to free new ice_vsig_prof if no valid ptype can be found.

Fixes: d935fb5bb091 ("net/ice/base: fix packet type size")
Cc: stable@dpdk.org

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 73362c909..7daaf10b0 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4918,8 +4918,10 @@ 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;
 
-		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg))
+		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg)) {
+			ice_free(hw, p);
 			return ICE_ERR_CFG;
+		}
 
 		p->tcam[i].ptg = ptg;
 	}
-- 
2.13.6


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

* [dpdk-stable] [PATCH 21/63] net/ice/base: fix type-mismatch
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 18/63] net/ice/base: resolve static analysis issues Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 19/63] net/ice/base: fix memory leak issue Qi Zhang
@ 2019-08-26 10:50 ` Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Jeb Cramer, Paul M Stillwell Jr

The iterators are u8, but the values being compared against are u16s.
It may not ever be the case that the comparison is against a value
larger than the upper bound of the smaller type, but code analysis tools
don't know that.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
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_sched.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 84a033f1c..01c8defae 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -735,7 +735,7 @@ ice_sched_del_rl_profile(struct ice_hw *hw,
  */
 static void ice_sched_clear_rl_prof(struct ice_port_info *pi)
 {
-	u8 ln;
+	u16 ln;
 
 	for (ln = 0; ln < pi->hw->num_tx_sched_layers; ln++) {
 		struct ice_aqc_rl_profile_info *rl_prof_elem;
@@ -2181,12 +2181,11 @@ static enum ice_status
 ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
 		     u16 num_items, u32 *list)
 {
+	enum ice_status status = ICE_SUCCESS;
 	struct ice_aqc_move_elem *buf;
 	struct ice_sched_node *node;
-	enum ice_status status = ICE_SUCCESS;
+	u16 i, grps_movd = 0;
 	struct ice_hw *hw;
-	u16 grps_movd = 0;
-	u8 i;
 
 	hw = pi->hw;
 
@@ -2802,7 +2801,7 @@ ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id,
  */
 static void ice_sched_rm_unused_rl_prof(struct ice_port_info *pi)
 {
-	u8 ln;
+	u16 ln;
 
 	for (ln = 0; ln < pi->hw->num_tx_sched_layers; ln++) {
 		struct ice_aqc_rl_profile_info *rl_prof_elem;
-- 
2.13.6


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

* [dpdk-stable] [PATCH 22/63] net/ice/base: correct overrun Coverty hit
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
                   ` (2 preceding siblings ...)
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 21/63] net/ice/base: fix type-mismatch Qi Zhang
@ 2019-08-26 10:50 ` Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Paul M Stillwell Jr

Added boundary check for layer_num in function ice_sched_rm_rl_profile,
and ice_sched_add_rl_profile.

Cc: stable@dpdk.org

Tarun Singh <tarun.k.singh@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_sched.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 01c8defae..1cfc3bc20 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -3799,10 +3799,12 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
 	struct ice_aqc_rl_profile_generic_elem *buf;
 	struct ice_aqc_rl_profile_info *rl_prof_elem;
 	u16 profiles_added = 0, num_profiles = 1;
-	enum ice_status status = ICE_ERR_PARAM;
+	enum ice_status status;
 	struct ice_hw *hw;
 	u8 profile_type;
 
+	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+		return NULL;
 	switch (rl_type) {
 	case ICE_MIN_BW:
 		profile_type = ICE_AQC_RL_PROFILE_TYPE_CIR;
@@ -4049,6 +4051,8 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
 	struct ice_aqc_rl_profile_info *rl_prof_elem;
 	enum ice_status status = ICE_SUCCESS;
 
+	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+		return ICE_ERR_PARAM;
 	/* Check the existing list for RL profile */
 	LIST_FOR_EACH_ENTRY(rl_prof_elem, &pi->rl_prof_list[layer_num],
 			    ice_aqc_rl_profile_info, list_entry)
-- 
2.13.6


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

* [dpdk-stable] [PATCH 44/63] net/ice/base: fix for RSS hash on inner UDP port
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
                   ` (3 preceding siblings ...)
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
@ 2019-08-26 10:50 ` Qi Zhang
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 48/63] net/ice/base: fix flag settings in AQ call Qi Zhang
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Zhirun Yan, Paul M Stillwell Jr

Before this patch, only outer IP with inner UDP port can appear in
RSS hash, because the extraction sequence uses outer IP protocol
ID with Inner UDP protocol ID. ICE_PROT_UDP_OF always extracts the
TUNNELED UDP port values (i.e., 4789 for VXLAN). ICE_PROT_UDP_IL_OR_S
will extract NON-TUNNELED UDP port or inner UDP port.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Cc: stable@dpdk.org

Signed-off-by: Zhirun Yan <zhirun.yan@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_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 477cf5dfe..9a35a11d5 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -670,7 +670,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
 		break;
 	case ICE_FLOW_FIELD_IDX_UDP_SRC_PORT:
 	case ICE_FLOW_FIELD_IDX_UDP_DST_PORT:
-		prot_id = seg == 0 ? ICE_PROT_UDP_IL_OR_S : ICE_PROT_UDP_OF;
+		prot_id = ICE_PROT_UDP_IL_OR_S;
 		break;
 	case ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT:
 	case ICE_FLOW_FIELD_IDX_SCTP_DST_PORT:
-- 
2.13.6


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

* [dpdk-stable] [PATCH 48/63] net/ice/base: fix flag settings in AQ call
       [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
                   ` (4 preceding siblings ...)
  2019-08-26 10:50 ` [dpdk-stable] [PATCH 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
@ 2019-08-26 10:50 ` Qi Zhang
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
  6 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-26 10:50 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Dan Nowlin, Paul M Stillwell Jr

Removed setting Read flag in the Get Allocated Resource Descriptors AQ
command (0x020A). The read flag is not required for this command and
causes the FW to return an error.

Fixes: d781ccbdd15d ("net/ice/base: add functions to get allocated resources")
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_switch.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index a4966d0a1..9e85da530 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -2978,8 +2978,6 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
 					ICE_AQC_RES_TYPE_FLAG_SHARED : 0));
 	cmd->ops.cmd.first_desc = CPU_TO_LE16(*desc_id);
 
-	desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
-
 	status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
 	if (!status)
 		*desc_id = LE16_TO_CPU(cmd->ops.resp.next_desc);
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 18/63] net/ice/base: resolve static analysis issues
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
@ 2019-08-29  2:36   ` Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 19/63] net/ice/base: fix memory leak issue Qi Zhang
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Dan Nowlin, Paul M Stillwell Jr

Coverity complains first_free can be -1 resulting in a negative shift left
when k equals 0; i.e. the expression 1 << (first_free - k). Fix this by
explicitly checking for this case.

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 29888df76..73362c909 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4200,7 +4200,7 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es)
 				index = i + 1;
 
 			/* check for room */
-			if (first_free + 1 < ice_fd_pairs[index].count)
+			if (first_free + 1 < (s8)ice_fd_pairs[index].count)
 				return ICE_ERR_MAX_LIMIT;
 
 			/* place in extraction sequence */
@@ -4210,6 +4210,9 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es)
 				es[first_free - k].off =
 					ice_fd_pairs[index].off + (k * 2);
 
+				if (k > first_free)
+					return ICE_ERR_OUT_OF_RANGE;
+
 				/* keep track of non-relevant fields */
 				mask_sel |= 1 << (first_free - k);
 			}
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 19/63] net/ice/base: fix memory leak issue
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 18/63] net/ice/base: resolve static analysis issues Qi Zhang
@ 2019-08-29  2:36   ` Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 21/63] net/ice/base: fix type-mismatch Qi Zhang
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Paul M Stillwell Jr

Need to free new ice_vsig_prof if no valid ptype can be found.

Fixes: d935fb5bb091 ("net/ice/base: fix packet type size")
Cc: stable@dpdk.org

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 73362c909..7daaf10b0 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -4918,8 +4918,10 @@ 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;
 
-		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg))
+		if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg)) {
+			ice_free(hw, p);
 			return ICE_ERR_CFG;
+		}
 
 		p->tcam[i].ptg = ptg;
 	}
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 21/63] net/ice/base: fix type-mismatch
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 18/63] net/ice/base: resolve static analysis issues Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 19/63] net/ice/base: fix memory leak issue Qi Zhang
@ 2019-08-29  2:36   ` Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Jeb Cramer, Paul M Stillwell Jr

The iterators are u8, but the values being compared against are u16s.
It may not ever be the case that the comparison is against a value
larger than the upper bound of the smaller type, but code analysis tools
don't know that.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
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_sched.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 84a033f1c..01c8defae 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -735,7 +735,7 @@ ice_sched_del_rl_profile(struct ice_hw *hw,
  */
 static void ice_sched_clear_rl_prof(struct ice_port_info *pi)
 {
-	u8 ln;
+	u16 ln;
 
 	for (ln = 0; ln < pi->hw->num_tx_sched_layers; ln++) {
 		struct ice_aqc_rl_profile_info *rl_prof_elem;
@@ -2181,12 +2181,11 @@ static enum ice_status
 ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
 		     u16 num_items, u32 *list)
 {
+	enum ice_status status = ICE_SUCCESS;
 	struct ice_aqc_move_elem *buf;
 	struct ice_sched_node *node;
-	enum ice_status status = ICE_SUCCESS;
+	u16 i, grps_movd = 0;
 	struct ice_hw *hw;
-	u16 grps_movd = 0;
-	u8 i;
 
 	hw = pi->hw;
 
@@ -2802,7 +2801,7 @@ ice_sched_assoc_vsi_to_agg(struct ice_port_info *pi, u32 agg_id,
  */
 static void ice_sched_rm_unused_rl_prof(struct ice_port_info *pi)
 {
-	u8 ln;
+	u16 ln;
 
 	for (ln = 0; ln < pi->hw->num_tx_sched_layers; ln++) {
 		struct ice_aqc_rl_profile_info *rl_prof_elem;
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 22/63] net/ice/base: correct overrun Coverty hit
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
                     ` (2 preceding siblings ...)
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 21/63] net/ice/base: fix type-mismatch Qi Zhang
@ 2019-08-29  2:36   ` Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 48/63] net/ice/base: fix flag settings in AQ call Qi Zhang
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Paul M Stillwell Jr

Added boundary check for layer_num in function ice_sched_rm_rl_profile,
and ice_sched_add_rl_profile.

Cc: stable@dpdk.org

Tarun Singh <tarun.k.singh@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_sched.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 01c8defae..1cfc3bc20 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -3799,10 +3799,12 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
 	struct ice_aqc_rl_profile_generic_elem *buf;
 	struct ice_aqc_rl_profile_info *rl_prof_elem;
 	u16 profiles_added = 0, num_profiles = 1;
-	enum ice_status status = ICE_ERR_PARAM;
+	enum ice_status status;
 	struct ice_hw *hw;
 	u8 profile_type;
 
+	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+		return NULL;
 	switch (rl_type) {
 	case ICE_MIN_BW:
 		profile_type = ICE_AQC_RL_PROFILE_TYPE_CIR;
@@ -4049,6 +4051,8 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
 	struct ice_aqc_rl_profile_info *rl_prof_elem;
 	enum ice_status status = ICE_SUCCESS;
 
+	if (layer_num >= ICE_AQC_TOPO_MAX_LEVEL_NUM)
+		return ICE_ERR_PARAM;
 	/* Check the existing list for RL profile */
 	LIST_FOR_EACH_ENTRY(rl_prof_elem, &pi->rl_prof_list[layer_num],
 			    ice_aqc_rl_profile_info, list_entry)
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 44/63] net/ice/base: fix for RSS hash on inner UDP port
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
                     ` (3 preceding siblings ...)
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
@ 2019-08-29  2:36   ` Qi Zhang
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 48/63] net/ice/base: fix flag settings in AQ call Qi Zhang
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Zhirun Yan, Paul M Stillwell Jr

Before this patch, only outer IP with inner UDP port can appear in
RSS hash, because the extraction sequence uses outer IP protocol
ID with Inner UDP protocol ID. ICE_PROT_UDP_OF always extracts the
TUNNELED UDP port values (i.e., 4789 for VXLAN). ICE_PROT_UDP_IL_OR_S
will extract NON-TUNNELED UDP port or inner UDP port.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Cc: stable@dpdk.org

Signed-off-by: Zhirun Yan <zhirun.yan@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_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 477cf5dfe..9a35a11d5 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -670,7 +670,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
 		break;
 	case ICE_FLOW_FIELD_IDX_UDP_SRC_PORT:
 	case ICE_FLOW_FIELD_IDX_UDP_DST_PORT:
-		prot_id = seg == 0 ? ICE_PROT_UDP_IL_OR_S : ICE_PROT_UDP_OF;
+		prot_id = ICE_PROT_UDP_IL_OR_S;
 		break;
 	case ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT:
 	case ICE_FLOW_FIELD_IDX_SCTP_DST_PORT:
-- 
2.13.6


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

* [dpdk-stable] [PATCH v2 48/63] net/ice/base: fix flag settings in AQ call
       [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
                     ` (4 preceding siblings ...)
  2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
@ 2019-08-29  2:36   ` Qi Zhang
  5 siblings, 0 replies; 12+ messages in thread
From: Qi Zhang @ 2019-08-29  2:36 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang
  Cc: dev, xiaolong.ye, Qi Zhang, stable, Dan Nowlin, Paul M Stillwell Jr

Removed setting Read flag in the Get Allocated Resource Descriptors AQ
command (0x020A). The read flag is not required for this command and
causes the FW to return an error.

Fixes: d781ccbdd15d ("net/ice/base: add functions to get allocated resources")
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_switch.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index a4966d0a1..9e85da530 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -2978,8 +2978,6 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
 					ICE_AQC_RES_TYPE_FLAG_SHARED : 0));
 	cmd->ops.cmd.first_desc = CPU_TO_LE16(*desc_id);
 
-	desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
-
 	status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
 	if (!status)
 		*desc_id = LE16_TO_CPU(cmd->ops.resp.next_desc);
-- 
2.13.6


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

end of thread, other threads:[~2019-08-29  2:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190826105105.19121-1-qi.z.zhang@intel.com>
2019-08-26 10:50 ` [dpdk-stable] [PATCH 18/63] net/ice/base: resolve static analysis issues Qi Zhang
2019-08-26 10:50 ` [dpdk-stable] [PATCH 19/63] net/ice/base: fix memory leak issue Qi Zhang
2019-08-26 10:50 ` [dpdk-stable] [PATCH 21/63] net/ice/base: fix type-mismatch Qi Zhang
2019-08-26 10:50 ` [dpdk-stable] [PATCH 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
2019-08-26 10:50 ` [dpdk-stable] [PATCH 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
2019-08-26 10:50 ` [dpdk-stable] [PATCH 48/63] net/ice/base: fix flag settings in AQ call Qi Zhang
     [not found] ` <20190829023656.8220-1-qi.z.zhang@intel.com>
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 18/63] net/ice/base: resolve static analysis issues Qi Zhang
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 19/63] net/ice/base: fix memory leak issue Qi Zhang
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 21/63] net/ice/base: fix type-mismatch Qi Zhang
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 22/63] net/ice/base: correct overrun Coverty hit Qi Zhang
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 44/63] net/ice/base: fix for RSS hash on inner UDP port Qi Zhang
2019-08-29  2:36   ` [dpdk-stable] [PATCH v2 48/63] net/ice/base: fix flag settings in AQ call 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).