summaryrefslogtreecommitdiff
path: root/drivers/net/enic/vnic_rq.h
diff options
context:
space:
mode:
authorScott Feldman <scofeldm@cisco.com>2009-09-03 17:01:58 +0000
committerDavid S. Miller <davem@davemloft.net>2009-09-03 20:19:10 -0700
commit4badc385d1a9e140ad0992537237fc22211adad0 (patch)
tree5edf87f3240b4ad5c999e025c47d379f09f91296 /drivers/net/enic/vnic_rq.h
parent27e6c7d33835e7f347cdfb5025766b7d9a6596d1 (diff)
downloadlinux-3.10-4badc385d1a9e140ad0992537237fc22211adad0.tar.gz
linux-3.10-4badc385d1a9e140ad0992537237fc22211adad0.tar.bz2
linux-3.10-4badc385d1a9e140ad0992537237fc22211adad0.zip
enic: workaround A0 erratum
A0 revision ASIC has an erratum on the RQ desc cache on chip where the cache can become corrupted causing pkt buf writes to wrong locations. The s/w workaround is to post a dummy RQ desc in the ring every 32 descs, causing a flush of the cache. A0 parts are not production, but there are enough of these parts in the wild in test setups to warrant including workaround. A1 revision ASIC parts fix erratum. Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_rq.h')
-rw-r--r--drivers/net/enic/vnic_rq.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/enic/vnic_rq.h b/drivers/net/enic/vnic_rq.h
index fd0ef66d2e9..f7b5730cb74 100644
--- a/drivers/net/enic/vnic_rq.h
+++ b/drivers/net/enic/vnic_rq.h
@@ -143,6 +143,11 @@ static inline void vnic_rq_post(struct vnic_rq *rq,
}
}
+static inline int vnic_rq_posting_soon(struct vnic_rq *rq)
+{
+ return ((rq->to_use->index & VNIC_RQ_RETURN_RATE) == 0);
+}
+
static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count)
{
rq->ring.desc_avail += count;
@@ -186,7 +191,7 @@ static inline int vnic_rq_fill(struct vnic_rq *rq,
{
int err;
- while (vnic_rq_desc_avail(rq) > 1) {
+ while (vnic_rq_desc_avail(rq) > 0) {
err = (*buf_fill)(rq);
if (err)