From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/7] sky2: transmit ring 64 bit conservation
Date: Tue, 18 Aug 2009 18:17:06 -0700 [thread overview]
Message-ID: <20090819011738.684469289@vyatta.com> (raw)
In-Reply-To: 20090819011704.685802801@vyatta.com
[-- Attachment #1: sky2-64.patch --]
[-- Type: text/plain, Size: 2091 bytes --]
This patch saves elements on transmit ring by only updating the upper
64 bit address when it changes. With many workloads skb's are located
in same region, so it saves space.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/sky2.c 2009-08-18 09:32:29.143195273 -0700
+++ b/drivers/net/sky2.c 2009-08-18 09:33:15.490426779 -0700
@@ -1016,6 +1016,7 @@ static void tx_init(struct sky2_port *sk
le = get_tx_le(sky2, &sky2->tx_prod);
le->addr = 0;
le->opcode = OP_ADDR64 | HW_OWNER;
+ sky2->tx_last_upper = 0;
}
static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
@@ -1573,8 +1574,9 @@ static int sky2_xmit_frame(struct sk_buf
struct sky2_tx_le *le = NULL;
struct tx_ring_info *re;
unsigned i, len;
- u16 slot;
dma_addr_t mapping;
+ u32 upper;
+ u16 slot;
u16 mss;
u8 ctrl;
@@ -1593,9 +1595,11 @@ static int sky2_xmit_frame(struct sk_buf
dev->name, slot, skb->len);
/* Send high bits if needed */
- if (sizeof(dma_addr_t) > sizeof(u32)) {
+ upper = upper_32_bits(mapping);
+ if (upper != sky2->tx_last_upper) {
le = get_tx_le(sky2, &slot);
- le->addr = cpu_to_le32(upper_32_bits(mapping));
+ le->addr = cpu_to_le32(upper);
+ sky2->tx_last_upper = upper;
le->opcode = OP_ADDR64 | HW_OWNER;
}
@@ -1681,10 +1685,11 @@ static int sky2_xmit_frame(struct sk_buf
if (pci_dma_mapping_error(hw->pdev, mapping))
goto mapping_unwind;
- if (sizeof(dma_addr_t) > sizeof(u32)) {
+ upper = upper_32_bits(mapping);
+ if (upper != sky2->tx_last_upper) {
le = get_tx_le(sky2, &slot);
- le->addr = cpu_to_le32(upper_32_bits(mapping));
- le->ctrl = 0;
+ le->addr = cpu_to_le32(upper);
+ sky2->tx_last_upper = upper;
le->opcode = OP_ADDR64 | HW_OWNER;
}
--- a/drivers/net/sky2.h 2009-08-18 09:29:59.224176503 -0700
+++ b/drivers/net/sky2.h 2009-08-18 09:33:15.491426771 -0700
@@ -2017,6 +2017,7 @@ struct sky2_port {
u16 tx_pending;
u16 tx_last_mss;
+ u32 tx_last_upper;
u32 tx_tcpsum;
struct rx_ring_info *rx_ring ____cacheline_aligned_in_smp;
--
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 ` Stephen Hemminger [this message]
2009-08-19 1:17 ` [PATCH 3/7] sky2: simplify list element error Stephen Hemminger
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.684469289@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).