Skip to content

Commit 7e566df

Browse files
committed
Merge tag 'mlx5-fixes-2020-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2020-03-24 This series introduces some fixes to mlx5 driver. From Aya, Fixes to the RX error recovery flows From Leon, Fix IB capability mask Please pull and let me know if there is any problem. For -stable v5.5 ('net/mlx5_core: Set IB capability mask1 to fix ib_srpt connection failure') For -stable v5.4 ('net/mlx5e: Fix ICOSQ recovery flow with Striding RQ') ('net/mlx5e: Do not recover from a non-fatal syndrome') ('net/mlx5e: Fix missing reset of SW metadata in Striding RQ reset') ('net/mlx5e: Enhance ICOSQ WQE info fields') The above patch ('net/mlx5e: Enhance ICOSQ WQE info fields') will fail to apply cleanly on v5.4 due to a trivial contextual conflict, but it is an important fix, do I need to do something about it or just assume Greg will know how to handle this ? ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f13bc68 + 187a983 commit 7e566df

File tree

8 files changed

+41
-18
lines changed

8 files changed

+41
-18
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ enum {
371371

372372
struct mlx5e_sq_wqe_info {
373373
u8 opcode;
374+
u8 num_wqebbs;
374375

375376
/* Auxiliary data for different opcodes. */
376377
union {
@@ -1059,6 +1060,7 @@ int mlx5e_modify_rq_state(struct mlx5e_rq *rq, int curr_state, int next_state);
10591060
void mlx5e_activate_rq(struct mlx5e_rq *rq);
10601061
void mlx5e_deactivate_rq(struct mlx5e_rq *rq);
10611062
void mlx5e_free_rx_descs(struct mlx5e_rq *rq);
1063+
void mlx5e_free_rx_in_progress_descs(struct mlx5e_rq *rq);
10621064
void mlx5e_activate_icosq(struct mlx5e_icosq *icosq);
10631065
void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq);
10641066

drivers/net/ethernet/mellanox/mlx5/core/en/health.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
static inline bool cqe_syndrome_needs_recover(u8 syndrome)
1212
{
13-
return syndrome == MLX5_CQE_SYNDROME_LOCAL_LENGTH_ERR ||
14-
syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
13+
return syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
1514
syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
1615
syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR;
1716
}

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
9090
goto out;
9191

9292
mlx5e_reset_icosq_cc_pc(icosq);
93-
mlx5e_free_rx_descs(rq);
93+
mlx5e_free_rx_in_progress_descs(rq);
9494
clear_bit(MLX5E_SQ_STATE_RECOVERING, &icosq->state);
9595
mlx5e_activate_icosq(icosq);
9696
mlx5e_activate_rq(rq);

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,12 @@ mlx5e_tx_dma_unmap(struct device *pdev, struct mlx5e_sq_dma *dma)
181181

182182
static inline void mlx5e_rqwq_reset(struct mlx5e_rq *rq)
183183
{
184-
if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ)
184+
if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {
185185
mlx5_wq_ll_reset(&rq->mpwqe.wq);
186-
else
186+
rq->mpwqe.actual_wq_head = 0;
187+
} else {
187188
mlx5_wq_cyc_reset(&rq->wqe.wq);
189+
}
188190
}
189191

190192
/* SW parser related functions */

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -813,21 +813,38 @@ int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq, int wait_time)
813813
return -ETIMEDOUT;
814814
}
815815

816+
void mlx5e_free_rx_in_progress_descs(struct mlx5e_rq *rq)
817+
{
818+
struct mlx5_wq_ll *wq;
819+
u16 head;
820+
int i;
821+
822+
if (rq->wq_type != MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ)
823+
return;
824+
825+
wq = &rq->mpwqe.wq;
826+
head = wq->head;
827+
828+
/* Outstanding UMR WQEs (in progress) start at wq->head */
829+
for (i = 0; i < rq->mpwqe.umr_in_progress; i++) {
830+
rq->dealloc_wqe(rq, head);
831+
head = mlx5_wq_ll_get_wqe_next_ix(wq, head);
832+
}
833+
834+
rq->mpwqe.actual_wq_head = wq->head;
835+
rq->mpwqe.umr_in_progress = 0;
836+
rq->mpwqe.umr_completed = 0;
837+
}
838+
816839
void mlx5e_free_rx_descs(struct mlx5e_rq *rq)
817840
{
818841
__be16 wqe_ix_be;
819842
u16 wqe_ix;
820843

821844
if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {
822845
struct mlx5_wq_ll *wq = &rq->mpwqe.wq;
823-
u16 head = wq->head;
824-
int i;
825846

826-
/* Outstanding UMR WQEs (in progress) start at wq->head */
827-
for (i = 0; i < rq->mpwqe.umr_in_progress; i++) {
828-
rq->dealloc_wqe(rq, head);
829-
head = mlx5_wq_ll_get_wqe_next_ix(wq, head);
830-
}
847+
mlx5e_free_rx_in_progress_descs(rq);
831848

832849
while (!mlx5_wq_ll_is_empty(wq)) {
833850
struct mlx5e_rx_wqe_ll *wqe;

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ static inline void mlx5e_fill_icosq_frag_edge(struct mlx5e_icosq *sq,
477477
/* fill sq frag edge with nops to avoid wqe wrapping two pages */
478478
for (; wi < edge_wi; wi++) {
479479
wi->opcode = MLX5_OPCODE_NOP;
480+
wi->num_wqebbs = 1;
480481
mlx5e_post_nop(wq, sq->sqn, &sq->pc);
481482
}
482483
}
@@ -525,6 +526,7 @@ static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix)
525526
umr_wqe->uctrl.xlt_offset = cpu_to_be16(xlt_offset);
526527

527528
sq->db.ico_wqe[pi].opcode = MLX5_OPCODE_UMR;
529+
sq->db.ico_wqe[pi].num_wqebbs = MLX5E_UMR_WQEBBS;
528530
sq->db.ico_wqe[pi].umr.rq = rq;
529531
sq->pc += MLX5E_UMR_WQEBBS;
530532

@@ -621,6 +623,7 @@ void mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
621623

622624
ci = mlx5_wq_cyc_ctr2ix(&sq->wq, sqcc);
623625
wi = &sq->db.ico_wqe[ci];
626+
sqcc += wi->num_wqebbs;
624627

625628
if (last_wqe && unlikely(get_cqe_opcode(cqe) != MLX5_CQE_REQ)) {
626629
netdev_WARN_ONCE(cq->channel->netdev,
@@ -631,16 +634,12 @@ void mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
631634
break;
632635
}
633636

634-
if (likely(wi->opcode == MLX5_OPCODE_UMR)) {
635-
sqcc += MLX5E_UMR_WQEBBS;
637+
if (likely(wi->opcode == MLX5_OPCODE_UMR))
636638
wi->umr.rq->mpwqe.umr_completed++;
637-
} else if (likely(wi->opcode == MLX5_OPCODE_NOP)) {
638-
sqcc++;
639-
} else {
639+
else if (unlikely(wi->opcode != MLX5_OPCODE_NOP))
640640
netdev_WARN_ONCE(cq->channel->netdev,
641641
"Bad OPCODE in ICOSQ WQE info: 0x%x\n",
642642
wi->opcode);
643-
}
644643

645644
} while (!last_wqe);
646645

drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void mlx5e_trigger_irq(struct mlx5e_icosq *sq)
7878
u16 pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
7979

8080
sq->db.ico_wqe[pi].opcode = MLX5_OPCODE_NOP;
81+
sq->db.ico_wqe[pi].num_wqebbs = 1;
8182
nopwqe = mlx5e_post_nop(wq, sq->sqn, &sq->pc);
8283
mlx5e_notify_hw(wq, sq->pc, sq->uar_map, &nopwqe->ctrl);
8384
}

drivers/net/ethernet/mellanox/mlx5/core/vport.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,9 @@ int mlx5_core_modify_hca_vport_context(struct mlx5_core_dev *dev,
10711071
MLX5_SET64(hca_vport_context, ctx, port_guid, req->port_guid);
10721072
if (req->field_select & MLX5_HCA_VPORT_SEL_NODE_GUID)
10731073
MLX5_SET64(hca_vport_context, ctx, node_guid, req->node_guid);
1074+
MLX5_SET(hca_vport_context, ctx, cap_mask1, req->cap_mask1);
1075+
MLX5_SET(hca_vport_context, ctx, cap_mask1_field_select,
1076+
req->cap_mask1_perm);
10741077
err = mlx5_cmd_exec(dev, in, in_sz, out, sizeof(out));
10751078
ex:
10761079
kfree(in);

0 commit comments

Comments
 (0)