Commit 6199496b authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-qed-qede-various-stability-fixes'



Alexander Lobakin says:

====================
net: qed/qede: various stability fixes

This set addresses several near-critical issues that were observed
and reproduced on different test and production configurations.

v2:
 - don't split the "Fixes:" tag across several lines in patch 9;
 - no functional changes.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b4730ae6 10f468ea
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ static void qed_cxt_qm_iids(struct qed_hwfn *p_hwfn,
		vf_tids += segs[NUM_TASK_PF_SEGMENTS].count;
	}

	iids->vf_cids += vf_cids * p_mngr->vf_count;
	iids->vf_cids = vf_cids;
	iids->tids += vf_tids * p_mngr->vf_count;

	DP_VERBOSE(p_hwfn, QED_MSG_ILT,
@@ -465,6 +465,20 @@ static struct qed_ilt_cli_blk *qed_cxt_set_blk(struct qed_ilt_cli_blk *p_blk)
	return p_blk;
}

static void qed_cxt_ilt_blk_reset(struct qed_hwfn *p_hwfn)
{
	struct qed_ilt_client_cfg *clients = p_hwfn->p_cxt_mngr->clients;
	u32 cli_idx, blk_idx;

	for (cli_idx = 0; cli_idx < MAX_ILT_CLIENTS; cli_idx++) {
		for (blk_idx = 0; blk_idx < ILT_CLI_PF_BLOCKS; blk_idx++)
			clients[cli_idx].pf_blks[blk_idx].total_size = 0;

		for (blk_idx = 0; blk_idx < ILT_CLI_VF_BLOCKS; blk_idx++)
			clients[cli_idx].vf_blks[blk_idx].total_size = 0;
	}
}

int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *line_count)
{
	struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr;
@@ -484,6 +498,11 @@ int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *line_count)

	p_mngr->pf_start_line = RESC_START(p_hwfn, QED_ILT);

	/* Reset all ILT blocks at the beginning of ILT computing in order
	 * to prevent memory allocation for irrelevant blocks afterwards.
	 */
	qed_cxt_ilt_blk_reset(p_hwfn);

	DP_VERBOSE(p_hwfn, QED_MSG_ILT,
		   "hwfn [%d] - Set context manager starting line to be 0x%08x\n",
		   p_hwfn->my_id, p_hwfn->p_cxt_mngr->pf_start_line);
+8 −3
Original line number Diff line number Diff line
@@ -980,7 +980,7 @@ int qed_llh_add_mac_filter(struct qed_dev *cdev,
	struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
	struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
	union qed_llh_filter filter = {};
	u8 filter_idx, abs_ppfid;
	u8 filter_idx, abs_ppfid = 0;
	u32 high, low, ref_cnt;
	int rc = 0;

@@ -1368,6 +1368,8 @@ static void qed_dbg_user_data_free(struct qed_hwfn *p_hwfn)

void qed_resc_free(struct qed_dev *cdev)
{
	struct qed_rdma_info *rdma_info;
	struct qed_hwfn *p_hwfn;
	int i;

	if (IS_VF(cdev)) {
@@ -1385,7 +1387,8 @@ void qed_resc_free(struct qed_dev *cdev)
	qed_llh_free(cdev);

	for_each_hwfn(cdev, i) {
		struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
		p_hwfn = cdev->hwfns + i;
		rdma_info = p_hwfn->p_rdma_info;

		qed_cxt_mngr_free(p_hwfn);
		qed_qm_info_free(p_hwfn);
@@ -1404,8 +1407,10 @@ void qed_resc_free(struct qed_dev *cdev)
			qed_ooo_free(p_hwfn);
		}

		if (QED_IS_RDMA_PERSONALITY(p_hwfn))
		if (QED_IS_RDMA_PERSONALITY(p_hwfn) && rdma_info) {
			qed_spq_unregister_async_cb(p_hwfn, rdma_info->proto);
			qed_rdma_info_free(p_hwfn);
		}

		qed_iov_free(p_hwfn);
		qed_l2_free(p_hwfn);
+0 −2
Original line number Diff line number Diff line
@@ -2836,8 +2836,6 @@ int qed_iwarp_stop(struct qed_hwfn *p_hwfn)
	if (rc)
		return rc;

	qed_spq_unregister_async_cb(p_hwfn, PROTOCOLID_IWARP);

	return qed_iwarp_ll2_stop(p_hwfn);
}

+0 −1
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
			break;
		}
	}
	qed_spq_unregister_async_cb(p_hwfn, PROTOCOLID_ROCE);
}

static void qed_rdma_copy_gids(struct qed_rdma_qp *qp, __le32 *src_gid,
+18 −5
Original line number Diff line number Diff line
@@ -81,12 +81,17 @@ static void qed_vf_pf_req_end(struct qed_hwfn *p_hwfn, int req_status)
	mutex_unlock(&(p_hwfn->vf_iov_info->mutex));
}

#define QED_VF_CHANNEL_USLEEP_ITERATIONS	90
#define QED_VF_CHANNEL_USLEEP_DELAY		100
#define QED_VF_CHANNEL_MSLEEP_ITERATIONS	10
#define QED_VF_CHANNEL_MSLEEP_DELAY		25

static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
{
	union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
	struct ustorm_trigger_vf_zone trigger;
	struct ustorm_vf_zone *zone_data;
	int rc = 0, time = 100;
	int iter, rc = 0;

	zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B;

@@ -126,11 +131,19 @@ static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
	REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger));

	/* When PF would be done with the response, it would write back to the
	 * `done' address. Poll until then.
	 * `done' address from a coherent DMA zone. Poll until then.
	 */
	while ((!*done) && time) {
		msleep(25);
		time--;

	iter = QED_VF_CHANNEL_USLEEP_ITERATIONS;
	while (!*done && iter--) {
		udelay(QED_VF_CHANNEL_USLEEP_DELAY);
		dma_rmb();
	}

	iter = QED_VF_CHANNEL_MSLEEP_ITERATIONS;
	while (!*done && iter--) {
		msleep(QED_VF_CHANNEL_MSLEEP_DELAY);
		dma_rmb();
	}

	if (!*done) {
Loading