From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: davem@davemloft.net, sowmini.varadhan@oracle.com,
raghuram.kothakota@oracle.com
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 2/2] sunvnet: Re-check for a VIO_DESC_READY data descriptor after short udelay()
Date: Fri, 29 Aug 2014 16:18:09 -0400 [thread overview]
Message-ID: <20140829201809.GH14753@oracle.com> (raw)
Upon encountering the first !VIO_DESC_READY in vnet_walk_rx(),
it is frequently worthwhile to re-check the descriptor status
after a short microsecond delay, as a bursty sender could
be actively populating the descriptors, and the short udelay()
is far less expensive than rolling back to ldc_rx() and having
to wake up and read data on another LDC message.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Raghuram Kothakota <raghuram.kothakota@oracle.com>
---
drivers/net/ethernet/sun/sunvnet.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index fc13b9c..7b1f320 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -398,6 +398,20 @@ again:
err = vnet_walk_rx_one(port, dr, start, &ack);
if (err == -ECONNRESET)
return err;
+ if (err != 0) {
+ /* The descriptor was not READY. Retry with a
+ * small delay, in case we have a bursty sender
+ * that is actively populating the descriptors, to
+ * reduce the overhead of stopping and re-entering
+ * which would involve expensive LDC messages.
+ */
+ if (retries++ < 3) {
+ udelay(4);
+ goto again;
+ } else {
+ break;
+ }
+ }
if (ack_start == -1)
ack_start = start;
ack_end = start;
--
1.8.4.2
next reply other threads:[~2014-08-29 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 20:18 Sowmini Varadhan [this message]
2014-09-02 3:47 ` [PATCH net-next 2/2] sunvnet: Re-check for a VIO_DESC_READY data descriptor after short udelay() David Miller
2014-09-02 10:27 ` Sowmini Varadhan
2014-09-02 16:43 ` Raghuram Kothakota
2014-09-02 16:56 ` Sowmini Varadhan
2014-09-02 17:33 ` Raghuram Kothakota
2014-09-02 20:59 ` David Miller
2014-09-03 17:12 ` Sowmini Varadhan
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=20140829201809.GH14753@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=raghuram.kothakota@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.