From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 3/7] sky2: simplify list element error
Date: Tue, 18 Aug 2009 18:17:07 -0700 [thread overview]
Message-ID: <20090819011738.760531366@vyatta.com> (raw)
In-Reply-To: 20090819011704.685802801@vyatta.com
[-- Attachment #1: sky2-le-error.patch --]
[-- Type: text/plain, Size: 2017 bytes --]
The code for list element error (which should only happen on hardware
errors) should be cleaner and safer. Gets rid of unused ring_size
argument, which makes next patch easier.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/sky2.c 2009-08-18 09:33:15.490426779 -0700
+++ b/drivers/net/sky2.c 2009-08-18 09:34:30.664368374 -0700
@@ -2661,19 +2661,15 @@ static void sky2_mac_intr(struct sky2_hw
}
/* This should never happen it is a bug. */
-static void sky2_le_error(struct sky2_hw *hw, unsigned port,
- u16 q, unsigned ring_size)
+static void sky2_le_error(struct sky2_hw *hw, unsigned port, u16 q)
{
struct net_device *dev = hw->dev[port];
- struct sky2_port *sky2 = netdev_priv(dev);
- unsigned idx;
- const u64 *le = (q == Q_R1 || q == Q_R2)
- ? (u64 *) sky2->rx_le : (u64 *) sky2->tx_le;
-
- idx = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX));
- printk(KERN_ERR PFX "%s: descriptor error q=%#x get=%u [%llx] put=%u\n",
- dev->name, (unsigned) q, idx, (unsigned long long) le[idx],
- (unsigned) sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX)));
+ u16 idx = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX));
+
+ dev_err(&hw->pdev->dev, PFX
+ "%s: descriptor error q=%#x get=%u put=%u\n",
+ dev->name, (unsigned) q, (unsigned) idx,
+ (unsigned) sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX)));
sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_CLR_IRQ_CHK);
}
@@ -2759,16 +2755,16 @@ static void sky2_err_intr(struct sky2_hw
sky2_mac_intr(hw, 1);
if (status & Y2_IS_CHK_RX1)
- sky2_le_error(hw, 0, Q_R1, RX_LE_SIZE);
+ sky2_le_error(hw, 0, Q_R1);
if (status & Y2_IS_CHK_RX2)
- sky2_le_error(hw, 1, Q_R2, RX_LE_SIZE);
+ sky2_le_error(hw, 1, Q_R2);
if (status & Y2_IS_CHK_TXA1)
- sky2_le_error(hw, 0, Q_XA1, TX_RING_SIZE);
+ sky2_le_error(hw, 0, Q_XA1);
if (status & Y2_IS_CHK_TXA2)
- sky2_le_error(hw, 1, Q_XA2, TX_RING_SIZE);
+ sky2_le_error(hw, 1, Q_XA2);
}
static int sky2_poll(struct napi_struct *napi, int work_limit)
--
next prev parent reply other threads:[~2009-08-19 1:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 1:17 [PATCH 0/7] sky2: tx performance improvement Stephen Hemminger
2009-08-19 1:17 ` [PATCH 1/7] sky2: use upper/lower 32 bits Stephen Hemminger
2009-08-19 1:17 ` [PATCH 2/7] sky2: transmit ring 64 bit conservation Stephen Hemminger
2009-08-19 1:17 ` Stephen Hemminger [this message]
2009-08-19 1:17 ` [PATCH 4/7] sky2: dynamic size transmit ring Stephen Hemminger
2009-08-19 1:17 ` [PATCH 5/7] sky2: optimize transmit completion Stephen Hemminger
2009-08-19 1:17 ` [PATCH 6/7] sky2: no recycling Stephen Hemminger
2009-08-19 19:58 ` Stephen Hemminger
2009-08-19 1:17 ` [PATCH 7/7] sky2: version 1.25 Stephen Hemminger
2009-08-19 3:28 ` [PATCH 0/7] sky2: tx performance improvement 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=20090819011738.760531366@vyatta.com \
--to=shemminger@vyatta.com \
--cc=davem@davemloft.net \
--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).