All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] qed*: Fix series.
@ 2018-07-02  3:03 Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 1/4] qed: Limit msix vectors in kdump kernel to the minimum required count Sudarsana Reddy Kalluru
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-07-02  3:03 UTC (permalink / raw
  To: davem; +Cc: netdev, Michal.Kalderon, Sudarsana Reddy Kalluru

From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>

The patch series addresses few issues in the qed* drivers.

Please consider applying it to 'net' branch.

Sudarsana Reddy Kalluru (4):
  qed: Limit msix vectors in kdump kernel to the minimum required count.
  qed: Fix setting of incorrect eswitch mode.
  qed: Fix use of incorrect size in memcpy call.
  qede: Adverstise software timestamp caps when PHC is not available.

 drivers/net/ethernet/qlogic/qed/qed_dcbx.c  |  8 ++++----
 drivers/net/ethernet/qlogic/qed/qed_dev.c   |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_main.c  |  8 ++++++++
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 19 +++++++++++++++++--
 drivers/net/ethernet/qlogic/qede/qede_ptp.c | 10 ++++++++--
 5 files changed, 38 insertions(+), 9 deletions(-)

-- 
1.8.3.1

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

* [PATCH net 1/4] qed: Limit msix vectors in kdump kernel to the minimum required count.
  2018-07-02  3:03 [PATCH net 0/4] qed*: Fix series Sudarsana Reddy Kalluru
@ 2018-07-02  3:03 ` Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 2/4] qed: Fix setting of incorrect eswitch mode Sudarsana Reddy Kalluru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-07-02  3:03 UTC (permalink / raw
  To: davem; +Cc: netdev, Michal.Kalderon

Memory size is limited in the kdump kernel environment. Allocation of more
msix-vectors (or queues) consumes few tens of MBs of memory, which might
lead to the kdump kernel failure.
This patch adds changes to limit the number of MSI-X vectors in kdump
kernel to minimum required value (i.e., 2 per engine).

Fixes: fe56b9e6a ("qed: Add module with basic common support")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 5c10fd7..0cbc74d 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -789,6 +789,14 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,
 	/* We want a minimum of one slowpath and one fastpath vector per hwfn */
 	cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2;
 
+	if (is_kdump_kernel()) {
+		DP_INFO(cdev,
+			"Kdump kernel: Limit the max number of requested MSI-X vectors to %hd\n",
+			cdev->int_params.in.min_msix_cnt);
+		cdev->int_params.in.num_vectors =
+			cdev->int_params.in.min_msix_cnt;
+	}
+
 	rc = qed_set_int_mode(cdev, false);
 	if (rc)  {
 		DP_ERR(cdev, "qed_slowpath_setup_int ERR\n");
-- 
1.8.3.1

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

* [PATCH net 2/4] qed: Fix setting of incorrect eswitch mode.
  2018-07-02  3:03 [PATCH net 0/4] qed*: Fix series Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 1/4] qed: Limit msix vectors in kdump kernel to the minimum required count Sudarsana Reddy Kalluru
@ 2018-07-02  3:03 ` Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 3/4] qed: Fix use of incorrect size in memcpy call Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 4/4] qede: Adverstise software timestamp caps when PHC is not available Sudarsana Reddy Kalluru
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-07-02  3:03 UTC (permalink / raw
  To: davem; +Cc: netdev, Michal.Kalderon

By default, driver sets the eswitch mode incorrectly as VEB (virtual
Ethernet bridging).
Need to set VEB eswitch mode only when sriov is enabled, and it should be
to set NONE by default. The patch incorporates this change.

Fixes: 0fefbfbaa ("qed*: Management firmware - notifications and defaults")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c   |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index 329781c..e5249b4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
 			DP_INFO(p_hwfn, "Failed to update driver state\n");
 
 		rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt,
-					       QED_OV_ESWITCH_VEB);
+					       QED_OV_ESWITCH_NONE);
 		if (rc)
 			DP_INFO(p_hwfn, "Failed to update eswitch mode\n");
 	}
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index f01bf52..fd59cf4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn,
 static int qed_sriov_enable(struct qed_dev *cdev, int num)
 {
 	struct qed_iov_vf_init_params params;
+	struct qed_hwfn *hwfn;
+	struct qed_ptt *ptt;
 	int i, j, rc;
 
 	if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) {
@@ -4525,8 +4527,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num)
 
 	/* Initialize HW for VF access */
 	for_each_hwfn(cdev, j) {
-		struct qed_hwfn *hwfn = &cdev->hwfns[j];
-		struct qed_ptt *ptt = qed_ptt_acquire(hwfn);
+		hwfn = &cdev->hwfns[j];
+		ptt = qed_ptt_acquire(hwfn);
 
 		/* Make sure not to use more than 16 queues per VF */
 		params.num_queues = min_t(int,
@@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num)
 		goto err;
 	}
 
+	hwfn = QED_LEADING_HWFN(cdev);
+	ptt = qed_ptt_acquire(hwfn);
+	if (!ptt) {
+		DP_ERR(hwfn, "Failed to acquire ptt\n");
+		rc = -EBUSY;
+		goto err;
+	}
+
+	rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB);
+	if (rc)
+		DP_INFO(cdev, "Failed to update eswitch mode\n");
+	qed_ptt_release(hwfn, ptt);
+
 	return num;
 
 err:
-- 
1.8.3.1

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

* [PATCH net 3/4] qed: Fix use of incorrect size in memcpy call.
  2018-07-02  3:03 [PATCH net 0/4] qed*: Fix series Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 1/4] qed: Limit msix vectors in kdump kernel to the minimum required count Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 2/4] qed: Fix setting of incorrect eswitch mode Sudarsana Reddy Kalluru
@ 2018-07-02  3:03 ` Sudarsana Reddy Kalluru
  2018-07-02  3:03 ` [PATCH net 4/4] qede: Adverstise software timestamp caps when PHC is not available Sudarsana Reddy Kalluru
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-07-02  3:03 UTC (permalink / raw
  To: davem; +Cc: netdev, Michal.Kalderon

Use the correct size value while copying chassis/port id values.

Fixes: 6ad8c632e ("qed: Add support for query/config dcbx.")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index f0b0138..e0680ce9 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -709,9 +709,9 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 	p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE];
 
 	memcpy(params->lldp_local.local_chassis_id, p_local->local_chassis_id,
-	       ARRAY_SIZE(p_local->local_chassis_id));
+	       sizeof(p_local->local_chassis_id));
 	memcpy(params->lldp_local.local_port_id, p_local->local_port_id,
-	       ARRAY_SIZE(p_local->local_port_id));
+	       sizeof(p_local->local_port_id));
 }
 
 static void
@@ -723,9 +723,9 @@ static int qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn)
 	p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE];
 
 	memcpy(params->lldp_remote.peer_chassis_id, p_remote->peer_chassis_id,
-	       ARRAY_SIZE(p_remote->peer_chassis_id));
+	       sizeof(p_remote->peer_chassis_id));
 	memcpy(params->lldp_remote.peer_port_id, p_remote->peer_port_id,
-	       ARRAY_SIZE(p_remote->peer_port_id));
+	       sizeof(p_remote->peer_port_id));
 }
 
 static int
-- 
1.8.3.1

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

* [PATCH net 4/4] qede: Adverstise software timestamp caps when PHC is not available.
  2018-07-02  3:03 [PATCH net 0/4] qed*: Fix series Sudarsana Reddy Kalluru
                   ` (2 preceding siblings ...)
  2018-07-02  3:03 ` [PATCH net 3/4] qed: Fix use of incorrect size in memcpy call Sudarsana Reddy Kalluru
@ 2018-07-02  3:03 ` Sudarsana Reddy Kalluru
  3 siblings, 0 replies; 5+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-07-02  3:03 UTC (permalink / raw
  To: davem; +Cc: netdev, Michal.Kalderon

When ptp clock is not available for a PF (e.g., higher PFs in NPAR mode),
get-tsinfo() callback should return the software timestamp capabilities
instead of returning the error.

Fixes: 4c55215c ("qede: Add driver support for PTP")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
---
 drivers/net/ethernet/qlogic/qede/qede_ptp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_ptp.c b/drivers/net/ethernet/qlogic/qede/qede_ptp.c
index 02adb513..013ff56 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_ptp.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_ptp.c
@@ -337,8 +337,14 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info)
 {
 	struct qede_ptp *ptp = edev->ptp;
 
-	if (!ptp)
-		return -EIO;
+	if (!ptp) {
+		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
+					SOF_TIMESTAMPING_RX_SOFTWARE |
+					SOF_TIMESTAMPING_SOFTWARE;
+		info->phc_index = -1;
+
+		return 0;
+	}
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
 				SOF_TIMESTAMPING_RX_SOFTWARE |
-- 
1.8.3.1

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

end of thread, other threads:[~2018-07-02  3:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-02  3:03 [PATCH net 0/4] qed*: Fix series Sudarsana Reddy Kalluru
2018-07-02  3:03 ` [PATCH net 1/4] qed: Limit msix vectors in kdump kernel to the minimum required count Sudarsana Reddy Kalluru
2018-07-02  3:03 ` [PATCH net 2/4] qed: Fix setting of incorrect eswitch mode Sudarsana Reddy Kalluru
2018-07-02  3:03 ` [PATCH net 3/4] qed: Fix use of incorrect size in memcpy call Sudarsana Reddy Kalluru
2018-07-02  3:03 ` [PATCH net 4/4] qede: Adverstise software timestamp caps when PHC is not available Sudarsana Reddy Kalluru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.