patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling
@ 2017-04-25  7:28 Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Harish Patil, Dept-EngDPDKDev, stable

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

- In qede_mac_addr_set(), in order to configure default MAC address we
first delete the existing MAC address before trying to add new one. During
init time, there is no MAC filter to begin with, so trying to remove a
non-existing MAC address causes a firmware exception. This can be prevented
by internally calling qede_mac_addr_add() which has the checks in place to
delete a MAC address only if it was added before.

- Remove setting of the default MAC address from within
qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.

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

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_ethdev.c |   30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index fbad2a6..b31a7df 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -551,8 +551,6 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
-	struct ecore_filter_ucast ucast;
-	int rc;
 
 	if (IS_VF(edev) && !ecore_vf_check_mac(ECORE_LEADING_HWFN(edev),
 					       mac_addr->addr_bytes)) {
@@ -562,29 +560,7 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 		return;
 	}
 
-	/* First remove the primary mac */
-	qede_set_ucast_cmn_params(&ucast);
-	ucast.opcode = ECORE_FILTER_REMOVE;
-	ucast.type = ECORE_FILTER_MAC;
-	ether_addr_copy(&qdev->primary_mac,
-			(struct ether_addr *)&ucast.mac);
-	rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL);
-	if (rc != 0) {
-		DP_ERR(edev, "Unable to remove current macaddr"
-			     " Reverting to previous default mac\n");
-		ether_addr_copy(&qdev->primary_mac,
-				&eth_dev->data->mac_addrs[0]);
-		return;
-	}
-
-	/* Add new MAC */
-	ucast.opcode = ECORE_FILTER_ADD;
-	ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac);
-	rc = ecore_filter_ucast_cmd(edev, &ucast, ECORE_SPQ_MODE_CB, NULL);
-	if (rc != 0)
-		DP_ERR(edev, "Unable to add new default mac\n");
-	else
-		ether_addr_copy(mac_addr, &qdev->primary_mac);
+	qede_mac_addr_add(eth_dev, mac_addr, 0, 0);
 }
 
 static void qede_config_accept_any_vlan(struct qede_dev *qdev, bool action)
@@ -925,10 +901,6 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 	SLIST_INIT(&qdev->vlan_list_head);
 
-	/* Add primary mac for PF */
-	if (IS_PF(edev))
-		qede_mac_addr_set(eth_dev, &qdev->primary_mac);
-
 	/* Enable VLAN offloads by default */
 	qede_vlan_offload_set(eth_dev, ETH_VLAN_STRIP_MASK  |
 				       ETH_VLAN_FILTER_MASK |
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
@ 2017-04-25  7:28 ` Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 07/11] net/qede: fix FW version string display for SRIOV Rasesh Mody
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Harish Patil, Dept-EngDPDKDev, stable

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

Perform reset of the fastpath RX/TX rings after stopping device port and
not while starting the ports.

Fixes: cfe28a988565 ("net/qede: support unequal number of Rx/Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_rxtx.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index c6add0f..7623a01 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1712,10 +1712,6 @@ int qede_dev_start(struct rte_eth_dev *eth_dev)
 	/* Bring-up the link */
 	qede_dev_set_link_state(eth_dev, true);
 
-	/* Reset ring */
-	if (qede_reset_fp_rings(qdev))
-		return -ENOMEM;
-
 	/* Start/resume traffic */
 	qdev->ops->fastpath_start(edev);
 
@@ -1835,6 +1831,7 @@ static int qede_stop_queues(struct qede_dev *qdev)
 			}
 		}
 	}
+	qede_reset_fp_rings(qdev);
 
 	return 0;
 }
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 07/11] net/qede: fix FW version string display for SRIOV
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
@ 2017-04-25  7:28 ` Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 08/11] net/qede/base: fix coverity issues Rasesh Mody
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, Dept-EngDPDKDev, stable

In SRIOV testing, print adapter info shows firmware version used by PF,
this patch provides fix to populate correct firmware version used by VF.

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

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

diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 307b33a..d7847d1 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -359,11 +359,12 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	rte_memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
 	       ETHER_ADDR_LEN);
 
+	dev_info->fw_major = FW_MAJOR_VERSION;
+	dev_info->fw_minor = FW_MINOR_VERSION;
+	dev_info->fw_rev = FW_REVISION_VERSION;
+	dev_info->fw_eng = FW_ENGINEERING_VERSION;
+
 	if (IS_PF(edev)) {
-		dev_info->fw_major = FW_MAJOR_VERSION;
-		dev_info->fw_minor = FW_MINOR_VERSION;
-		dev_info->fw_rev = FW_REVISION_VERSION;
-		dev_info->fw_eng = FW_ENGINEERING_VERSION;
 		dev_info->mf_mode = edev->mf_mode;
 		dev_info->tx_switching = false;
 
@@ -384,10 +385,6 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 			ecore_ptt_release(ECORE_LEADING_HWFN(edev), ptt);
 		}
 	} else {
-		ecore_vf_get_fw_version(&edev->hwfns[0], &dev_info->fw_major,
-					&dev_info->fw_minor, &dev_info->fw_rev,
-					&dev_info->fw_eng);
-
 		ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
 				      &dev_info->mfw_rev, NULL);
 	}
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 08/11] net/qede/base: fix coverity issues
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 07/11] net/qede: fix FW version string display for SRIOV Rasesh Mody
@ 2017-04-25  7:28 ` Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 10/11] net/qede/base: fix find zero bit macro Rasesh Mody
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, Dept-EngDPDKDev, stable

Remove unused code to address coverity issues and
address a code flow issue.

Coverity issue: 1379468
Coverity issue: 1379521
Coverity issue: 1379522
Coverity issue: 1379523
Coverity issue: 1423918
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: ec94dbc57362 ("qede: add base driver")
Fixes: 2ea6f76aff40 ("qede: add core driver")
Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
 drivers/net/qede/base/ecore_cxt.c     |   90 ---------------------------------
 drivers/net/qede/base/ecore_cxt.h     |    4 --
 drivers/net/qede/base/ecore_cxt_api.h |   11 ----
 drivers/net/qede/base/ecore_iov_api.h |   11 ----
 drivers/net/qede/base/ecore_sriov.c   |   24 ---------
 drivers/net/qede/qede_main.c          |   10 +++-
 drivers/net/qede/qede_rxtx.c          |    1 -
 7 files changed, 8 insertions(+), 143 deletions(-)

diff --git a/drivers/net/qede/base/ecore_cxt.c b/drivers/net/qede/base/ecore_cxt.c
index 80ad102..688118b 100644
--- a/drivers/net/qede/base/ecore_cxt.c
+++ b/drivers/net/qede/base/ecore_cxt.c
@@ -2014,47 +2014,6 @@ enum _ecore_status_t ecore_cxt_set_pf_params(struct ecore_hwfn *p_hwfn)
 	return ECORE_SUCCESS;
 }
 
-enum _ecore_status_t ecore_cxt_get_tid_mem_info(struct ecore_hwfn *p_hwfn,
-						struct ecore_tid_mem *p_info)
-{
-	struct ecore_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr;
-	u32 proto, seg, total_lines, i, shadow_line;
-	struct ecore_ilt_client_cfg *p_cli;
-	struct ecore_ilt_cli_blk *p_fl_seg;
-	struct ecore_tid_seg *p_seg_info;
-
-	/* Verify the personality */
-	switch (p_hwfn->hw_info.personality) {
-	default:
-		return ECORE_INVAL;
-	}
-
-	p_cli = &p_mngr->clients[ILT_CLI_CDUT];
-	if (!p_cli->active)
-		return ECORE_INVAL;
-
-	p_seg_info = &p_mngr->conn_cfg[proto].tid_seg[seg];
-	if (!p_seg_info->has_fl_mem)
-		return ECORE_INVAL;
-
-	p_fl_seg = &p_cli->pf_blks[CDUT_FL_SEG_BLK(seg, PF)];
-	total_lines = DIV_ROUND_UP(p_fl_seg->total_size,
-				   p_fl_seg->real_size_in_page);
-
-	for (i = 0; i < total_lines; i++) {
-		shadow_line = i + p_fl_seg->start_line -
-		    p_hwfn->p_cxt_mngr->pf_start_line;
-		p_info->blocks[i] = p_mngr->ilt_shadow[shadow_line].p_virt;
-	}
-	p_info->waste = ILT_PAGE_IN_BYTES(p_cli->p_size.val) -
-	    p_fl_seg->real_size_in_page;
-	p_info->tid_size = p_mngr->task_type_size[p_seg_info->type];
-	p_info->num_tids_per_block = p_fl_seg->real_size_in_page /
-	    p_info->tid_size;
-
-	return ECORE_SUCCESS;
-}
-
 /* This function is very RoCE oriented, if another protocol in the future
  * will want this feature we'll need to modify the function to be more generic
  */
@@ -2292,52 +2251,3 @@ enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
 
 	return rc;
 }
-
-enum _ecore_status_t ecore_cxt_get_task_ctx(struct ecore_hwfn *p_hwfn,
-					    u32 tid,
-					    u8 ctx_type, void **pp_task_ctx)
-{
-	struct ecore_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr;
-	struct ecore_ilt_client_cfg *p_cli;
-	struct ecore_ilt_cli_blk *p_seg;
-	struct ecore_tid_seg *p_seg_info;
-	u32 proto, seg;
-	u32 total_lines;
-	u32 tid_size, ilt_idx;
-	u32 num_tids_per_block;
-
-	/* Verify the personality */
-	switch (p_hwfn->hw_info.personality) {
-	default:
-		return ECORE_INVAL;
-	}
-
-	p_cli = &p_mngr->clients[ILT_CLI_CDUT];
-	if (!p_cli->active)
-		return ECORE_INVAL;
-
-	p_seg_info = &p_mngr->conn_cfg[proto].tid_seg[seg];
-
-	if (ctx_type == ECORE_CTX_WORKING_MEM) {
-		p_seg = &p_cli->pf_blks[CDUT_SEG_BLK(seg)];
-	} else if (ctx_type == ECORE_CTX_FL_MEM) {
-		if (!p_seg_info->has_fl_mem)
-			return ECORE_INVAL;
-		p_seg = &p_cli->pf_blks[CDUT_FL_SEG_BLK(seg, PF)];
-	} else {
-		return ECORE_INVAL;
-	}
-	total_lines = DIV_ROUND_UP(p_seg->total_size, p_seg->real_size_in_page);
-	tid_size = p_mngr->task_type_size[p_seg_info->type];
-	num_tids_per_block = p_seg->real_size_in_page / tid_size;
-
-	if (total_lines < tid / num_tids_per_block)
-		return ECORE_INVAL;
-
-	ilt_idx = tid / num_tids_per_block + p_seg->start_line -
-	    p_mngr->pf_start_line;
-	*pp_task_ctx = (u8 *)p_mngr->ilt_shadow[ilt_idx].p_virt +
-	    (tid % num_tids_per_block) * tid_size;
-
-	return ECORE_SUCCESS;
-}
diff --git a/drivers/net/qede/base/ecore_cxt.h b/drivers/net/qede/base/ecore_cxt.h
index e678118..6ff823a 100644
--- a/drivers/net/qede/base/ecore_cxt.h
+++ b/drivers/net/qede/base/ecore_cxt.h
@@ -197,9 +197,5 @@ enum _ecore_status_t ecore_cxt_free_proto_ilt(struct ecore_hwfn *p_hwfn,
 
 #define ECORE_CTX_WORKING_MEM 0
 #define ECORE_CTX_FL_MEM 1
-enum _ecore_status_t ecore_cxt_get_task_ctx(struct ecore_hwfn *p_hwfn,
-					    u32 tid,
-					    u8 ctx_type,
-					    void **task_ctx);
 
 #endif /* _ECORE_CID_ */
diff --git a/drivers/net/qede/base/ecore_cxt_api.h b/drivers/net/qede/base/ecore_cxt_api.h
index f154e0d..6d87620 100644
--- a/drivers/net/qede/base/ecore_cxt_api.h
+++ b/drivers/net/qede/base/ecore_cxt_api.h
@@ -37,15 +37,4 @@ struct ecore_tid_mem {
 enum _ecore_status_t ecore_cxt_get_cid_info(struct ecore_hwfn *p_hwfn,
 					    struct ecore_cxt_info *p_info);
 
-/**
-* @brief ecore_cxt_get_tid_mem_info
-*
-* @param p_hwfn
-* @param p_info
-*
-* @return enum _ecore_status_t
-*/
-enum _ecore_status_t ecore_cxt_get_tid_mem_info(struct ecore_hwfn *p_hwfn,
-						struct ecore_tid_mem *p_info);
-
 #endif
diff --git a/drivers/net/qede/base/ecore_iov_api.h b/drivers/net/qede/base/ecore_iov_api.h
index 870c57e..50cb3f2 100644
--- a/drivers/net/qede/base/ecore_iov_api.h
+++ b/drivers/net/qede/base/ecore_iov_api.h
@@ -693,17 +693,6 @@ bool ecore_iov_is_vf_started(struct ecore_hwfn *p_hwfn,
  * @return - rate in Mbps
  */
 int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid);
-
-/**
- * @brief - Configure min rate for VF's vport.
- * @param p_dev
- * @param vfid
- * @param - rate in Mbps
- *
- * @return
- */
-enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev,
-						     int vfid, u32 rate);
 #endif
 
 /**
diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c
index 39d3e88..db2873e 100644
--- a/drivers/net/qede/base/ecore_sriov.c
+++ b/drivers/net/qede/base/ecore_sriov.c
@@ -4386,30 +4386,6 @@ enum _ecore_status_t ecore_iov_configure_tx_rate(struct ecore_hwfn *p_hwfn,
 	return ecore_init_vport_rl(p_hwfn, p_ptt, abs_vp_id, (u32)val);
 }
 
-enum _ecore_status_t ecore_iov_configure_min_tx_rate(struct ecore_dev *p_dev,
-						     int vfid, u32 rate)
-{
-	struct ecore_vf_info *vf;
-	u8 vport_id;
-	int i;
-
-	for_each_hwfn(p_dev, i) {
-		struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
-
-		if (!ecore_iov_pf_sanity_check(p_hwfn, vfid)) {
-			DP_NOTICE(p_hwfn, true,
-				  "SR-IOV sanity check failed,"
-				  " can't set min rate\n");
-			return ECORE_INVAL;
-		}
-	}
-
-	vf = ecore_iov_get_vf_info(ECORE_LEADING_HWFN(p_dev), (u16)vfid, true);
-	vport_id = vf->vport_id;
-
-	return ecore_configure_vport_wfq(p_dev, vport_id, rate);
-}
-
 enum _ecore_status_t ecore_iov_get_vf_stats(struct ecore_hwfn *p_hwfn,
 					    struct ecore_ptt *p_ptt,
 					    int vfid,
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index d7847d1..009dbb4 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -265,7 +265,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 		if (rc) {
 			DP_NOTICE(edev, true,
 			"Failed to allocate stream memory\n");
-			goto err2;
+			goto err1;
 		}
 	}
 
@@ -306,7 +306,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 		if (rc) {
 			DP_NOTICE(edev, true,
 				  "Failed sending drv version command\n");
-			return rc;
+			goto err3;
 		}
 	}
 
@@ -314,8 +314,14 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 
 	return 0;
 
+err3:
 	ecore_hw_stop(edev);
 err2:
+	qed_stop_iov_task(edev);
+#ifdef CONFIG_ECORE_ZIPPED_FW
+	qed_free_stream_mem(edev);
+err1:
+#endif
 	ecore_resc_free(edev);
 err:
 #ifdef CONFIG_ECORE_BINARY_FW
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 191d8af..47ebba7 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -1501,7 +1501,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 
 		/* Fill the entry in the SW ring and the BDs in the FW ring */
 		idx = TX_PROD(txq);
-		*tx_pkts++;
 		txq->sw_tx_ring[idx].mbuf = mbuf;
 
 		/* BD1 */
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 10/11] net/qede/base: fix find zero bit macro
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
                   ` (2 preceding siblings ...)
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 08/11] net/qede/base: fix coverity issues Rasesh Mody
@ 2017-04-25  7:28 ` Rasesh Mody
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
  2017-04-26  8:15 ` [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Ferruh Yigit
  5 siblings, 0 replies; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, Dept-EngDPDKDev, stable

Use appropriate operater for if condition

Coverity issue: 1379399
Coverity issue: 1379404
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.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 28be958..3f895cd 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -98,9 +98,7 @@ inline u32 qede_find_first_zero_bit(unsigned long *addr, u32 limit)
 	u32 nwords = 0;
 	OSAL_BUILD_BUG_ON(!limit);
 	nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
-	for (i = 0; i < nwords; i++)
-		if (~(addr[i] != 0))
-			break;
+	for (i = 0; i < nwords && ~(addr[i]) == 0; i++);
 	return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffz(addr[i]);
 }
 
-- 
1.7.10.3

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

* [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
                   ` (3 preceding siblings ...)
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 10/11] net/qede/base: fix find zero bit macro Rasesh Mody
@ 2017-04-25  7:28 ` Rasesh Mody
  2017-05-02  6:15   ` Yuanhan Liu
  2017-04-26  8:15 ` [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Ferruh Yigit
  5 siblings, 1 reply; 11+ messages in thread
From: Rasesh Mody @ 2017-04-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: Rasesh Mody, Dept-EngDPDKDev, stable

From: Rasesh Mody <rasesh.mody@qlogic.com>

Changes included in this fix
 - limit CFLAGS to base files
 - fix to remove/mark unused members
 - add checks for debug config option
 - make qede_set_mtu() and qede_udp_dst_port_del() static and others
   non-static as appropriate
 - move local APIs qede_vlan_offload_set() and qede_rx_cqe_to_pkt_type()
 - initialize variables as required

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

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/qede/Makefile             |   32 ++++-----
 drivers/net/qede/base/ecore.h         |    4 +-
 drivers/net/qede/base/ecore_int_api.h |    4 +-
 drivers/net/qede/qede_ethdev.c        |  120 ++++++++++++++++++---------------
 drivers/net/qede/qede_ethdev.h        |   32 ++++-----
 drivers/net/qede/qede_fdir.c          |   13 +---
 drivers/net/qede/qede_if.h            |    4 ++
 drivers/net/qede/qede_main.c          |    8 +--
 drivers/net/qede/qede_rxtx.c          |  118 +++++++++++++++++---------------
 9 files changed, 171 insertions(+), 164 deletions(-)

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
index da7968f..8acef00 100644
--- a/drivers/net/qede/Makefile
+++ b/drivers/net/qede/Makefile
@@ -76,25 +76,27 @@ endif
 #
 #
 BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))
-$(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS+=$(CFLAGS_BASE_DRIVER)))
+$(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
+
+VPATH += $(SRCDIR)/base
 
 #
 # all source are stored in SRCS-y
 #
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dev.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_hw.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_cxt.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_l2.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sp_commands.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_fw_funcs.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_spq.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_ops.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dcbx.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sriov.c
-SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_vf.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_dev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_hw.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_cxt.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_l2.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_sp_commands.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_init_fw_funcs.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_spq.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_init_ops.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_mcp.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_int.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_dcbx.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += bcm_osal.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_sriov.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_vf.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_eth_if.c
 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index 63cbc38..80b11a4 100644
--- a/drivers/net/qede/base/ecore.h
+++ b/drivers/net/qede/base/ecore.h
@@ -808,8 +808,8 @@ struct ecore_dev {
  *
  * @return OSAL_INLINE u8
  */
-static OSAL_INLINE u8 ecore_concrete_to_sw_fid(struct ecore_dev *p_dev,
-					  u32 concrete_fid)
+static OSAL_INLINE u8
+ecore_concrete_to_sw_fid(__rte_unused struct ecore_dev *p_dev, u32 concrete_fid)
 {
 	u8 vfid     = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_VFID);
 	u8 pfid     = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID);
diff --git a/drivers/net/qede/base/ecore_int_api.h b/drivers/net/qede/base/ecore_int_api.h
index fdfcba8..799fbe8 100644
--- a/drivers/net/qede/base/ecore_int_api.h
+++ b/drivers/net/qede/base/ecore_int_api.h
@@ -114,7 +114,7 @@ static OSAL_INLINE void __internal_ram_wr(struct ecore_hwfn *p_hwfn,
 					  void OSAL_IOMEM *addr,
 					  int size, u32 *data)
 #else
-static OSAL_INLINE void __internal_ram_wr(void *p_hwfn,
+static OSAL_INLINE void __internal_ram_wr(__rte_unused void *p_hwfn,
 					  void OSAL_IOMEM *addr,
 					  int size, u32 *data)
 #endif
@@ -130,7 +130,7 @@ static OSAL_INLINE void __internal_ram_wr_relaxed(struct ecore_hwfn *p_hwfn,
 						  void OSAL_IOMEM * addr,
 						  int size, u32 *data)
 #else
-static OSAL_INLINE void __internal_ram_wr_relaxed(void *p_hwfn,
+static OSAL_INLINE void __internal_ram_wr_relaxed(__rte_unused void *p_hwfn,
 						  void OSAL_IOMEM * addr,
 						  int size, u32 *data)
 #endif
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index fdb6bb1..7056fed 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -298,6 +298,7 @@ static void qede_interrupt_action(struct ecore_hwfn *p_hwfn)
 	qdev->ops = qed_ops;
 }
 
+#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
 static void qede_print_adapter_info(struct qede_dev *qdev)
 {
 	struct ecore_dev *edev = &qdev->edev;
@@ -326,6 +327,7 @@ static void qede_print_adapter_info(struct qede_dev *qdev)
 	DP_INFO(edev, " Firmware file : %s\n", fw_file);
 	DP_INFO(edev, "*********************************\n");
 }
+#endif
 
 static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast)
 {
@@ -508,7 +510,7 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 
 static void
 qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr,
-		  uint32_t index, __rte_unused uint32_t pool)
+		  __rte_unused uint32_t index, __rte_unused uint32_t pool)
 {
 	struct ecore_filter_ucast ucast;
 
@@ -523,9 +525,7 @@ static void qede_set_cmn_tunn_param(struct ecore_tunnel_info *p_tunn,
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
-	struct ether_addr mac_addr;
 	struct ecore_filter_ucast ucast;
-	int rc;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
@@ -609,46 +609,6 @@ static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool set_stripping)
 	return 0;
 }
 
-static void qede_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
-{
-	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
-	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
-	struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
-
-	if (mask & ETH_VLAN_STRIP_MASK) {
-		if (rxmode->hw_vlan_strip)
-			(void)qede_vlan_stripping(eth_dev, 1);
-		else
-			(void)qede_vlan_stripping(eth_dev, 0);
-	}
-
-	if (mask & ETH_VLAN_FILTER_MASK) {
-		/* VLAN filtering kicks in when a VLAN is added */
-		if (rxmode->hw_vlan_filter) {
-			qede_vlan_filter_set(eth_dev, 0, 1);
-		} else {
-			if (qdev->configured_vlans > 1) { /* Excluding VLAN0 */
-				DP_ERR(edev,
-				  " Please remove existing VLAN filters"
-				  " before disabling VLAN filtering\n");
-				/* Signal app that VLAN filtering is still
-				 * enabled
-				 */
-				rxmode->hw_vlan_filter = true;
-			} else {
-				qede_vlan_filter_set(eth_dev, 0, 0);
-			}
-		}
-	}
-
-	if (mask & ETH_VLAN_EXTEND_MASK)
-		DP_INFO(edev, "No offloads are supported with VLAN Q-in-Q"
-			" and classification is based on outer tag only\n");
-
-	DP_INFO(edev, "vlan offload mask %d vlan-strip %d vlan-filter %d\n",
-		mask, rxmode->hw_vlan_strip, rxmode->hw_vlan_filter);
-}
-
 static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
 				uint16_t vlan_id, int on)
 {
@@ -739,6 +699,46 @@ static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
 	return rc;
 }
 
+static void qede_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
+{
+	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+	struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
+
+	if (mask & ETH_VLAN_STRIP_MASK) {
+		if (rxmode->hw_vlan_strip)
+			(void)qede_vlan_stripping(eth_dev, 1);
+		else
+			(void)qede_vlan_stripping(eth_dev, 0);
+	}
+
+	if (mask & ETH_VLAN_FILTER_MASK) {
+		/* VLAN filtering kicks in when a VLAN is added */
+		if (rxmode->hw_vlan_filter) {
+			qede_vlan_filter_set(eth_dev, 0, 1);
+		} else {
+			if (qdev->configured_vlans > 1) { /* Excluding VLAN0 */
+				DP_ERR(edev,
+				  " Please remove existing VLAN filters"
+				  " before disabling VLAN filtering\n");
+				/* Signal app that VLAN filtering is still
+				 * enabled
+				 */
+				rxmode->hw_vlan_filter = true;
+			} else {
+				qede_vlan_filter_set(eth_dev, 0, 0);
+			}
+		}
+	}
+
+	if (mask & ETH_VLAN_EXTEND_MASK)
+		DP_INFO(edev, "No offloads are supported with VLAN Q-in-Q"
+			" and classification is based on outer tag only\n");
+
+	DP_INFO(edev, "vlan offload mask %d vlan-strip %d vlan-filter %d\n",
+		mask, rxmode->hw_vlan_strip, rxmode->hw_vlan_filter);
+}
+
 static int qede_init_vport(struct qede_dev *qdev)
 {
 	struct ecore_dev *edev = &qdev->edev;
@@ -778,7 +778,9 @@ static void qede_prandom_bytes(uint32_t *buff)
 int qede_config_rss(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+#endif
 	uint32_t def_rss_key[ECORE_RSS_KEY_SIZE];
 	struct rte_eth_rss_reta_entry64 reta_conf[2];
 	struct rte_eth_rss_conf rss_conf;
@@ -819,7 +821,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 	struct rte_eth_rxmode *rxmode = &eth_dev->data->dev_conf.rxmode;
-	int rc, i, j;
+	int rc;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
@@ -1045,10 +1047,12 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 static void qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
 {
+#ifdef RTE_LIBRTE_QEDE_DEBUG_INIT
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 
 	PMD_INIT_FUNC_TRACE(edev);
+#endif
 
 	enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
 
@@ -1060,10 +1064,12 @@ static void qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
 
 static void qede_promiscuous_disable(struct rte_eth_dev *eth_dev)
 {
+#ifdef RTE_LIBRTE_QEDE_DEBUG_INIT
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
 
 	PMD_INIT_FUNC_TRACE(edev);
+#endif
 
 	if (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)
 		qed_configure_filter_rx_mode(eth_dev,
@@ -1180,8 +1186,8 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 			       RTE_ETHDEV_QUEUE_STAT_CNTRS);
 	txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(qdev),
 			       RTE_ETHDEV_QUEUE_STAT_CNTRS);
-	if ((rxq_stat_cntrs != QEDE_RSS_COUNT(qdev)) ||
-	    (txq_stat_cntrs != QEDE_TSS_COUNT(qdev)))
+	if ((rxq_stat_cntrs != (unsigned int)QEDE_RSS_COUNT(qdev)) ||
+	    (txq_stat_cntrs != (unsigned int)QEDE_TSS_COUNT(qdev)))
 		DP_VERBOSE(edev, ECORE_MSG_DEBUG,
 		       "Not all the queue stats will be displayed. Set"
 		       " RTE_ETHDEV_QUEUE_STAT_CNTRS config param"
@@ -1234,7 +1240,8 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 
 static int
 qede_get_xstats_names(__rte_unused struct rte_eth_dev *dev,
-		      struct rte_eth_xstat_name *xstats_names, unsigned limit)
+		      struct rte_eth_xstat_name *xstats_names,
+		      __rte_unused unsigned int limit)
 {
 	struct qede_dev *qdev = dev->data->dev_private;
 	const unsigned int stat_cnt = qede_get_xstats_count(qdev);
@@ -1462,8 +1469,8 @@ static void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf)
 	*rss_caps |= (hf & ETH_RSS_NONFRAG_IPV6_UDP)  ? ECORE_RSS_IPV6_UDP : 0;
 }
 
-static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
-				struct rte_eth_rss_conf *rss_conf)
+int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
+			 struct rte_eth_rss_conf *rss_conf)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
@@ -1567,9 +1574,9 @@ static int qede_rss_hash_conf_get(struct rte_eth_dev *eth_dev,
 	return 0;
 }
 
-static int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
-				struct rte_eth_rss_reta_entry64 *reta_conf,
-				uint16_t reta_size)
+int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
+			 struct rte_eth_rss_reta_entry64 *reta_conf,
+			 uint16_t reta_size)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
@@ -1655,7 +1662,7 @@ static int qede_rss_reta_query(struct rte_eth_dev *eth_dev,
 	return 0;
 }
 
-int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
+static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(dev);
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
@@ -1749,14 +1756,14 @@ int qede_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 	return 0;
 }
 
-int
+static int
 qede_udp_dst_port_del(struct rte_eth_dev *eth_dev,
 		      struct rte_eth_udp_tunnel *tunnel_udp)
 {
 	return qede_conf_udp_dst_port(eth_dev, tunnel_udp, false);
 }
 
-int
+static int
 qede_udp_dst_port_add(struct rte_eth_dev *eth_dev,
 		      struct rte_eth_udp_tunnel *tunnel_udp)
 {
@@ -2090,7 +2097,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	/* Fix up ecore debug level */
 	uint32_t dp_module = ~0 & ~ECORE_MSG_HW;
 	uint8_t dp_level = ECORE_LEVEL_VERBOSE;
-	uint32_t max_mac_addrs;
 	int rc;
 
 	/* Extract key data structures */
@@ -2248,7 +2254,9 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 	eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops;
 
 	if (do_once) {
+#ifdef RTE_LIBRTE_QEDE_DEBUG_INFO
 		qede_print_adapter_info(adapter);
+#endif
 		do_once = false;
 	}
 
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 6d5e616..26b6332 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -215,29 +215,16 @@ struct qede_dev {
 	char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
 };
 
-/* Static functions */
-static int qede_vlan_filter_set(struct rte_eth_dev *eth_dev,
-				uint16_t vlan_id, int on);
-
-static int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
-				struct rte_eth_rss_conf *rss_conf);
-
-static int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
-				struct rte_eth_rss_reta_entry64 *reta_conf,
-				uint16_t reta_size);
-
-static void qede_init_rss_caps(uint8_t *rss_caps, uint64_t hf);
-
-static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags);
-
-static uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev,
-					struct rte_eth_fdir_filter *fdir,
-					void *buff,
-					struct ecore_arfs_config_params *param);
-
 /* Non-static functions */
 int qede_config_rss(struct rte_eth_dev *eth_dev);
 
+int qede_rss_hash_update(struct rte_eth_dev *eth_dev,
+			 struct rte_eth_rss_conf *rss_conf);
+
+int qede_rss_reta_update(struct rte_eth_dev *eth_dev,
+			 struct rte_eth_rss_reta_entry64 *reta_conf,
+			 uint16_t reta_size);
+
 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);
@@ -253,6 +240,11 @@ int qede_ntuple_filter_conf(struct rte_eth_dev *eth_dev,
 
 int qede_check_fdir_support(struct rte_eth_dev *eth_dev);
 
+uint16_t qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev,
+				 struct rte_eth_fdir_filter *fdir,
+				 void *buff,
+				 struct ecore_arfs_config_params *params);
+
 void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev);
 
 #endif /* _QEDE_ETHDEV_H_ */
diff --git a/drivers/net/qede/qede_fdir.c b/drivers/net/qede/qede_fdir.c
index 18fb8d6..7bd5c5d 100644
--- a/drivers/net/qede/qede_fdir.c
+++ b/drivers/net/qede/qede_fdir.c
@@ -74,9 +74,7 @@ int qede_check_fdir_support(struct rte_eth_dev *eth_dev)
 void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
-	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	struct qede_fdir_entry *tmp = NULL;
-	struct qede_fdir_entry *fdir;
 
 	SLIST_FOREACH(tmp, &qdev->fdir_info.fdir_list_head, list) {
 		if (tmp) {
@@ -98,12 +96,11 @@ void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	char mz_name[RTE_MEMZONE_NAMESIZE] = {0};
 	struct qede_fdir_entry *tmp = NULL;
-	struct qede_fdir_entry *fdir;
+	struct qede_fdir_entry *fdir = NULL;
 	const struct rte_memzone *mz;
 	struct ecore_hwfn *p_hwfn;
 	enum _ecore_status_t rc;
 	uint16_t pkt_len;
-	uint16_t len;
 	void *pkt;
 
 	if (add) {
@@ -251,7 +248,7 @@ void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
 }
 
 /* Fills the L3/L4 headers and returns the actual length  of flowdir packet */
-static uint16_t
+uint16_t
 qede_fdir_construct_pkt(struct rte_eth_dev *eth_dev,
 			struct rte_eth_fdir_filter *fdir,
 			void *buff,
@@ -268,8 +265,6 @@ void qede_fdir_dealloc_resc(struct rte_eth_dev *eth_dev)
 	struct ipv6_hdr *ip6;
 	struct udp_hdr *udp;
 	struct tcp_hdr *tcp;
-	struct sctp_hdr *sctp;
-	uint8_t size, dst = 0;
 	uint16_t len;
 	static const uint8_t next_proto[] = {
 		[RTE_ETH_FLOW_NONFRAG_IPV4_TCP] = IPPROTO_TCP,
@@ -425,8 +420,7 @@ int qede_ntuple_filter_conf(struct rte_eth_dev *eth_dev,
 	struct rte_eth_fdir_filter fdir_entry;
 	struct rte_eth_tcpv4_flow *tcpv4_flow;
 	struct rte_eth_udpv4_flow *udpv4_flow;
-	struct ecore_hwfn *p_hwfn;
-	bool add;
+	bool add = false;
 
 	switch (filter_op) {
 	case RTE_ETH_FILTER_NOP:
@@ -440,7 +434,6 @@ int qede_ntuple_filter_conf(struct rte_eth_dev *eth_dev,
 		add = true;
 	break;
 	case RTE_ETH_FILTER_DELETE:
-		add = false;
 	break;
 	case RTE_ETH_FILTER_INFO:
 	case RTE_ETH_FILTER_GET:
diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h
index 09b6912..405c525 100644
--- a/drivers/net/qede/qede_if.h
+++ b/drivers/net/qede/qede_if.h
@@ -198,6 +198,10 @@ struct qed_common_ops {
 			    dma_addr_t sb_phy_addr,
 			    uint16_t sb_id, enum qed_sb_type type);
 
+	int (*get_sb_info)(struct ecore_dev *edev,
+			   struct ecore_sb_info *sb, u16 qid,
+			   struct ecore_sb_info_dbg *sb_dbg);
+
 	bool (*can_link_change)(struct ecore_dev *edev);
 
 	void (*update_msglvl)(struct ecore_dev *edev,
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 009dbb4..712c03f 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -74,7 +74,7 @@ static void qed_init_pci(struct ecore_dev *edev, struct rte_pci_device *pci_dev)
 
 static int qed_nic_setup(struct ecore_dev *edev)
 {
-	int rc, i;
+	int rc;
 
 	rc = ecore_resc_alloc(edev);
 	if (rc)
@@ -226,7 +226,6 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	struct ecore_hwfn *hwfn;
 	struct ecore_mcp_drv_version drv_version;
 	struct ecore_hw_init_params hw_init_params;
-	struct qede_dev *qdev = (struct qede_dev *)edev;
 	struct ecore_ptt *p_ptt;
 	int rc;
 
@@ -268,9 +267,9 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 			goto err1;
 		}
 	}
+#endif
 
 	qed_start_iov_task(edev);
-#endif
 
 #ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev))
@@ -401,7 +400,6 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 int
 qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
 {
-	struct qede_dev *qdev = (struct qede_dev *)edev;
 	uint8_t queues = 0;
 	int i;
 
@@ -498,7 +496,6 @@ static void qed_fill_link(struct ecore_hwfn *hwfn,
 	struct ecore_mcp_link_params params;
 	struct ecore_mcp_link_state link;
 	struct ecore_mcp_link_capabilities link_caps;
-	uint32_t media_type;
 	uint8_t change = 0;
 
 	memset(if_link, 0, sizeof(*if_link));
@@ -732,6 +729,7 @@ static int qed_get_sb_info(struct ecore_dev *edev, struct ecore_sb_info *sb,
 	INIT_STRUCT_FIELD(chain_alloc, &ecore_chain_alloc),
 	INIT_STRUCT_FIELD(chain_free, &ecore_chain_free),
 	INIT_STRUCT_FIELD(sb_init, &qed_sb_init),
+	INIT_STRUCT_FIELD(get_sb_info, &qed_get_sb_info),
 	INIT_STRUCT_FIELD(get_link, &qed_get_current_link),
 	INIT_STRUCT_FIELD(set_link, &qed_set_link),
 	INIT_STRUCT_FIELD(drain, &qed_drain),
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 47ebba7..83e1bc4 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -83,7 +83,7 @@ static void qede_tx_queue_release_mbufs(struct qede_tx_queue *txq)
 int
 qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		    uint16_t nb_desc, unsigned int socket_id,
-		    const struct rte_eth_rxconf *rx_conf,
+		    __rte_unused const struct rte_eth_rxconf *rx_conf,
 		    struct rte_mempool *mp)
 {
 	struct qede_dev *qdev = dev->data->dev_private;
@@ -330,8 +330,8 @@ void qede_tx_queue_release(void *tx_queue)
 static void qede_init_fp(struct qede_dev *qdev)
 {
 	struct qede_fastpath *fp;
-	uint8_t i, rss_id, tc;
-	int fp_rx = qdev->fp_num_rx, rxq = 0, txq = 0;
+	uint8_t i;
+	int fp_rx = qdev->fp_num_rx;
 
 	memset((void *)qdev->fp_array, 0, (QEDE_QUEUE_CNT(qdev) *
 					   sizeof(*qdev->fp_array)));
@@ -367,11 +367,9 @@ void qede_free_fp_arrays(struct qede_dev *qdev)
 	}
 }
 
-int qede_alloc_fp_array(struct qede_dev *qdev)
+static int qede_alloc_fp_array(struct qede_dev *qdev)
 {
-	struct qede_fastpath *fp;
 	struct ecore_dev *edev = &qdev->edev;
-	int i;
 
 	qdev->fp_array = rte_calloc("fp", QEDE_QUEUE_CNT(qdev),
 				    sizeof(*qdev->fp_array),
@@ -477,7 +475,8 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev)
 }
 
 static inline void
-qede_update_rx_prod(struct qede_dev *edev, struct qede_rx_queue *rxq)
+qede_update_rx_prod(__rte_unused struct qede_dev *edev,
+		    struct qede_rx_queue *rxq)
 {
 	uint16_t bd_prod = ecore_chain_get_prod_idx(&rxq->rx_bd_ring);
 	uint16_t cqe_prod = ecore_chain_get_prod_idx(&rxq->rx_comp_ring);
@@ -534,7 +533,8 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev)
 	sge_tpa_params->tpa_min_size_to_cont = mtu / 2;
 }
 
-static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
+static int qede_start_queues(struct rte_eth_dev *eth_dev,
+			     __rte_unused bool clear_stats)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
@@ -547,7 +547,6 @@ static int qede_start_queues(struct rte_eth_dev *eth_dev, bool clear_stats)
 	dma_addr_t p_phys_table;
 	int txq_index;
 	uint16_t page_cnt;
-	int vlan_removal_en = 1;
 	int rc, tc, i;
 
 	for_each_queue(i) {
@@ -700,6 +699,33 @@ static inline uint8_t qede_check_notunn_csum_l4(uint16_t flag)
 	return 0;
 }
 
+static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)
+{
+	uint16_t val;
+
+	/* Lookup table */
+	static const uint32_t
+	ptype_lkup_tbl[QEDE_PKT_TYPE_MAX] __rte_cache_aligned = {
+		[QEDE_PKT_TYPE_IPV4] = RTE_PTYPE_L3_IPV4,
+		[QEDE_PKT_TYPE_IPV6] = RTE_PTYPE_L3_IPV6,
+		[QEDE_PKT_TYPE_IPV4_TCP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP,
+		[QEDE_PKT_TYPE_IPV6_TCP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP,
+		[QEDE_PKT_TYPE_IPV4_UDP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP,
+		[QEDE_PKT_TYPE_IPV6_UDP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP,
+	};
+
+	/* Bits (0..3) provides L3/L4 protocol type */
+	val = ((PARSING_AND_ERR_FLAGS_L3TYPE_MASK <<
+	       PARSING_AND_ERR_FLAGS_L3TYPE_SHIFT) |
+	       (PARSING_AND_ERR_FLAGS_L4PROTOCOL_MASK <<
+		PARSING_AND_ERR_FLAGS_L4PROTOCOL_SHIFT)) & flags;
+
+	if (val < QEDE_PKT_TYPE_MAX)
+		return ptype_lkup_tbl[val] | RTE_PTYPE_L2_ETHER;
+	else
+		return RTE_PTYPE_UNKNOWN;
+}
+
 static inline uint8_t
 qede_check_notunn_csum_l3(struct rte_mbuf *m, uint16_t flag)
 {
@@ -735,7 +761,7 @@ static inline void qede_rx_bd_ring_consume(struct qede_rx_queue *rxq)
 }
 
 static inline void
-qede_reuse_page(struct qede_dev *qdev,
+qede_reuse_page(__rte_unused struct qede_dev *qdev,
 		struct qede_rx_queue *rxq, struct qede_rx_entry *curr_cons)
 {
 	struct eth_rx_bd *rx_bd_prod = ecore_chain_produce(&rxq->rx_bd_ring);
@@ -768,39 +794,11 @@ static inline void qede_rx_bd_ring_consume(struct qede_rx_queue *rxq)
 	}
 }
 
-static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)
-{
-	uint16_t val;
-
-	/* Lookup table */
-	static const uint32_t
-	ptype_lkup_tbl[QEDE_PKT_TYPE_MAX] __rte_cache_aligned = {
-		[QEDE_PKT_TYPE_IPV4] = RTE_PTYPE_L3_IPV4,
-		[QEDE_PKT_TYPE_IPV6] = RTE_PTYPE_L3_IPV6,
-		[QEDE_PKT_TYPE_IPV4_TCP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP,
-		[QEDE_PKT_TYPE_IPV6_TCP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP,
-		[QEDE_PKT_TYPE_IPV4_UDP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP,
-		[QEDE_PKT_TYPE_IPV6_UDP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP,
-	};
-
-	/* Bits (0..3) provides L3/L4 protocol type */
-	val = ((PARSING_AND_ERR_FLAGS_L3TYPE_MASK <<
-	       PARSING_AND_ERR_FLAGS_L3TYPE_SHIFT) |
-	       (PARSING_AND_ERR_FLAGS_L4PROTOCOL_MASK <<
-		PARSING_AND_ERR_FLAGS_L4PROTOCOL_SHIFT)) & flags;
-
-	if (val < QEDE_PKT_TYPE_MAX)
-		return ptype_lkup_tbl[val] | RTE_PTYPE_L2_ETHER;
-	else
-		return RTE_PTYPE_UNKNOWN;
-}
-
 static inline void
-qede_rx_process_tpa_cmn_cont_end_cqe(struct qede_dev *qdev,
+qede_rx_process_tpa_cmn_cont_end_cqe(__rte_unused struct qede_dev *qdev,
 				     struct qede_rx_queue *rxq,
 				     uint8_t agg_index, uint16_t len)
 {
-	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	struct qede_agg_info *tpa_info;
 	struct rte_mbuf *curr_frag; /* Pointer to currently filled TPA seg */
 	uint16_t cons_idx;
@@ -845,13 +843,11 @@ static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)
 			    struct qede_rx_queue *rxq,
 			    struct eth_fast_path_rx_tpa_end_cqe *cqe)
 {
-	struct qede_agg_info *tpa_info;
 	struct rte_mbuf *rx_mb; /* Pointer to head of the chained agg */
 
 	qede_rx_process_tpa_cmn_cont_end_cqe(qdev, rxq, cqe->tpa_agg_index,
 					     cqe->len_list[0]);
 	/* Update total length and frags based on end TPA */
-	tpa_info = &rxq->tpa_info[cqe->tpa_agg_index];
 	rx_mb = rxq->tpa_info[cqe->tpa_agg_index].tpa_head;
 	/* TODO:  Add Sanity Checks */
 	rx_mb->nb_segs = cqe->num_of_bds;
@@ -930,7 +926,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 {
 	struct qede_rx_queue *rxq = p_rxq;
 	struct qede_dev *qdev = rxq->qdev;
-	struct ecore_dev *edev = &qdev->edev;
 	register struct rte_mbuf *seg1 = NULL;
 	register struct rte_mbuf *seg2 = NULL;
 	uint16_t sw_rx_index;
@@ -970,17 +965,19 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 	uint16_t hw_comp_cons, sw_comp_cons, sw_rx_index;
 	uint16_t rx_pkt = 0;
 	union eth_rx_cqe *cqe;
-	struct eth_fast_path_rx_reg_cqe *fp_cqe;
+	struct eth_fast_path_rx_reg_cqe *fp_cqe = NULL;
 	register struct rte_mbuf *rx_mb = NULL;
 	register struct rte_mbuf *seg1 = NULL;
 	enum eth_rx_cqe_type cqe_type;
-	uint16_t pkt_len; /* Sum of all BD segments */
+	uint16_t pkt_len = 0; /* Sum of all BD segments */
 	uint16_t len; /* Length of first BD */
 	uint8_t num_segs = 1;
 	uint16_t preload_idx;
-	uint8_t csum_flag;
 	uint16_t parse_flag;
+#ifdef RTE_LIBRTE_QEDE_DEBUG_RX
+	uint8_t bitfield_val;
 	enum rss_hash_type htype;
+#endif
 	uint8_t tunn_parse_flag;
 	uint8_t j;
 	struct eth_fast_path_rx_tpa_start_cqe *cqe_start_tpa;
@@ -988,9 +985,8 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 	uint32_t packet_type;
 	uint16_t vlan_tci;
 	bool tpa_start_flg;
-	uint8_t bitfield_val;
 	uint8_t offset, tpa_agg_idx, flags;
-	struct qede_agg_info *tpa_info;
+	struct qede_agg_info *tpa_info = NULL;
 	uint32_t rss_hash;
 
 	hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr);
@@ -1066,24 +1062,28 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 		/* Handle regular CQE or TPA start CQE */
 		if (!tpa_start_flg) {
 			parse_flag = rte_le_to_cpu_16(fp_cqe->pars_flags.flags);
-			bitfield_val = fp_cqe->bitfields;
 			offset = fp_cqe->placement_offset;
 			len = rte_le_to_cpu_16(fp_cqe->len_on_first_bd);
 			pkt_len = rte_le_to_cpu_16(fp_cqe->pkt_len);
 			vlan_tci = rte_le_to_cpu_16(fp_cqe->vlan_tag);
 			rss_hash = rte_le_to_cpu_32(fp_cqe->rss_hash);
+#ifdef RTE_LIBRTE_QEDE_DEBUG_RX
+			bitfield_val = fp_cqe->bitfields;
 			htype = (uint8_t)GET_FIELD(bitfield_val,
 					ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE);
+#endif
 		} else {
 			parse_flag =
 			    rte_le_to_cpu_16(cqe_start_tpa->pars_flags.flags);
-			bitfield_val = cqe_start_tpa->bitfields;
 			offset = cqe_start_tpa->placement_offset;
 			/* seg_len = len_on_first_bd */
 			len = rte_le_to_cpu_16(cqe_start_tpa->len_on_first_bd);
 			vlan_tci = rte_le_to_cpu_16(cqe_start_tpa->vlan_tag);
+#ifdef RTE_LIBRTE_QEDE_DEBUG_RX
+			bitfield_val = cqe_start_tpa->bitfields;
 			htype = (uint8_t)GET_FIELD(bitfield_val,
 				ETH_FAST_PATH_RX_TPA_START_CQE_RSS_HASH_TYPE);
+#endif
 			rss_hash = rte_le_to_cpu_32(cqe_start_tpa->rss_hash);
 		}
 		if (qede_tunn_exist(parse_flag)) {
@@ -1241,7 +1241,6 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 	struct rte_mbuf *mbuf;
 	uint16_t nb_segs;
 	uint16_t idx;
-	uint8_t nbds;
 
 	idx = TX_CONS(txq);
 	mbuf = txq->sw_tx_ring[idx].mbuf;
@@ -1265,16 +1264,21 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 }
 
 static inline void
-qede_process_tx_compl(struct ecore_dev *edev, struct qede_tx_queue *txq)
+qede_process_tx_compl(__rte_unused struct ecore_dev *edev,
+		      struct qede_tx_queue *txq)
 {
 	uint16_t hw_bd_cons;
+#ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 	uint16_t sw_tx_cons;
+#endif
 
 	rte_compiler_barrier();
 	hw_bd_cons = rte_le_to_cpu_16(*txq->hw_cons_ptr);
+#ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 	sw_tx_cons = ecore_chain_get_cons_idx(&txq->tx_pbl);
 	PMD_TX_LOG(DEBUG, txq, "Tx Completions = %u\n",
 		   abs(hw_bd_cons - sw_tx_cons));
+#endif
 	while (hw_bd_cons !=  ecore_chain_get_cons_idx(&txq->tx_pbl))
 		qede_free_tx_pkt(txq);
 }
@@ -1361,10 +1365,16 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 
 /* TX prepare to check packets meets TX conditions */
 uint16_t
+#ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 qede_xmit_prep_pkts(void *p_txq, struct rte_mbuf **tx_pkts,
 		    uint16_t nb_pkts)
 {
 	struct qede_tx_queue *txq = p_txq;
+#else
+qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,
+		    uint16_t nb_pkts)
+{
+#endif
 	uint64_t ol_flags;
 	struct rte_mbuf *m;
 	uint16_t i;
@@ -1411,9 +1421,11 @@ static inline uint32_t qede_rx_cqe_to_tunn_pkt_type(uint16_t flags)
 		}
 	}
 
+#ifdef RTE_LIBRTE_QEDE_DEBUG_TX
 	if (unlikely(i != nb_pkts))
 		PMD_TX_LOG(ERR, txq, "TX prepare failed for %u\n",
 			   nb_pkts - i);
+#endif
 	return i;
 }
 
@@ -1651,7 +1663,7 @@ static void qede_init_fp_queue(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct qede_fastpath *fp;
-	uint8_t i, rss_id, txq_index, tc;
+	uint8_t i, txq_index, tc;
 	int rxq = 0, txq = 0;
 
 	for_each_queue(i) {
@@ -1679,8 +1691,6 @@ int qede_dev_start(struct rte_eth_dev *eth_dev)
 {
 	struct qede_dev *qdev = eth_dev->data->dev_private;
 	struct ecore_dev *edev = &qdev->edev;
-	struct qed_link_output link_output;
-	struct qede_fastpath *fp;
 	int rc;
 
 	DP_INFO(edev, "Device state is %d\n", qdev->state);
-- 
1.7.10.3

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

* Re: [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling
  2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
                   ` (4 preceding siblings ...)
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
@ 2017-04-26  8:15 ` Ferruh Yigit
  5 siblings, 0 replies; 11+ messages in thread
From: Ferruh Yigit @ 2017-04-26  8:15 UTC (permalink / raw)
  To: Rasesh Mody, dev; +Cc: Harish Patil, Dept-EngDPDKDev, stable

On 4/25/2017 8:28 AM, Rasesh Mody wrote:
> From: Harish Patil <harish.patil@qlogic.com>
> 
> - In qede_mac_addr_set(), in order to configure default MAC address we
> first delete the existing MAC address before trying to add new one. During
> init time, there is no MAC filter to begin with, so trying to remove a
> non-existing MAC address causes a firmware exception. This can be prevented
> by internally calling qede_mac_addr_add() which has the checks in place to
> delete a MAC address only if it was added before.
> 
> - Remove setting of the default MAC address from within
> qede_dev_configure() since rte_eth_dev_start() calls mac_addr_set() anyway.
> 
> Fixes: 2ea6f76aff40 ("qede: add core driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Harish Patil <harish.patil@qlogic.com>

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

Thanks for taking care of coverity issues as well as base files CFLAGS.

(Mail addressed updated to current ones.)

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

* Re: [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files
  2017-04-25  7:28 ` [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
@ 2017-05-02  6:15   ` Yuanhan Liu
  2017-05-04  0:14     ` Mody, Rasesh
  0 siblings, 1 reply; 11+ messages in thread
From: Yuanhan Liu @ 2017-05-02  6:15 UTC (permalink / raw)
  To: Rasesh Mody
  Cc: dev, Rasesh Mody, Dept-EngDPDKDev, stable, Ferruh Yigit, Thomas Monjalon

On Tue, Apr 25, 2017 at 12:28:46AM -0700, Rasesh Mody wrote:
> From: Rasesh Mody <rasesh.mody@qlogic.com>
> 
> Changes included in this fix
>  - limit CFLAGS to base files
>  - fix to remove/mark unused members
>  - add checks for debug config option
>  - make qede_set_mtu() and qede_udp_dst_port_del() static and others
>    non-static as appropriate
>  - move local APIs qede_vlan_offload_set() and qede_rx_cqe_to_pkt_type()
>  - initialize variables as required

When there are so many items in one single patch, it basically means
it's done wrongly. Generally, we should make one patch for each item.

> Fixes: ec94dbc57362 ("qede: add base driver")
> Cc: stable@dpdk.org

It's also not a good idea to put "Cc: stable" tag in a huge fix patch.
It's very likely it won't apply cleanly to a stable/LTS release. For
instance, I failed to apply it to 16.11.2 (LTS).

> 
> Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
> ---
>  drivers/net/qede/Makefile             |   32 ++++-----
>  drivers/net/qede/base/ecore.h         |    4 +-
>  drivers/net/qede/base/ecore_int_api.h |    4 +-
>  drivers/net/qede/qede_ethdev.c        |  120 ++++++++++++++++++---------------
>  drivers/net/qede/qede_ethdev.h        |   32 ++++-----
>  drivers/net/qede/qede_fdir.c          |   13 +---
>  drivers/net/qede/qede_if.h            |    4 ++
>  drivers/net/qede/qede_main.c          |    8 +--
>  drivers/net/qede/qede_rxtx.c          |  118 +++++++++++++++++---------------
>  9 files changed, 171 insertions(+), 164 deletions(-)

It's also a clear sign of bad patch: too many changes for a single bug
fix patch.

Most of them look like minor fixes to me. So my question is are there
any important items really should be picked for stable and LTS release?
More specifically, do they really fix any (fatal) issues? If no, I will
drop it. If yes, please send a (or some) patch with the real fixes
backported only to stable ML, so that I could pick them.

Thanks.

	--yliu

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

* Re: [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files
  2017-05-02  6:15   ` Yuanhan Liu
@ 2017-05-04  0:14     ` Mody, Rasesh
  2017-05-04  2:11       ` Yuanhan Liu
  0 siblings, 1 reply; 11+ messages in thread
From: Mody, Rasesh @ 2017-05-04  0:14 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, Dept-Eng DPDK Dev, stable, Ferruh Yigit, Thomas Monjalon



> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Monday, May 01, 2017 11:15 PM
> 
> On Tue, Apr 25, 2017 at 12:28:46AM -0700, Rasesh Mody wrote:
> > From: Rasesh Mody <rasesh.mody@qlogic.com>
> >
> > Changes included in this fix
> >  - limit CFLAGS to base files
> >  - fix to remove/mark unused members
> >  - add checks for debug config option
> >  - make qede_set_mtu() and qede_udp_dst_port_del() static and others
> >    non-static as appropriate
> >  - move local APIs qede_vlan_offload_set() and
> > qede_rx_cqe_to_pkt_type()
> >  - initialize variables as required
> 
> When there are so many items in one single patch, it basically means it's
> done wrongly. Generally, we should make one patch for each item.
> 
> > Fixes: ec94dbc57362 ("qede: add base driver")
> > Cc: stable@dpdk.org
> 
> It's also not a good idea to put "Cc: stable" tag in a huge fix patch.
> It's very likely it won't apply cleanly to a stable/LTS release. For instance, I
> failed to apply it to 16.11.2 (LTS).
> 
> >
> > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
> > ---
> >  drivers/net/qede/Makefile             |   32 ++++-----
> >  drivers/net/qede/base/ecore.h         |    4 +-
> >  drivers/net/qede/base/ecore_int_api.h |    4 +-
> >  drivers/net/qede/qede_ethdev.c        |  120 ++++++++++++++++++--------
> -------
> >  drivers/net/qede/qede_ethdev.h        |   32 ++++-----
> >  drivers/net/qede/qede_fdir.c          |   13 +---
> >  drivers/net/qede/qede_if.h            |    4 ++
> >  drivers/net/qede/qede_main.c          |    8 +--
> >  drivers/net/qede/qede_rxtx.c          |  118 +++++++++++++++++-------------
> --
> >  9 files changed, 171 insertions(+), 164 deletions(-)
> 
> It's also a clear sign of bad patch: too many changes for a single bug fix patch.
> 
> Most of them look like minor fixes to me. So my question is are there any
> important items really should be picked for stable and LTS release?
> More specifically, do they really fix any (fatal) issues? If no, I will drop it. If
> yes, please send a (or some) patch with the real fixes backported only to
> stable ML, so that I could pick them.

The patch is a Makefile change to restrict the CFLAG only to the base files. Once Makefile was changed it exposed few issues with PMD. Hence, we thought of putting all the changes in single patch since they were relevant changes.

As you stated most of them are minor fixes. We'll evaluate the patch if anything specifically need to go into the stable release and get back. 

Thanks!
-Rasesh

> 
> Thanks.
> 
> 	--yliu

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

* Re: [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files
  2017-05-04  0:14     ` Mody, Rasesh
@ 2017-05-04  2:11       ` Yuanhan Liu
  2017-05-07  5:15         ` Mody, Rasesh
  0 siblings, 1 reply; 11+ messages in thread
From: Yuanhan Liu @ 2017-05-04  2:11 UTC (permalink / raw)
  To: Mody, Rasesh
  Cc: dev, Dept-Eng DPDK Dev, stable, Ferruh Yigit, Thomas Monjalon

On Thu, May 04, 2017 at 12:14:30AM +0000, Mody, Rasesh wrote:
> 
> 
> > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> > Sent: Monday, May 01, 2017 11:15 PM
> > 
> > On Tue, Apr 25, 2017 at 12:28:46AM -0700, Rasesh Mody wrote:
> > > From: Rasesh Mody <rasesh.mody@qlogic.com>
> > >
> > > Changes included in this fix
> > >  - limit CFLAGS to base files
> > >  - fix to remove/mark unused members
> > >  - add checks for debug config option
> > >  - make qede_set_mtu() and qede_udp_dst_port_del() static and others
> > >    non-static as appropriate
> > >  - move local APIs qede_vlan_offload_set() and
> > > qede_rx_cqe_to_pkt_type()
> > >  - initialize variables as required
> > 
> > When there are so many items in one single patch, it basically means it's
> > done wrongly. Generally, we should make one patch for each item.
> > 
> > > Fixes: ec94dbc57362 ("qede: add base driver")
> > > Cc: stable@dpdk.org
> > 
> > It's also not a good idea to put "Cc: stable" tag in a huge fix patch.
> > It's very likely it won't apply cleanly to a stable/LTS release. For instance, I
> > failed to apply it to 16.11.2 (LTS).
> > 
> > >
> > > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
> > > ---
> > >  drivers/net/qede/Makefile             |   32 ++++-----
> > >  drivers/net/qede/base/ecore.h         |    4 +-
> > >  drivers/net/qede/base/ecore_int_api.h |    4 +-
> > >  drivers/net/qede/qede_ethdev.c        |  120 ++++++++++++++++++--------
> > -------
> > >  drivers/net/qede/qede_ethdev.h        |   32 ++++-----
> > >  drivers/net/qede/qede_fdir.c          |   13 +---
> > >  drivers/net/qede/qede_if.h            |    4 ++
> > >  drivers/net/qede/qede_main.c          |    8 +--
> > >  drivers/net/qede/qede_rxtx.c          |  118 +++++++++++++++++-------------
> > --
> > >  9 files changed, 171 insertions(+), 164 deletions(-)
> > 
> > It's also a clear sign of bad patch: too many changes for a single bug fix patch.
> > 
> > Most of them look like minor fixes to me. So my question is are there any
> > important items really should be picked for stable and LTS release?
> > More specifically, do they really fix any (fatal) issues? If no, I will drop it. If
> > yes, please send a (or some) patch with the real fixes backported only to
> > stable ML, so that I could pick them.
> 
> The patch is a Makefile change to restrict the CFLAG only to the base files. Once Makefile was changed it exposed few issues with PMD.

In such case, you could make patches to fix those issues first, one
patch for one issue, and then put the CFLAG change to the last.

> Hence, we thought of putting all the changes in single patch since they were relevant changes.
> 
> As you stated most of them are minor fixes. We'll evaluate the patch if anything specifically need to go into the stable release and get back. 

Thanks. The answer seems to be "NO" to me though.

	--yliu

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

* Re: [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files
  2017-05-04  2:11       ` Yuanhan Liu
@ 2017-05-07  5:15         ` Mody, Rasesh
  0 siblings, 0 replies; 11+ messages in thread
From: Mody, Rasesh @ 2017-05-07  5:15 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, Dept-Eng DPDK Dev, stable, Ferruh Yigit, Thomas Monjalon


> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Wednesday, May 03, 2017 7:11 PM
> 
> On Thu, May 04, 2017 at 12:14:30AM +0000, Mody, Rasesh wrote:
> >
> >
> > > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> > > Sent: Monday, May 01, 2017 11:15 PM
> > >
> > > On Tue, Apr 25, 2017 at 12:28:46AM -0700, Rasesh Mody wrote:
> > > > From: Rasesh Mody <rasesh.mody@qlogic.com>
> > > >
> > > > Changes included in this fix
> > > >  - limit CFLAGS to base files
> > > >  - fix to remove/mark unused members
> > > >  - add checks for debug config option
> > > >  - make qede_set_mtu() and qede_udp_dst_port_del() static and
> others
> > > >    non-static as appropriate
> > > >  - move local APIs qede_vlan_offload_set() and
> > > > qede_rx_cqe_to_pkt_type()
> > > >  - initialize variables as required
> > >
> > > When there are so many items in one single patch, it basically means
> > > it's done wrongly. Generally, we should make one patch for each item.
> > >
> > > > Fixes: ec94dbc57362 ("qede: add base driver")
> > > > Cc: stable@dpdk.org
> > >
> > > It's also not a good idea to put "Cc: stable" tag in a huge fix patch.
> > > It's very likely it won't apply cleanly to a stable/LTS release. For
> > > instance, I failed to apply it to 16.11.2 (LTS).
> > >
> > > >
> > > > Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
> > > > ---
> > > >  drivers/net/qede/Makefile             |   32 ++++-----
> > > >  drivers/net/qede/base/ecore.h         |    4 +-
> > > >  drivers/net/qede/base/ecore_int_api.h |    4 +-
> > > >  drivers/net/qede/qede_ethdev.c        |  120 ++++++++++++++++++----
> ----
> > > -------
> > > >  drivers/net/qede/qede_ethdev.h        |   32 ++++-----
> > > >  drivers/net/qede/qede_fdir.c          |   13 +---
> > > >  drivers/net/qede/qede_if.h            |    4 ++
> > > >  drivers/net/qede/qede_main.c          |    8 +--
> > > >  drivers/net/qede/qede_rxtx.c          |  118 +++++++++++++++++--------
> -----
> > > --
> > > >  9 files changed, 171 insertions(+), 164 deletions(-)
> > >
> > > It's also a clear sign of bad patch: too many changes for a single bug fix
> patch.
> > >
> > > Most of them look like minor fixes to me. So my question is are
> > > there any important items really should be picked for stable and LTS
> release?
> > > More specifically, do they really fix any (fatal) issues? If no, I
> > > will drop it. If yes, please send a (or some) patch with the real
> > > fixes backported only to stable ML, so that I could pick them.
> >
> > The patch is a Makefile change to restrict the CFLAG only to the base files.
> Once Makefile was changed it exposed few issues with PMD.
> 
> In such case, you could make patches to fix those issues first, one patch for
> one issue, and then put the CFLAG change to the last.
> 
> > Hence, we thought of putting all the changes in single patch since they
> were relevant changes.
> >
> > As you stated most of them are minor fixes. We'll evaluate the patch if
> anything specifically need to go into the stable release and get back.
> 
> Thanks. The answer seems to be "NO" to me though.

We can  skip this patch for stable release backport.

Thanks!
-Rasesh

> 
> 	--yliu

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

end of thread, other threads:[~2017-05-07  5:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25  7:28 [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 02/11] net/qede: fix reset of fastpath rings after port stop Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 07/11] net/qede: fix FW version string display for SRIOV Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 08/11] net/qede/base: fix coverity issues Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 10/11] net/qede/base: fix find zero bit macro Rasesh Mody
2017-04-25  7:28 ` [dpdk-stable] [PATCH 11/11] net/qede: fix to limit CFLAGS to base files Rasesh Mody
2017-05-02  6:15   ` Yuanhan Liu
2017-05-04  0:14     ` Mody, Rasesh
2017-05-04  2:11       ` Yuanhan Liu
2017-05-07  5:15         ` Mody, Rasesh
2017-04-26  8:15 ` [dpdk-stable] [PATCH 01/11] net/qede: fix default MAC address handling 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).