X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fenic%2Fbase%2Fvnic_wq.c;h=fc6dde5ae8753caecb20ab7b31e3ffa27b9d5750;hb=a001f09d11fac91b760c038cf69af7b041bc983c;hp=d61c4c6e27e5038aac0a7330dbc4e440791ce9aa;hpb=2e99ea80f8bc0f10e9e7226e6cea3aa307891727;p=dpdk.git diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c index d61c4c6e27..fc6dde5ae8 100644 --- a/drivers/net/enic/base/vnic_wq.c +++ b/drivers/net/enic/base/vnic_wq.c @@ -20,7 +20,7 @@ static inline int vnic_wq_alloc_ring(struct vnic_dev *vdev, struct vnic_wq *wq, unsigned int desc_count, unsigned int desc_size) { - char res_name[NAME_MAX]; + char res_name[RTE_MEMZONE_NAMESIZE]; static int instance; snprintf(res_name, sizeof(res_name), "%d-wq-%u", instance++, wq->index); @@ -32,8 +32,8 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq) { unsigned int count = wq->ring.desc_count; /* Allocate the mbuf ring */ - wq->bufs = (struct vnic_wq_buf *)rte_zmalloc_socket("wq->bufs", - sizeof(struct vnic_wq_buf) * count, + wq->bufs = (struct rte_mbuf **)rte_zmalloc_socket("wq->bufs", + sizeof(struct rte_mbuf *) * count, RTE_CACHE_LINE_SIZE, wq->socket_id); wq->head_idx = 0; wq->tail_idx = 0; @@ -89,10 +89,10 @@ void vnic_wq_init_start(struct vnic_wq *wq, unsigned int cq_index, unsigned int error_interrupt_enable, unsigned int error_interrupt_offset) { - u64 paddr; + uint64_t paddr; unsigned int count = wq->ring.desc_count; - paddr = (u64)wq->ring.base_addr | VNIC_PADDR_TARGET; + paddr = (uint64_t)wq->ring.base_addr | VNIC_PADDR_TARGET; writeq(paddr, &wq->ctrl->ring_base); iowrite32(count, &wq->ctrl->ring_size); iowrite32(fetch_index, &wq->ctrl->fetch_index); @@ -113,6 +113,7 @@ void vnic_wq_init(struct vnic_wq *wq, unsigned int cq_index, vnic_wq_init_start(wq, cq_index, 0, 0, error_interrupt_enable, error_interrupt_offset); + wq->cq_pend = 0; wq->last_completed_index = 0; } @@ -136,7 +137,7 @@ int vnic_wq_disable(struct vnic_wq *wq) for (wait = 0; wait < 1000; wait++) { if (!(ioread32(&wq->ctrl->running))) return 0; - udelay(10); + usleep(10); } pr_err("Failed to disable WQ[%d]\n", wq->index); @@ -145,9 +146,9 @@ int vnic_wq_disable(struct vnic_wq *wq) } void vnic_wq_clean(struct vnic_wq *wq, - void (*buf_clean)(struct vnic_wq_buf *buf)) + void (*buf_clean)(struct rte_mbuf **buf)) { - struct vnic_wq_buf *buf; + struct rte_mbuf **buf; unsigned int to_clean = wq->tail_idx; buf = &wq->bufs[to_clean];