Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions

Save the qp context flags byte containing the flag disabling vlan stripping
in the RESET to INIT qp transition, rather than in the INIT to RTR
transition. Per the firmware spec, the flags in this byte are active
in the RESET to INIT transition.

As a result of saving the flags in the incorrect qp transition, when
switching dynamically from VGT to VST and back to VGT, the vlan
remained stripped (as is required for VST) and did not return to
not-stripped (as is required for VGT).

Fixes: f0f829bf42cd ("net/mlx4_core: Add immediate activate for VGT->VST->VGT")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jack Morgenstein and committed by
David S. Miller
7c3945bc 291c566a

+3 -2
+3 -2
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
··· 2980 2980 put_res(dev, slave, srqn, RES_SRQ); 2981 2981 qp->srq = srq; 2982 2982 } 2983 + 2984 + /* Save param3 for dynamic changes from VST back to VGT */ 2985 + qp->param3 = qpc->param3; 2983 2986 put_res(dev, slave, rcqn, RES_CQ); 2984 2987 put_res(dev, slave, mtt_base, RES_MTT); 2985 2988 res_end_move(dev, slave, RES_QP, qpn); ··· 3775 3772 int qpn = vhcr->in_modifier & 0x7fffff; 3776 3773 struct res_qp *qp; 3777 3774 u8 orig_sched_queue; 3778 - __be32 orig_param3 = qpc->param3; 3779 3775 u8 orig_vlan_control = qpc->pri_path.vlan_control; 3780 3776 u8 orig_fvl_rx = qpc->pri_path.fvl_rx; 3781 3777 u8 orig_pri_path_fl = qpc->pri_path.fl; ··· 3816 3814 */ 3817 3815 if (!err) { 3818 3816 qp->sched_queue = orig_sched_queue; 3819 - qp->param3 = orig_param3; 3820 3817 qp->vlan_control = orig_vlan_control; 3821 3818 qp->fvl_rx = orig_fvl_rx; 3822 3819 qp->pri_path_fl = orig_pri_path_fl;