patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 09/14] net/ice/base: fix incorrect payload indicator on PTYPE
       [not found] <20210302072357.1657556-1-qi.z.zhang@intel.com>
@ 2021-03-02  7:23 ` Qi Zhang
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 13/14] net/ice/base: fix uninitialized struct Qi Zhang
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 14/14] net/ice/base: cleanup fltr list in case of allocation issues Qi Zhang
  2 siblings, 0 replies; 3+ messages in thread
From: Qi Zhang @ 2021-03-02  7:23 UTC (permalink / raw)
  To: qiming.yang; +Cc: dev, haiyue.wang, junfeng.guo, Qi Zhang, stable, Jacob Keller

The entry for PTYPE 90 indicates that the payload is layer 3. This does
not match the specification in the datasheet which indicates the packet
is a MAC, IPv6, UDP packet, with a payload in layer 4.

Fix the lookup table to match the data sheet.

Fixes: 64e9587d5629 ("net/ice/base: add structures for Rx/Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_lan_tx_rx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_lan_tx_rx.h b/drivers/net/ice/base/ice_lan_tx_rx.h
index 107826acd0..e0e79cad95 100644
--- a/drivers/net/ice/base/ice_lan_tx_rx.h
+++ b/drivers/net/ice/base/ice_lan_tx_rx.h
@@ -1353,7 +1353,7 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = {
 	/* Non Tunneled IPv6 */
 	ICE_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3),
 	ICE_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3),
-	ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY3),
+	ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP,  PAY4),
 	ICE_PTT_UNUSED_ENTRY(91),
 	ICE_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP,  PAY4),
 	ICE_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),
-- 
2.26.2


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

* [dpdk-stable] [PATCH 13/14] net/ice/base: fix uninitialized struct
       [not found] <20210302072357.1657556-1-qi.z.zhang@intel.com>
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 09/14] net/ice/base: fix incorrect payload indicator on PTYPE Qi Zhang
@ 2021-03-02  7:23 ` Qi Zhang
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 14/14] net/ice/base: cleanup fltr list in case of allocation issues Qi Zhang
  2 siblings, 0 replies; 3+ messages in thread
From: Qi Zhang @ 2021-03-02  7:23 UTC (permalink / raw)
  To: qiming.yang
  Cc: dev, haiyue.wang, junfeng.guo, Qi Zhang, stable, Jesse Brandeburg

One of the structs being used for ACL counter rules was allocated on
the stack and left uninitialized.  Rather than depending on
undefined behavior around the .amount member during rule removal,
just leave a comment and initialize the struct to zero, as this is a
slow path call anyway. This bug could have caused silent failures
during counter removal.

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

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flow.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index a081fbe5a4..d123206fc6 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -1795,9 +1795,14 @@ ice_flow_acl_free_act_cntr(struct ice_hw *hw, struct ice_flow_action *acts,
 		if (acts[i].type == ICE_FLOW_ACT_CNTR_PKT ||
 		    acts[i].type == ICE_FLOW_ACT_CNTR_BYTES ||
 		    acts[i].type == ICE_FLOW_ACT_CNTR_PKT_BYTES) {
-			struct ice_acl_cntrs cntrs;
+			struct ice_acl_cntrs cntrs = { 0 };
 			enum ice_status status;
 
+			/* amount is unused in the dealloc path but the common
+			 * parameter check routine wants a value set, as zero
+			 * is invalid for the check. Just set it.
+			 */
+			cntrs.amount = 1;
 			cntrs.bank = 0; /* Only bank0 for the moment */
 			cntrs.first_cntr =
 					LE16_TO_CPU(acts[i].data.acl_act.value);
@@ -2396,7 +2401,7 @@ ice_flow_acl_check_actions(struct ice_hw *hw, struct ice_flow_action *acts,
 		if (acts[i].type == ICE_FLOW_ACT_CNTR_PKT ||
 		    acts[i].type == ICE_FLOW_ACT_CNTR_BYTES ||
 		    acts[i].type == ICE_FLOW_ACT_CNTR_PKT_BYTES) {
-			struct ice_acl_cntrs cntrs;
+			struct ice_acl_cntrs cntrs = { 0 };
 			enum ice_status status;
 
 			cntrs.amount = 1;
-- 
2.26.2


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

* [dpdk-stable] [PATCH 14/14] net/ice/base: cleanup fltr list in case of allocation issues
       [not found] <20210302072357.1657556-1-qi.z.zhang@intel.com>
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 09/14] net/ice/base: fix incorrect payload indicator on PTYPE Qi Zhang
  2021-03-02  7:23 ` [dpdk-stable] [PATCH 13/14] net/ice/base: fix uninitialized struct Qi Zhang
@ 2021-03-02  7:23 ` Qi Zhang
  2 siblings, 0 replies; 3+ messages in thread
From: Qi Zhang @ 2021-03-02  7:23 UTC (permalink / raw)
  To: qiming.yang; +Cc: dev, haiyue.wang, junfeng.guo, Qi Zhang, stable, Robert Malz

When ice_remove_vsi_lkup_fltr is called, by calling
ice_add_to_vsi_fltr_list local copy of vsi filter list
is created. If any issues during creation of vsi filter
list occurs it up for the caller to free already
allocated memory. This patch ensures proper memory
deallocation in these cases.

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

Signed-off-by: Robert Malz <robertx.malz@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 2d0dd4b28c..3dc764266b 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -6078,7 +6078,7 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,
 					  &remove_list_head);
 	ice_release_lock(rule_lock);
 	if (status)
-		return;
+		goto free_fltr_list;
 
 	switch (lkup) {
 	case ICE_SW_LKUP_MAC:
@@ -6106,6 +6106,7 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,
 		break;
 	}
 
+free_fltr_list:
 	LIST_FOR_EACH_ENTRY_SAFE(fm_entry, tmp, &remove_list_head,
 				 ice_fltr_list_entry, list_entry) {
 		LIST_DEL(&fm_entry->list_entry);
-- 
2.26.2


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

end of thread, other threads:[~2021-03-02  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210302072357.1657556-1-qi.z.zhang@intel.com>
2021-03-02  7:23 ` [dpdk-stable] [PATCH 09/14] net/ice/base: fix incorrect payload indicator on PTYPE Qi Zhang
2021-03-02  7:23 ` [dpdk-stable] [PATCH 13/14] net/ice/base: fix uninitialized struct Qi Zhang
2021-03-02  7:23 ` [dpdk-stable] [PATCH 14/14] net/ice/base: cleanup fltr list in case of allocation issues 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).