net/mlx5e: XDP, Warn upon polling an error CQE
authorTariq Toukan <tariqt@mellanox.com>
Thu, 15 Nov 2018 09:48:41 +0000 (11:48 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 21 Dec 2018 06:54:18 +0000 (22:54 -0800)
Do not ignore the CQE opcode.
This helps expose issues and debug them.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c

index 4961b8fea111ada911de839fcc8eb798a7ed0a02..407e285b0430d8d57f71db2563a001886d754040 100644 (file)
@@ -197,6 +197,11 @@ bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)
 
                wqe_counter = be16_to_cpu(cqe->wqe_counter);
 
+               if (unlikely(get_cqe_opcode(cqe) != MLX5_CQE_REQ))
+                       netdev_WARN_ONCE(sq->channel->netdev,
+                                        "Bad OP in XDPSQ CQE: 0x%x\n",
+                                        get_cqe_opcode(cqe));
+
                do {
                        u16 ci = mlx5_wq_cyc_ctr2ix(&sq->wq, sqcc);
                        struct mlx5e_xdp_info *xdpi = &sq->db.xdpi[ci];