aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cisco/enic/vnic_wq.c
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <_govind@gmx.com>2014-12-24 15:59:36 +0530
committerDavid S. Miller <davem@davemloft.net>2014-12-31 13:08:45 -0500
commit5e32066d0085af3c53834323c90b7c69a8f788f6 (patch)
tree376acdfa427eb59f247d7cdb452ee26c53215181 /drivers/net/ethernet/cisco/enic/vnic_wq.c
parentMerge branch 'fec-next' (diff)
downloadlinux-dev-5e32066d0085af3c53834323c90b7c69a8f788f6.tar.xz
linux-dev-5e32066d0085af3c53834323c90b7c69a8f788f6.zip
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: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco/enic/vnic_wq.c')
-rw-r--r--drivers/net/ethernet/cisco/enic/vnic_wq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.c b/drivers/net/ethernet/cisco/enic/vnic_wq.c
index 3e6b8d54dafc..b5a1c937fad2 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_wq.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_wq.c
@@ -47,11 +47,14 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
wq->ring.desc_size * buf->index;
if (buf->index + 1 == count) {
buf->next = wq->bufs[0];
+ buf->next->prev = buf;
break;
} else if (j + 1 == VNIC_WQ_BUF_BLK_ENTRIES(count)) {
buf->next = wq->bufs[i + 1];
+ buf->next->prev = buf;
} else {
buf->next = buf + 1;
+ buf->next->prev = buf;
buf++;
}
}