From: Olof Johansson <olof@lixom.net>
To: jgarzik@pobox.com
Cc: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org
Subject: [PATCH] [10/12] pasemi_mac: Remove SKB copy/recycle logic
Date: Wed, 28 Nov 2007 20:57:56 -0600 [thread overview]
Message-ID: <20071129025756.GK17215@lixom.net> (raw)
In-Reply-To: <20071129025410.GA17215@lixom.net>
pasemi_mac: Remove SKB copy/recycle logic
It doesn't really buy us much, since copying is about as expensive
as the allocation in the first place. Just remove it for now.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
drivers/net/pasemi_mac.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -503,13 +503,8 @@ static void pasemi_mac_replenish_rx_ring
/* Entry in use? */
WARN_ON(*buff);
- /* skb might still be in there for recycle on short receives */
- if (info->skb)
- skb = info->skb;
- else {
- skb = dev_alloc_skb(BUF_SIZE);
- skb_reserve(skb, LOCAL_SKB_ALIGN);
- }
+ skb = dev_alloc_skb(BUF_SIZE);
+ skb_reserve(skb, LOCAL_SKB_ALIGN);
if (unlikely(!skb))
break;
@@ -666,21 +661,7 @@ static int pasemi_mac_clean_rx(struct pa
goto next;
}
- if (len < 256) {
- struct sk_buff *new_skb;
-
- new_skb = netdev_alloc_skb(mac->netdev,
- len + LOCAL_SKB_ALIGN);
- if (new_skb) {
- skb_reserve(new_skb, LOCAL_SKB_ALIGN);
- memcpy(new_skb->data, skb->data, len);
- /* save the skb in buffer_info as good */
- skb = new_skb;
- }
- /* else just continue with the old one */
- } else
- info->skb = NULL;
-
+ info->skb = NULL;
info->dma = 0;
if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
next prev parent reply other threads:[~2007-11-29 2:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 2:54 [PATCH] [0/12] pasemi_mac updates for 2.6.25 + DMA channel management library Olof Johansson
2007-11-29 2:54 ` [PATCH] [1/12] pasemi_mac: RX/TX ring management cleanup Olof Johansson
2007-12-01 21:54 ` Jeff Garzik
2007-11-29 2:56 ` [PATCH] [2/12] pasemi_mac: Move register definitions to include/asm-powerpc Olof Johansson
2007-11-29 2:56 ` [PATCH] [3/12] pasemi: DMA engine management library Olof Johansson
2007-11-29 2:56 ` [PATCH] [4/12] pasemi_mac: Convert to new dma library Olof Johansson
2007-11-29 2:56 ` [PATCH] [5/12] pasemi_mac: performance tweaks Olof Johansson
2007-11-29 2:56 ` [PATCH] [6/12] pasemi_mac: Fix TX cleaning Olof Johansson
2007-11-29 2:57 ` [PATCH] [7/12] pasemi_mac: Improve RX interrupt mitigation Olof Johansson
2007-11-29 2:57 ` [PATCH] [8/12] pasemi_mac: Software-based LRO support Olof Johansson
2007-11-29 2:57 ` [PATCH] [9/12] pasemi_mac: SKB unmap optimization Olof Johansson
2007-11-29 2:57 ` Olof Johansson [this message]
2007-11-29 2:58 ` [PATCH] [11/12] pasemi_mac: Print warning when not attaching to a PHY Olof Johansson
2007-11-29 2:58 ` [PATCH] [12/12] pasemi_mac: Don't enable RX/TX without a link (if possible) Olof Johansson
2007-11-29 2:59 ` [PATCH] [0/12] pasemi_mac updates for 2.6.25 + DMA channel management library Olof Johansson
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=20071129025756.GK17215@lixom.net \
--to=olof@lixom.net \
--cc=jgarzik@pobox.com \
--cc=linuxppc-dev@ozlabs.org \
--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).