From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH 11/12] sky2: avoid divide in receive path
Date: Wed, 29 Aug 2007 12:58:20 -0700 [thread overview]
Message-ID: <20070829195843.233327131@linux-foundation.org> (raw)
In-Reply-To: 20070829193922.078561651@linux-foundation.org
[-- Attachment #1: sky2-rx-ring-mod.patch --]
[-- Type: text/plain, Size: 687 bytes --]
Avoid divide (modulus) in receive buffer handling path.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-08-29 11:41:23.000000000 -0700
+++ b/drivers/net/sky2.c 2007-08-29 11:45:00.000000000 -0700
@@ -2140,7 +2140,8 @@ static struct sk_buff *sky2_receive(stru
printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n",
dev->name, sky2->rx_next, status, length);
- sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
+ if (++sky2->rx_next >= sky2->rx_pending)
+ sky2->rx_next = 0;
prefetch(sky2->rx_ring + sky2->rx_next);
if (status & GMR_FS_ANY_ERR)
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-08-29 20:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-29 19:39 [PATCH 0/0] sky2: update for 2.6.24 Stephen Hemminger
2007-08-29 19:58 ` [PATCH 01/12] sky2: fe+ chip support Stephen Hemminger
2007-08-31 13:43 ` Jeff Garzik
2007-09-14 13:38 ` [PATCH] sky2: fix PHY setup on FE-P Stephen Hemminger
2007-08-29 19:58 ` [PATCH 02/12] sky2: use debugfs rename Stephen Hemminger
2007-08-29 19:58 ` [PATCH 03/12] sky2: document GPHY_CTRL bits Stephen Hemminger
2007-08-29 19:58 ` [PATCH 04/12] sky2: dont restrict config space access Stephen Hemminger
2007-08-29 19:58 ` [PATCH 05/12] sky2: advanced error reporting Stephen Hemminger
2007-08-29 19:58 ` [PATCH 06/12] sky2: use pci_config access functions Stephen Hemminger
2007-08-29 19:58 ` [PATCH 07/12] sky2: use net_device internal stats Stephen Hemminger
2007-08-31 13:43 ` Jeff Garzik
2007-08-31 13:59 ` Stephen Hemminger
2007-08-29 19:58 ` [PATCH 08/12] ktime_sub_ns: analog of ktime_add_ns Stephen Hemminger
2007-08-29 19:58 ` [PATCH 09/12] export reciprocal_value for modules Stephen Hemminger
2007-08-29 19:58 ` [PATCH 10/12] sky2: hardware receive timestamp counter Stephen Hemminger
2007-08-29 19:58 ` Stephen Hemminger [this message]
2007-08-29 19:58 ` [PATCH 12/12] sky2: 1.18 Stephen Hemminger
2007-08-30 20:36 ` [PATCH 0/0] sky2: update for 2.6.24 Stephen Hemminger
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=20070829195843.233327131@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/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).