net/mlx5e: Pop cq outside mlx5e_get_cqe
authorAchiad Shochat <achiad@mellanox.com>
Tue, 23 Jun 2015 14:14:21 +0000 (17:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2015 07:42:41 +0000 (00:42 -0700)
Separate between mlx5e_get_cqe() and mlx5_cqwq_pop(), this helps for
better code readability and better CQ buffer management.

Signed-off-by: Achiad Shochat <achiad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

index 4a259575359702dd1a56b6b65be2a4e96646966b..760b3ef64f17c175a571303a20d5ac1a7baf35e5 100644 (file)
@@ -209,6 +209,8 @@ bool mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
                if (!cqe)
                        break;
 
+               mlx5_cqwq_pop(&cq->wq);
+
                wqe_counter_be = cqe->wqe_counter;
                wqe_counter    = be16_to_cpu(wqe_counter_be);
                wqe            = mlx5_wq_ll_get_wqe(&rq->wq, wqe_counter);
index c789619b9c8ee0baa0e28783560d66caad147606..03f28f438e55ab690cc865b6bc3509a53d280e25 100644 (file)
@@ -288,6 +288,8 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq)
                if (!cqe)
                        break;
 
+               mlx5_cqwq_pop(&cq->wq);
+
                wqe_counter = be16_to_cpu(cqe->wqe_counter);
 
                do {
index bf6b27b2fec2313a80fc5e33a9f37df7c344fa6c..2c7cb6755d1d7d73c48a89cf621a0c74d1dc745b 100644 (file)
@@ -43,8 +43,6 @@ struct mlx5_cqe64 *mlx5e_get_cqe(struct mlx5e_cq *cq)
        if (cqe_ownership_bit != sw_ownership_val)
                return NULL;
 
-       mlx5_cqwq_pop(wq);
-
        /* ensure cqe content is read after cqe ownership bit */
        rmb();