mlx5: support napi_complete_done()
[linux-2.6-block.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_rx.c
index 54800c61a5639383c66c83320c95cfc81e57e227..fe752f8e24b9b903a05c1b5e749ac1e0d39ce4b1 100644 (file)
@@ -216,16 +216,16 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
                                       be16_to_cpu(cqe->vlan_info));
 }
 
-bool mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
+int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget)
 {
        struct mlx5e_rq *rq = container_of(cq, struct mlx5e_rq, cq);
-       int i;
+       int work_done;
 
        /* avoid accessing cq (dma coherent memory) if not needed */
        if (!test_and_clear_bit(MLX5E_CQ_HAS_CQES, &cq->flags))
-               return false;
+               return 0;
 
-       for (i = 0; i < budget; i++) {
+       for (work_done = 0; work_done < budget; work_done++) {
                struct mlx5e_rx_wqe *wqe;
                struct mlx5_cqe64 *cqe;
                struct sk_buff *skb;
@@ -271,10 +271,8 @@ wq_ll_pop:
        /* ensure cq space is freed before enabling more cqes */
        wmb();
 
-       if (i == budget) {
+       if (work_done == budget)
                set_bit(MLX5E_CQ_HAS_CQES, &cq->flags);
-               return true;
-       }
 
-       return false;
+       return work_done;
 }