net/mlx4: use standard macro to get array size
[dpdk.git] / drivers / net / enic / base / vnic_wq.c
index cfef1af..7c4119c 100644 (file)
@@ -179,7 +179,7 @@ int vnic_wq_disable(struct vnic_wq *wq)
 }
 
 void vnic_wq_clean(struct vnic_wq *wq,
-       void (*buf_clean)(struct vnic_wq *wq, struct vnic_wq_buf *buf))
+                  void (*buf_clean)(struct vnic_wq_buf *buf))
 {
        struct vnic_wq_buf *buf;
        unsigned int  to_clean = wq->tail_idx;
@@ -188,7 +188,7 @@ void vnic_wq_clean(struct vnic_wq *wq,
 
        while (vnic_wq_desc_used(wq) > 0) {
 
-               (*buf_clean)(wq, buf);
+               (*buf_clean)(buf);
                to_clean = buf_idx_incr(wq->ring.desc_count, to_clean);
 
                buf = &wq->bufs[to_clean];
@@ -197,6 +197,8 @@ void vnic_wq_clean(struct vnic_wq *wq,
 
        wq->head_idx = 0;
        wq->tail_idx = 0;
+       wq->last_completed_index = 0;
+       *((uint32_t *)wq->cqmsg_rz->addr) = 0;
 
        iowrite32(0, &wq->ctrl->fetch_index);
        iowrite32(0, &wq->ctrl->posted_index);