DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes
@ 2017-11-07  8:34 Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev

Hi,

This patch set contains fixes for issues reported by coverity and
other bug fixes.

Please include in DPDK 17.11.

Thanks!
-Rasesh

Harish Patil (2):
  net/qede: fix to disable per-VF Tx switching feature
  net/qede: fix vxlan filter deletion

Rasesh Mody (6):
  net/qede: fix to update device link structure
  net/qede: remove duplicate includes
  net/qede: fix to release the acquired ptt
  net/qede/base: fix to initialize filter API return code
  net/qede/base: fix division by zero
  net/qede: fix null pointer dereferences

 config/common_base                |    1 +
 drivers/net/qede/base/bcm_osal.h  |    4 +--
 drivers/net/qede/base/ecore_cxt.c |   32 +----------------------
 drivers/net/qede/base/ecore_dev.c |   15 +++++------
 drivers/net/qede/base/ecore_int.c |    1 -
 drivers/net/qede/base/ecore_mcp.c |    2 +-
 drivers/net/qede/qede_ethdev.c    |   52 ++++++++++++++++++++++++++++++++++---
 drivers/net/qede/qede_ethdev.h    |    8 +++---
 drivers/net/qede/qede_main.c      |    9 ++++---
 9 files changed, 69 insertions(+), 55 deletions(-)

-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-08  0:53   ` Thomas Monjalon
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 2/8] net/qede: fix vxlan filter deletion Rasesh Mody
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Harish Patil, ferruh.yigit, Dept-EngDPDKDev, stable

From: Harish Patil <harish.patil@cavium.com>

Provide a knob to control per-VF Tx switching feature by adding a config
option, CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH. By default, it will be kept
in disabled state for better performance with small sized frames.

Fixes: 2ea6f76aff40 ("qede: add core driver")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@cavium.com>
---
 config/common_base             |    1 +
 drivers/net/qede/qede_ethdev.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/config/common_base b/config/common_base
index 82ee754..a22d0b1 100644
--- a/config/common_base
+++ b/config/common_base
@@ -410,6 +410,7 @@ CONFIG_RTE_LIBRTE_QEDE_DEBUG_INFO=n
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_DRIVER=n
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_TX=n
 CONFIG_RTE_LIBRTE_QEDE_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=n
 #Provides abs path/name of the firmware file.
 #Empty string denotes driver will use default firmware
 CONFIG_RTE_LIBRTE_QEDE_FW=""
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 661d938..c228b06 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -453,6 +453,12 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
 	params.update_vport_active_tx_flg = 1;
 	params.vport_active_rx_flg = flg;
 	params.vport_active_tx_flg = flg;
+#ifndef RTE_LIBRTE_QEDE_VF_TX_SWITCH
+	if (IS_VF(edev)) {
+		params.update_tx_switching_flg = 1;
+		params.tx_switching_flg = !flg;
+	}
+#endif
 	for_each_hwfn(edev, i) {
 		p_hwfn = &edev->hwfns[i];
 		params.opaque_fid = p_hwfn->hw_info.opaque_fid;
@@ -463,7 +469,8 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
 			break;
 		}
 	}
-	DP_INFO(edev, "vport %s\n", flg ? "activated" : "deactivated");
+	DP_INFO(edev, "vport %s VF tx-switch %s\n", flg ? "activated" : "deactivated",
+			params.tx_switching_flg ? "enabled" : "disabled");
 	return rc;
 }
 
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 2/8] net/qede: fix vxlan filter deletion
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure Rasesh Mody
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Harish Patil, ferruh.yigit, Dept-EngDPDKDev

From: Harish Patil <harish.patil@cavium.com>

Initialize ucast parameters before checking if filters exists.

Fixes: e0947ed912f7 ("net/qede: add support for VXLAN UDP port config over VF")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index c228b06..43562bc 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2424,6 +2424,23 @@ static int qede_vxlan_tunn_config(struct rte_eth_dev *eth_dev,
 			return qede_vxlan_enable(eth_dev,
 				ECORE_TUNN_CLSS_MAC_VLAN, false, true);
 
+		filter_type = conf->filter_type;
+		/* Determine if the given filter classification is supported */
+		qede_get_ecore_tunn_params(filter_type, &type, &clss, str);
+		if (clss == MAX_ECORE_TUNN_CLSS) {
+			DP_ERR(edev, "Unsupported filter type\n");
+			return -EINVAL;
+		}
+		/* Init tunnel ucast params */
+		rc = qede_set_ucast_tunn_cmn_param(&ucast, conf, type);
+		if (rc != ECORE_SUCCESS) {
+			DP_ERR(edev, "Unsupported VxLAN filter type 0x%x\n",
+			conf->filter_type);
+			return rc;
+		}
+		DP_INFO(edev, "Rule: \"%s\", op %d, type 0x%x\n",
+			str, filter_op, ucast.type);
+
 		ucast.opcode = ECORE_FILTER_REMOVE;
 
 		if (!(filter_type & ETH_TUNNEL_FILTER_TENID)) {
@@ -2437,6 +2454,8 @@ static int qede_vxlan_tunn_config(struct rte_eth_dev *eth_dev,
 		if (rc != ECORE_SUCCESS)
 			return rc;
 
+		qdev->vxlan.num_filters--;
+
 		/* Disable VXLAN if VXLAN filters become 0 */
 		if (qdev->vxlan.num_filters == 0)
 			return qede_vxlan_enable(eth_dev, clss, false, true);
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 2/8] net/qede: fix vxlan filter deletion Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 4/8] net/qede: remove duplicate includes Rasesh Mody
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev, stable

8ea656f8c app/testpmd: request link status interrupt
requires QEDE PMD to populate the device link structure without
having to query the driver for link status change event.
This patch updates the device link structure when link status event is
received.
Remove unused param from qed_link_update()

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/bcm_osal.h  |    4 ++--
 drivers/net/qede/base/ecore_mcp.c |    2 +-
 drivers/net/qede/qede_ethdev.c    |    6 +++++-
 drivers/net/qede/qede_ethdev.h    |    4 ++++
 drivers/net/qede/qede_main.c      |    9 +++++----
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index a384b01..52c2f0e 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -30,7 +30,7 @@
 union ecore_mcp_protocol_stats;
 enum ecore_hw_err_type;
 
-void qed_link_update(struct ecore_hwfn *hwfn, struct ecore_ptt *ptt);
+void qed_link_update(struct ecore_hwfn *hwfn);
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 #undef __BIG_ENDIAN
@@ -338,7 +338,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *, dma_addr_t *,
 
 #define OSAL_BITMAP_WEIGHT(bitmap, count) 0
 
-#define OSAL_LINK_UPDATE(hwfn, ptt) qed_link_update(hwfn, ptt)
+#define OSAL_LINK_UPDATE(hwfn) qed_link_update(hwfn)
 #define OSAL_TRANSCEIVER_UPDATE(hwfn) nothing
 #define OSAL_DCBX_AEN(hwfn, mib_type) nothing
 
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index 3802aa8..8edd2e9 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -1420,7 +1420,7 @@ static void ecore_mcp_handle_link_change(struct ecore_hwfn *p_hwfn,
 	if (p_hwfn->mcp_info->capabilities & FW_MB_PARAM_FEATURE_SUPPORT_EEE)
 		ecore_mcp_read_eee_config(p_hwfn, p_ptt, p_link);
 
-	OSAL_LINK_UPDATE(p_hwfn, p_ptt);
+	OSAL_LINK_UPDATE(p_hwfn);
 out:
 	OSAL_SPIN_UNLOCK(&p_hwfn->mcp_info->link_lock);
 }
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 43562bc..4ef08ad 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1159,6 +1159,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
+	/* Update link status */
+	qede_link_update(eth_dev, 0);
+
 	/* Start/resume traffic */
 	qede_fastpath_start(edev);
 
@@ -1367,7 +1370,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 }
 
 /* return 0 means link status changed, -1 means not changed */
-static int
+int
 qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
@@ -2625,6 +2628,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	/* Extract key data structures */
 	adapter = eth_dev->data->dev_private;
+	adapter->ethdev = eth_dev;
 	edev = &adapter->edev;
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	pci_addr = pci_dev->addr;
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 3212020..6c051c0 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -210,6 +210,7 @@ struct qede_dev {
 	struct qede_fdir_info fdir_info;
 	bool vlan_strip_flg;
 	char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
+	void *ethdev;
 };
 
 /* Non-static functions */
@@ -226,6 +227,9 @@ int qed_fill_eth_dev_info(struct ecore_dev *edev,
 				 struct qed_dev_eth_info *info);
 int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up);
 
+int qede_link_update(struct rte_eth_dev *eth_dev,
+		     __rte_unused int wait_to_complete);
+
 int qede_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type type,
 			 enum rte_filter_op op, void *arg);
 
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index a0c9e03..ae18732 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -179,7 +179,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
 		rte_memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
 
 	/* Always update link configuration according to bulletin */
-	qed_link_update(hwfn, NULL);
+	qed_link_update(hwfn);
 }
 
 static void qede_vf_task(void *arg)
@@ -629,11 +629,12 @@ static int qed_set_link(struct ecore_dev *edev, struct qed_link_params *params)
 	return rc;
 }
 
-void qed_link_update(struct ecore_hwfn *hwfn, struct ecore_ptt *ptt)
+void qed_link_update(struct ecore_hwfn *hwfn)
 {
-	struct qed_link_output if_link;
+	struct ecore_dev *edev = hwfn->p_dev;
+	struct qede_dev *qdev = (struct qede_dev *)edev;
 
-	qed_fill_link(hwfn, ptt, &if_link);
+	qede_link_update((struct rte_eth_dev *)qdev->ethdev, 0);
 }
 
 static int qed_drain(struct ecore_dev *edev)
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 4/8] net/qede: remove duplicate includes
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (2 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 5/8] net/qede: fix to release the acquired ptt Rasesh Mody
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev, stable

Fixes: ec94dbc57362 ("qede: add base driver")
Fixes: 2ea6f76aff40 ("qede: add core driver")
Fixes: 622075356e8f ("net/qede: support ntuple and flow director filter")
Fixes: 52d94b57e1c7 ("net/qede: add slowpath support for VXLAN tunneling")
Fixes: 8b3ee85efe11 ("net/qede: fix RSS table entries for 100G adapter")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_dev.c |    1 -
 drivers/net/qede/base/ecore_int.c |    1 -
 drivers/net/qede/qede_ethdev.h    |    4 ----
 3 files changed, 6 deletions(-)

diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 5d9bc28..e4bba17 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -28,7 +28,6 @@
 #include "mcp_public.h"
 #include "ecore_iro.h"
 #include "nvm_cfg.h"
-#include "ecore_dev_api.h"
 #include "ecore_dcbx.h"
 #include "ecore_l2.h"
 
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index f9ad513..e6cef85 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -9,7 +9,6 @@
 #include "bcm_osal.h"
 #include "ecore.h"
 #include "ecore_spq.h"
-#include "reg_addr.h"
 #include "ecore_gtt_reg_addr.h"
 #include "ecore_init_ops.h"
 #include "ecore_rt_defs.h"
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 6c051c0..021de5c 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -29,15 +29,11 @@
 #include "base/ecore_chain.h"
 #include "base/ecore_status.h"
 #include "base/ecore_hsi_eth.h"
-#include "base/ecore_dev_api.h"
 #include "base/ecore_iov_api.h"
 #include "base/ecore_cxt.h"
 #include "base/nvm_cfg.h"
-#include "base/ecore_iov_api.h"
 #include "base/ecore_sp_commands.h"
 #include "base/ecore_l2.h"
-#include "base/ecore_dev_api.h"
-#include "base/ecore_l2.h"
 
 #include "qede_logs.h"
 #include "qede_if.h"
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 5/8] net/qede: fix to release the acquired ptt
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (3 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 4/8] net/qede: remove duplicate includes Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 6/8] net/qede/base: fix to initialize filter API return code Rasesh Mody
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev

Appropriately release the ptt[PF translation table] handler that is
acquired in error case

Fixes: e0947ed912f7 ("net/qede: add support for VXLAN UDP port config over VF")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 4ef08ad..7a589a2 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -637,6 +637,8 @@ static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast)
 		if (rc != ECORE_SUCCESS) {
 			DP_ERR(edev, "Failed to update tunn_clss %u\n",
 					tunn.vxlan.tun_cls);
+			if (IS_PF(edev))
+				ecore_ptt_release(p_hwfn, p_ptt);
 			break;
 		}
 	}
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 6/8] net/qede/base: fix to initialize filter API return code
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (4 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 5/8] net/qede: fix to release the acquired ptt Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 7/8] net/qede/base: fix division by zero Rasesh Mody
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev, stable

Fix for uninitialized scalar variable for filter APIs

Coverity issue: 1445717, 1445718, 1445721, 1445722
Fixes: 2e2f392b249a ("net/qede/base: upgrade the FW to 8.20.0.0")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_dev.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index e4bba17..da1830c 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -4633,7 +4633,7 @@ enum _ecore_status_t ecore_llh_add_mac_filter(struct ecore_hwfn *p_hwfn,
 					  struct ecore_ptt *p_ptt, u8 *p_filter)
 {
 	u32 high, low, entry_num;
-	enum _ecore_status_t rc;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	if (!OSAL_TEST_BIT(ECORE_MF_LLH_MAC_CLSS,
 			   &p_hwfn->p_dev->mf_bits))
@@ -4657,7 +4657,7 @@ enum _ecore_status_t ecore_llh_add_mac_filter(struct ecore_hwfn *p_hwfn,
 		   p_filter[0], p_filter[1], p_filter[2], p_filter[3],
 		   p_filter[4], p_filter[5], entry_num);
 
-	return ECORE_SUCCESS;
+	return rc;
 }
 
 static enum _ecore_status_t
@@ -4701,7 +4701,7 @@ void ecore_llh_remove_mac_filter(struct ecore_hwfn *p_hwfn,
 			     struct ecore_ptt *p_ptt, u8 *p_filter)
 {
 	u32 high, low, entry_num;
-	enum _ecore_status_t rc;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	if (!OSAL_TEST_BIT(ECORE_MF_LLH_MAC_CLSS,
 			   &p_hwfn->p_dev->mf_bits))
@@ -4776,11 +4776,11 @@ enum _ecore_status_t
 			      enum ecore_llh_port_filter_type_t type)
 {
 	u32 high, low, entry_num;
-	enum _ecore_status_t rc;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	if (!OSAL_TEST_BIT(ECORE_MF_LLH_PROTO_CLSS,
 			   &p_hwfn->p_dev->mf_bits))
-		return ECORE_SUCCESS;
+		return rc;
 
 	high = 0;
 	low = 0;
@@ -4853,7 +4853,7 @@ enum _ecore_status_t
 		break;
 	}
 
-	return ECORE_SUCCESS;
+	return rc;
 }
 
 static enum _ecore_status_t
@@ -4920,7 +4920,7 @@ enum _ecore_status_t
 				 enum ecore_llh_port_filter_type_t type)
 {
 	u32 high, low, entry_num;
-	enum _ecore_status_t rc;
+	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	if (!OSAL_TEST_BIT(ECORE_MF_LLH_PROTO_CLSS,
 			   &p_hwfn->p_dev->mf_bits))
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 7/8] net/qede/base: fix division by zero
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (5 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 6/8] net/qede/base: fix to initialize filter API return code Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences Rasesh Mody
  2017-11-07 22:53 ` [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Ferruh Yigit
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev, stable

Fix division by zero in calculating the regpair elements per page
Remove unused API ecore_cxt_free_proto_ilt()

Coverity issue: 1379423, 1379428
Fixes: 22d07d939c3c ("net/qede/base: update")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_cxt.c |   32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/drivers/net/qede/base/ecore_cxt.c b/drivers/net/qede/base/ecore_cxt.c
index b47eac2..50bd66d 100644
--- a/drivers/net/qede/base/ecore_cxt.c
+++ b/drivers/net/qede/base/ecore_cxt.c
@@ -66,6 +66,7 @@
 
 /* TYPE-1 task context - ROCE */
 union type1_task_context {
+	struct regpair reserved; /* @DPDK */
 };
 
 struct src_ent {
@@ -2220,34 +2221,3 @@ enum _ecore_status_t
 
 	return ECORE_SUCCESS;
 }
-
-enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
-					      enum protocol_type proto)
-{
-	enum _ecore_status_t rc;
-	u32 cid;
-
-	/* Free Connection CXT */
-	rc = ecore_cxt_free_ilt_range(p_hwfn, ECORE_ELEM_CXT,
-				      ecore_cxt_get_proto_cid_start(p_hwfn,
-								    proto),
-				      ecore_cxt_get_proto_cid_count(p_hwfn,
-								    proto,
-								    &cid));
-
-	if (rc)
-		return rc;
-
-	/* Free Task CXT */
-	rc = ecore_cxt_free_ilt_range(p_hwfn, ECORE_ELEM_TASK, 0,
-				      ecore_cxt_get_proto_tid_count(p_hwfn,
-								    proto));
-	if (rc)
-		return rc;
-
-	/* Free TSDM CXT */
-	rc = ecore_cxt_free_ilt_range(p_hwfn, ECORE_ELEM_SRQ, 0,
-				      ecore_cxt_get_srq_count(p_hwfn));
-
-	return rc;
-}
-- 
1.7.10.3

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

* [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (6 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 7/8] net/qede/base: fix division by zero Rasesh Mody
@ 2017-11-07  8:34 ` Rasesh Mody
  2017-11-07 22:53 ` [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Ferruh Yigit
  8 siblings, 0 replies; 14+ messages in thread
From: Rasesh Mody @ 2017-11-07  8:34 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, ferruh.yigit, Dept-EngDPDKDev

Fix null pointer dereferences in qede_vxlan_enable() and
qede_conf_udp_dst_port()

Coverity issue: 195010, 195012, 198439
Fixes: e0947ed912f7 ("net/qede: add support for VXLAN UDP port config over VF")
Fixes: 739a5b2f2b49 ("net/qede/base: use passed ptt handler")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 7a589a2..8832145 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -631,7 +631,13 @@ static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast)
 
 	for_each_hwfn(edev, i) {
 		p_hwfn = &edev->hwfns[i];
-		p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL;
+		if (IS_PF(edev)) {
+			p_ptt = ecore_ptt_acquire(p_hwfn);
+			if (!p_ptt)
+				return -EAGAIN;
+		} else {
+			p_ptt = NULL;
+		}
 		rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt,
 				&tunn, ECORE_SPQ_MODE_CB, NULL);
 		if (rc != ECORE_SUCCESS) {
@@ -2258,7 +2264,13 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 		tunn.vxlan_port.port = udp_port;
 		for_each_hwfn(edev, i) {
 			p_hwfn = &edev->hwfns[i];
-			p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL;
+			if (IS_PF(edev)) {
+				p_ptt = ecore_ptt_acquire(p_hwfn);
+				if (!p_ptt)
+					return -EAGAIN;
+			} else {
+				p_ptt = NULL;
+			}
 			rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn,
 						ECORE_SPQ_MODE_CB, NULL);
 			if (rc != ECORE_SUCCESS) {
-- 
1.7.10.3

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

* Re: [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes
  2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
                   ` (7 preceding siblings ...)
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences Rasesh Mody
@ 2017-11-07 22:53 ` Ferruh Yigit
  8 siblings, 0 replies; 14+ messages in thread
From: Ferruh Yigit @ 2017-11-07 22:53 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Dept-EngDPDKDev

On 11/7/2017 12:34 AM, Rasesh Mody wrote:
> Hi,
> 
> This patch set contains fixes for issues reported by coverity and
> other bug fixes.
> 
> Please include in DPDK 17.11.
> 
> Thanks!
> -Rasesh
> 
> Harish Patil (2):
>   net/qede: fix to disable per-VF Tx switching feature
>   net/qede: fix vxlan filter deletion
> 
> Rasesh Mody (6):
>   net/qede: fix to update device link structure
>   net/qede: remove duplicate includes
>   net/qede: fix to release the acquired ptt
>   net/qede/base: fix to initialize filter API return code
>   net/qede/base: fix division by zero
>   net/qede: fix null pointer dereferences

Series applied to dpdk-next-net/master, thanks.

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

* Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature
  2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
@ 2017-11-08  0:53   ` Thomas Monjalon
  2017-11-08  1:34     ` Patil, Harish
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2017-11-08  0:53 UTC (permalink / raw)
  To: Rasesh Mody; +Cc: dev, Harish Patil, ferruh.yigit, Dept-EngDPDKDev

Hi,

07/11/2017 09:34, Rasesh Mody:
> From: Harish Patil <harish.patil@cavium.com>
> 
> Provide a knob to control per-VF Tx switching feature by adding a config
> option, CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH. By default, it will be kept
> in disabled state for better performance with small sized frames.
> 
> Fixes: 2ea6f76aff40 ("qede: add core driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Harish Patil <harish.patil@cavium.com>
> ---
>  config/common_base             |    1 +
>  drivers/net/qede/qede_ethdev.c |    9 ++++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> --- a/config/common_base
> +++ b/config/common_base
> +CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=n

We should remove all compile-time options because they cannot be used
when DPDK is pre-packaged.
That's why the rule is "NO NEW COMPILE TIME OPTION".

After discussion with Ferruh, this patch is accepted as a hotfix.
But this option is expected to be removed quickly.
I've sent a patch to remove this option in 18.02:
	http://dpdk.org/ml/archives/dev/2017-November/081488.html
It gives you some time to supersede my patch by introducing a
run-time driver option.

Thanks

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

* Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature
  2017-11-08  0:53   ` Thomas Monjalon
@ 2017-11-08  1:34     ` Patil, Harish
  2017-11-08  1:44       ` Thomas Monjalon
  0 siblings, 1 reply; 14+ messages in thread
From: Patil, Harish @ 2017-11-08  1:34 UTC (permalink / raw)
  To: Thomas Monjalon, ferruh.yigit; +Cc: dev, Dept-Eng DPDK Dev, Mody, Rasesh

-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tuesday, November 7, 2017 at 5:53 PM
To: "Mody, Rasesh" <Rasesh.Mody@cavium.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Harish Patil <Harish.Patil@cavium.com>,
"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>, Dept-Eng DPDK Dev
<Dept-EngDPDKDev@cavium.com>
Subject: Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx
switching feature

>Hi,
>
>07/11/2017 09:34, Rasesh Mody:
>> From: Harish Patil <harish.patil@cavium.com>
>> 
>> Provide a knob to control per-VF Tx switching feature by adding a config
>> option, CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH. By default, it will be kept
>> in disabled state for better performance with small sized frames.
>> 
>> Fixes: 2ea6f76aff40 ("qede: add core driver")
>> Cc: stable@dpdk.org
>> 
>> Signed-off-by: Harish Patil <harish.patil@cavium.com>
>> ---
>>  config/common_base             |    1 +
>>  drivers/net/qede/qede_ethdev.c |    9 ++++++++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>> 
>> --- a/config/common_base
>> +++ b/config/common_base
>> +CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=n
>
>We should remove all compile-time options because they cannot be used
>when DPDK is pre-packaged.
>That's why the rule is "NO NEW COMPILE TIME OPTION".
>
>After discussion with Ferruh, this patch is accepted as a hotfix.
>But this option is expected to be removed quickly.
>I've sent a patch to remove this option in 18.02:
>	http://dpdk.org/ml/archives/dev/2017-November/081488.html
>It gives you some time to supersede my patch by introducing a
>run-time driver option.
>
>Thanks

Hi Thomas,
Sure, thanks, we will address before 18.02-rc1.
Do you have any example on how to add a run-time driver option?
Does it mean to introduce some change in ethdev?
Thanks.

>


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

* Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature
  2017-11-08  1:34     ` Patil, Harish
@ 2017-11-08  1:44       ` Thomas Monjalon
  2017-11-08  2:34         ` Patil, Harish
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Monjalon @ 2017-11-08  1:44 UTC (permalink / raw)
  To: Patil, Harish; +Cc: ferruh.yigit, dev, Dept-Eng DPDK Dev, Mody, Rasesh

08/11/2017 02:34, Patil, Harish:
> >> --- a/config/common_base
> >> +++ b/config/common_base
> >> +CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=n
> >
> >We should remove all compile-time options because they cannot be used
> >when DPDK is pre-packaged.
> >That's why the rule is "NO NEW COMPILE TIME OPTION".
> >
> >After discussion with Ferruh, this patch is accepted as a hotfix.
> >But this option is expected to be removed quickly.
> >I've sent a patch to remove this option in 18.02:
> >	http://dpdk.org/ml/archives/dev/2017-November/081488.html
> >It gives you some time to supersede my patch by introducing a
> >run-time driver option.
> >
> >Thanks
> 
> Hi Thomas,
> Sure, thanks, we will address before 18.02-rc1.
> Do you have any example on how to add a run-time driver option?
> Does it mean to introduce some change in ethdev?

It is done by parsing devargs with rte_kvargs.
Examples:
	http://dpdk.org/commit/447e0d379
	http://dpdk.org/commit/001a520e4
	http://dpdk.org/commit/7958b1310

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

* Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature
  2017-11-08  1:44       ` Thomas Monjalon
@ 2017-11-08  2:34         ` Patil, Harish
  0 siblings, 0 replies; 14+ messages in thread
From: Patil, Harish @ 2017-11-08  2:34 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: ferruh.yigit, dev, Dept-Eng DPDK Dev, Mody, Rasesh


-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tuesday, November 7, 2017 at 6:44 PM
To: Harish Patil <Harish.Patil@cavium.com>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>, "dev@dpdk.org"
<dev@dpdk.org>, Dept-Eng DPDK Dev <Dept-EngDPDKDev@cavium.com>, "Mody,
Rasesh" <Rasesh.Mody@cavium.com>
Subject: Re: [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx
switching feature

>08/11/2017 02:34, Patil, Harish:
>> >> --- a/config/common_base
>> >> +++ b/config/common_base
>> >> +CONFIG_RTE_LIBRTE_QEDE_VF_TX_SWITCH=n
>> >
>> >We should remove all compile-time options because they cannot be used
>> >when DPDK is pre-packaged.
>> >That's why the rule is "NO NEW COMPILE TIME OPTION".
>> >
>> >After discussion with Ferruh, this patch is accepted as a hotfix.
>> >But this option is expected to be removed quickly.
>> >I've sent a patch to remove this option in 18.02:
>> >	http://dpdk.org/ml/archives/dev/2017-November/081488.html
>> >It gives you some time to supersede my patch by introducing a
>> >run-time driver option.
>> >
>> >Thanks
>> 
>> Hi Thomas,
>> Sure, thanks, we will address before 18.02-rc1.
>> Do you have any example on how to add a run-time driver option?
>> Does it mean to introduce some change in ethdev?
>
>It is done by parsing devargs with rte_kvargs.
>Examples:
>	http://dpdk.org/commit/447e0d379
>	http://dpdk.org/commit/001a520e4
>	http://dpdk.org/commit/7958b1310

Thanks Thomas.
>


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

end of thread, other threads:[~2017-11-08  2:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07  8:34 [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 1/8] net/qede: fix to disable per-VF Tx switching feature Rasesh Mody
2017-11-08  0:53   ` Thomas Monjalon
2017-11-08  1:34     ` Patil, Harish
2017-11-08  1:44       ` Thomas Monjalon
2017-11-08  2:34         ` Patil, Harish
2017-11-07  8:34 ` [dpdk-dev] [PATCH 2/8] net/qede: fix vxlan filter deletion Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 3/8] net/qede: fix to update device link structure Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 4/8] net/qede: remove duplicate includes Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 5/8] net/qede: fix to release the acquired ptt Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 6/8] net/qede/base: fix to initialize filter API return code Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 7/8] net/qede/base: fix division by zero Rasesh Mody
2017-11-07  8:34 ` [dpdk-dev] [PATCH 8/8] net/qede: fix null pointer dereferences Rasesh Mody
2017-11-07 22:53 ` [dpdk-dev] [PATCH 0/8] net/qede: coverity issue fixes and bug fixes Ferruh Yigit

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