From: Govindarajulu Varadarajan <_govind@gmx.com>
To: davem@davemloft.net, netdev@vger.kernel.org, sassmann@redhat.com
Cc: ssujith@cisco.com, benve@cisco.com,
Govindarajulu Varadarajan <_govind@gmx.com>
Subject: [PATCH net-next 1/3] enic: make vnic_wq_buf doubly linked
Date: Wed, 24 Dec 2014 15:59:36 +0530 [thread overview]
Message-ID: <1419416978-1008-2-git-send-email-_govind@gmx.com> (raw)
In-Reply-To: <1419416978-1008-1-git-send-email-_govind@gmx.com>
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>
---
drivers/net/ethernet/cisco/enic/vnic_wq.c | 3 +++
drivers/net/ethernet/cisco/enic/vnic_wq.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.c b/drivers/net/ethernet/cisco/enic/vnic_wq.c
index 3e6b8d5..b5a1c93 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++;
}
}
diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.h b/drivers/net/ethernet/cisco/enic/vnic_wq.h
index 816f1ad..2961543 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_wq.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_wq.h
@@ -62,6 +62,7 @@ struct vnic_wq_buf {
uint8_t cq_entry; /* Gets completion event from hw */
uint8_t desc_skip_cnt; /* Num descs to occupy */
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 */
--
2.2.1
next prev parent reply other threads:[~2014-12-24 10:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-24 10:29 [PATCH net-next 0/3] enic: Check for DMA mapping error Govindarajulu Varadarajan
2014-12-24 10:29 ` Govindarajulu Varadarajan [this message]
2015-01-05 17:30 ` [PATCH net-next 1/3] enic: make vnic_wq_buf doubly linked David Laight
2014-12-24 10:29 ` [PATCH net-next 2/3] enic: check dma_mapping_error Govindarajulu Varadarajan
2015-01-05 17:28 ` David Laight
2014-12-24 10:29 ` [PATCH net-next 3/3] enic: add stats for dma mapping error Govindarajulu Varadarajan
2014-12-31 18:09 ` [PATCH net-next 0/3] enic: Check for DMA " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1419416978-1008-2-git-send-email-_govind@gmx.com \
--to=_govind@gmx.com \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
--cc=ssujith@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).