Commit 5e32066d authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

enic: make vnic_wq_buf doubly linked

This patch makes vnic_wq_buf doubly liked list. This is needed for dma_mapping
error check, in case some frag's dma map fails, we need to move back and remove
previously queued buffers.
Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5164172f
...@@ -47,11 +47,14 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq) ...@@ -47,11 +47,14 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
wq->ring.desc_size * buf->index; wq->ring.desc_size * buf->index;
if (buf->index + 1 == count) { if (buf->index + 1 == count) {
buf->next = wq->bufs[0]; buf->next = wq->bufs[0];
buf->next->prev = buf;
break; break;
} else if (j + 1 == VNIC_WQ_BUF_BLK_ENTRIES(count)) { } else if (j + 1 == VNIC_WQ_BUF_BLK_ENTRIES(count)) {
buf->next = wq->bufs[i + 1]; buf->next = wq->bufs[i + 1];
buf->next->prev = buf;
} else { } else {
buf->next = buf + 1; buf->next = buf + 1;
buf->next->prev = buf;
buf++; buf++;
} }
} }
......
...@@ -62,6 +62,7 @@ struct vnic_wq_buf { ...@@ -62,6 +62,7 @@ struct vnic_wq_buf {
uint8_t cq_entry; /* Gets completion event from hw */ uint8_t cq_entry; /* Gets completion event from hw */
uint8_t desc_skip_cnt; /* Num descs to occupy */ uint8_t desc_skip_cnt; /* Num descs to occupy */
uint8_t compressed_send; /* Both hdr and payload in one desc */ uint8_t compressed_send; /* Both hdr and payload in one desc */
struct vnic_wq_buf *prev;
}; };
/* Break the vnic_wq_buf allocations into blocks of 32/64 entries */ /* Break the vnic_wq_buf allocations into blocks of 32/64 entries */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment