Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e29adba authored by Sunil Goutham's avatar Sunil Goutham Committed by David S. Miller
Browse files

net: thunderx: Fix TL4 configuration for secondary Qsets



TL4 calculation for a given SQ of secondary Qsets is incorrect
and goes out of bounds and also for some SQ's TL4 chosen will
transmit data via a different BGX interface and not same as
primary Qset's interface.

This patch fixes this issue.

Signed-off-by: default avatarSunil Goutham <sgoutham@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3f4c68cf
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ static void nic_tx_channel_cfg(struct nicpf *nic, u8 vnic,
	u32 rr_quantum;
	u8 sq_idx = sq->sq_num;
	u8 pqs_vnic;
	int svf;

	if (sq->sqs_mode)
		pqs_vnic = nic->pqs_vf[vnic];
@@ -511,10 +512,19 @@ static void nic_tx_channel_cfg(struct nicpf *nic, u8 vnic,
	/* 24 bytes for FCS, IPG and preamble */
	rr_quantum = ((NIC_HW_MAX_FRS + 24) / 4);

	if (!sq->sqs_mode) {
		tl4 = (lmac * NIC_TL4_PER_LMAC) + (bgx * NIC_TL4_PER_BGX);
	} else {
		for (svf = 0; svf < MAX_SQS_PER_VF; svf++) {
			if (nic->vf_sqs[pqs_vnic][svf] == vnic)
				break;
		}
		tl4 = (MAX_LMAC_PER_BGX * NIC_TL4_PER_LMAC);
		tl4 += (lmac * NIC_TL4_PER_LMAC * MAX_SQS_PER_VF);
		tl4 += (svf * NIC_TL4_PER_LMAC);
		tl4 += (bgx * NIC_TL4_PER_BGX);
	}
	tl4 += sq_idx;
	if (sq->sqs_mode)
		tl4 += vnic * 8;

	tl3 = tl4 / (NIC_MAX_TL4 / NIC_MAX_TL3);
	nic_reg_write(nic, NIC_PF_QSET_0_127_SQ_0_7_CFG2 |