1 From 7c3945bc2073554bb2ecf983e073dee686679c53 Mon Sep 17 00:00:00 2001
2 From: Jack Morgenstein <jackm@dev.mellanox.co.il>
3 Date: Mon, 16 Jan 2017 18:31:38 +0200
4 Subject: net/mlx4_core: Fix when to save some qp context flags for dynamic VST to VGT transitions
6 From: Jack Morgenstein <jackm@dev.mellanox.co.il>
8 commit 7c3945bc2073554bb2ecf983e073dee686679c53 upstream.
10 Save the qp context flags byte containing the flag disabling vlan stripping
11 in the RESET to INIT qp transition, rather than in the INIT to RTR
12 transition. Per the firmware spec, the flags in this byte are active
13 in the RESET to INIT transition.
15 As a result of saving the flags in the incorrect qp transition, when
16 switching dynamically from VGT to VST and back to VGT, the vlan
17 remained stripped (as is required for VST) and did not return to
18 not-stripped (as is required for VGT).
20 Fixes: f0f829bf42cd ("net/mlx4_core: Add immediate activate for VGT->VST->VGT")
21 Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
22 Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
23 Signed-off-by: David S. Miller <davem@davemloft.net>
24 Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 +++--
29 1 file changed, 3 insertions(+), 2 deletions(-)
31 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
32 +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
33 @@ -2980,6 +2980,9 @@ int mlx4_RST2INIT_QP_wrapper(struct mlx4
34 put_res(dev, slave, srqn, RES_SRQ);
38 + /* Save param3 for dynamic changes from VST back to VGT */
39 + qp->param3 = qpc->param3;
40 put_res(dev, slave, rcqn, RES_CQ);
41 put_res(dev, slave, mtt_base, RES_MTT);
42 res_end_move(dev, slave, RES_QP, qpn);
43 @@ -3772,7 +3775,6 @@ int mlx4_INIT2RTR_QP_wrapper(struct mlx4
44 int qpn = vhcr->in_modifier & 0x7fffff;
47 - __be32 orig_param3 = qpc->param3;
48 u8 orig_vlan_control = qpc->pri_path.vlan_control;
49 u8 orig_fvl_rx = qpc->pri_path.fvl_rx;
50 u8 orig_pri_path_fl = qpc->pri_path.fl;
51 @@ -3814,7 +3816,6 @@ out:
54 qp->sched_queue = orig_sched_queue;
55 - qp->param3 = orig_param3;
56 qp->vlan_control = orig_vlan_control;
57 qp->fvl_rx = orig_fvl_rx;
58 qp->pri_path_fl = orig_pri_path_fl;