From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: netdev@vger.kernel.org
Subject: [PATCH v2 00/46] Clean up RX copybreak and DMA handling
Date: Mon, 11 Jul 2011 02:52:46 +0200 (CEST) [thread overview]
Message-ID: <cover.1310339688.git.mirq-linux@rere.qmqm.pl> (raw)
Quick rx_copybreak cleaning turned out to rise more dust around...
Most drivers use dma_sync_single_to_device() for buffers that are
written only by device. That's probably because of bad example in
current Documentation/DMA-API-HOWTO.txt. Why is it bad? It unnecessarily
flushes cachelines and CPU write buffers for memory that is not used
by the hardware. Documentation/DMA-API.txt (part Id) describes exactly
when streaming DMA buffers should be synced and in which direction.
Syncing DMA_FROM_DEVICE mappings for device is not among them.
A lot of drivers drop packets already DMA'd in on memory pressure. This
is suboptimal:
1. under packet storm and memory pressure NIC keeps generating interrupts
(if non-NAPI) and indicating new buffers because it always has free
RX buffers --- this only wastes CPU and bus bandwidth transferring
data that is going to be immediately discarded;
2. for users of swap over network (NBD, NFS - assumming those get
fixed, or maybe FCoE?) this can cause deadlock if the packets
(acks maybe?) are needed to reclaim memory.
It unlikely that you'll ever hit the dark scenarios above, but if you do
you'll have a hard time debugging.
Menu:
1..2:
wrap code commonly used in drivers into generic functions
3..4:
remove dma_sync_to_device(DMA_FROM_DEVICE) from drivers not
converted to common rx handling functions
5..10:
fix various DMA API usage bugs in rx handling code
11..14:
clean up rx buffer allocation in sun* drivers
15:
b43: use kfree_skb() if the skb is known not to have been used
16:
cxgb3: remove code dropping packets on memory pressure in driver
46:
mark some drivers that drop packets from rx queue head when under
memory pressure
Left out for later:
17..34:
convert multiple drivers to common rx_copybreak handling
35..45:
convert multiple drivers to common rx_copybreak handling; those
drivers drop rxed packets when under memory pressure
Patches 17..45 are more-or-less templated and in the same spirit as
the earlier version.
[davem: I plan send them after/if you agree to take patch 2. Or earlier,
if you want them all at once anyway.]
Best Regards,
Michał Mirosław
---
Michał Mirosław (46):
net: introduce __netdev_alloc_skb_aligned()
net: wrap common patterns of rx handler code
net drivers: remove unnecessary dma_sync_to_device(DMA_FROM_DEVICE)
net/wireless: p54: remove useless
dma_sync_single_for_device(DMA_FROM_DEVICE)
net: bnx2x: fix DMA sync direction
net/tokenring: 3c359: fix DMA API usage
net/wireless: ath9k: fix DMA API usage
net/wireless: b43: fix DMA direction for RX buffers
net: octeon_mgmt: fix DMA unmap size
net: jme: convert to generic DMA API
net: sungem: cleanup RX skb allocation
net: sunhme: cleanup RX skb allocation
net: sunbmac: cleanup RX skb allocation
net: sunbmac: cleanup magic '34'
net/wireless: b43: use kfree_skb() for untouched skbs
net: cxgb3: don't drop packets on memory pressure in driver
net: 3c59x: use common rx_copybreak handling
net: epic100: use common rx_copybreak handling
net: fealnx: use common rx_copybreak handling
net: hamachi: use common rx_copybreak handling
net: bcm63xx: use common rx_copybreak handling
net: chelsio: use common rx_copybreak handling
net: cxgb3: use common rx_copybreak handling
net: dl2k: use common rx_copybreak handling
net: natsemi: use common rx_copybreak handling
net: sis190: use common rx_copybreak handling
net: starfire: use common rx_copybreak handling
net: sundance: use common rx_copybreak handling
net: tulip/interrupt: use common rx_copybreak handling
net: tulip/winbond-840: use common rx_copybreak handling
net: typhoon: use common rx_copybreak handling
net: via-rhine: use common rx_copybreak handling
net: via-velocity: use common rx_copybreak handling
net: yellowfin: use common rx_copybreak handling
net: lib82596: use common rx_copybreak handling [strict refill!]
net: pcnet32: use common rx_copybreak handling [strict refill!]
net: sgiseeq: use common rx_copybreak handling [strict refill!]
net: tulip/de2104x: use common rx_copybreak handling [strict refill!]
net: sunhme: use common rx_copybreak handling [strict refill!]
net: sunbmac: use common rx_copybreak handling [strict refill!]
net: rrunner: use common rx_copybreak handling [strict refill!]
net: greth: use common rx_copybreak handling [strict refill!]
net: sunbmac: use common rx_copybreak handling [strict refill!]
net: tokenring/3c359: use common rx_copybreak handling [strict
refill!]
net/wireless: adm8211: use common rx_copybreak handling [strict
refill!]
net: mark drivers that drop packets from rx queue head under memory
pressure
drivers/net/3c59x.c | 23 +---
drivers/net/arm/ep93xx_eth.c | 6 +-
drivers/net/b44.c | 4 -
drivers/net/bcm63xx_enet.c | 28 +----
drivers/net/bnx2.c | 7 +-
drivers/net/bnx2x/bnx2x_cmn.c | 5 +-
drivers/net/bnx2x/bnx2x_cmn.h | 5 -
drivers/net/bnx2x/bnx2x_ethtool.c | 2 +-
drivers/net/cassini.c | 15 +--
drivers/net/chelsio/sge.c | 42 +------
drivers/net/cxgb3/sge.c | 57 ++-------
drivers/net/dl2k.c | 28 +----
drivers/net/e100.c | 3 -
drivers/net/e1000e/netdev.c | 4 +-
drivers/net/epic100.c | 32 ++----
drivers/net/fealnx.c | 40 ++-----
drivers/net/greth.c | 67 ++++-------
drivers/net/hamachi.c | 42 +------
drivers/net/jme.c | 40 +++----
drivers/net/lib82596.c | 70 +++--------
drivers/net/mlx4/en_rx.c | 8 +-
drivers/net/natsemi.c | 37 ++-----
drivers/net/octeon/octeon_mgmt.c | 9 +-
drivers/net/pcnet32.c | 53 ++-------
drivers/net/qlge/qlge_main.c | 11 --
drivers/net/r8169.c | 4 +-
drivers/net/rrunner.c | 66 +++--------
drivers/net/s2io.c | 6 +-
drivers/net/sgiseeq.c | 42 +++-----
drivers/net/sis190.c | 40 +------
drivers/net/skge.c | 6 +-
drivers/net/sky2.c | 4 +-
drivers/net/starfire.c | 28 ++---
drivers/net/sunbmac.c | 78 +++----------
drivers/net/sunbmac.h | 18 +---
drivers/net/sundance.c | 26 +---
drivers/net/sungem.c | 84 +++----------
drivers/net/sungem.h | 4 +-
drivers/net/sunhme.c | 61 ++--------
drivers/net/sunhme.h | 14 +--
drivers/net/tg3.c | 3 +-
drivers/net/tokenring/3c359.c | 74 ++++++------
drivers/net/tokenring/3c359.h | 4 +-
drivers/net/tokenring/olympic.c | 8 +-
drivers/net/tulip/de2104x.c | 39 ++-----
drivers/net/tulip/interrupt.c | 77 +++----------
drivers/net/tulip/winbond-840.c | 28 +----
drivers/net/typhoon.c | 26 +---
drivers/net/via-rhine.c | 38 +-----
drivers/net/via-velocity.c | 61 ++--------
drivers/net/vxge/vxge-main.c | 6 +-
drivers/net/wireless/adm8211.c | 41 +------
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 4 +-
drivers/net/wireless/ath/ath9k/ar9003_mac.h | 2 +-
drivers/net/wireless/ath/ath9k/recv.c | 10 +-
drivers/net/wireless/b43/dma.c | 15 ++-
drivers/net/wireless/b43legacy/dma.c | 19 ---
drivers/net/wireless/p54/p54pci.c | 2 -
drivers/net/wireless/p54/txrx.c | 22 ++--
drivers/net/yellowfin.c | 27 +----
include/linux/skbuff.h | 169 +++++++++++++++++++++++++++
61 files changed, 586 insertions(+), 1208 deletions(-)
--
1.7.5.4
next reply other threads:[~2011-07-11 0:52 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 0:52 Michał Mirosław [this message]
2011-07-11 0:52 ` [PATCH v2 06/46] net/tokenring: 3c359: fix DMA API usage Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 02/46] net: wrap common patterns of rx handler code Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 04/46] net/wireless: p54: remove useless dma_sync_single_for_device(DMA_FROM_DEVICE) Michał Mirosław
[not found] ` <86c8bde08b005ca7eb4806ea77aec1f3212d63fc.1310339688.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-11 15:15 ` Pavel Roskin
2011-07-12 4:50 ` Felix Fietkau
2011-07-11 0:52 ` [PATCH v2 05/46] net: bnx2x: fix DMA sync direction Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 01/46] net: introduce __netdev_alloc_skb_aligned() Michał Mirosław
2011-07-11 5:46 ` [PATCH net-next-2.6] net: introduce build_skb() Eric Dumazet
2011-07-11 10:53 ` Michał Mirosław
2011-07-12 15:40 ` Eric Dumazet
2011-07-12 15:54 ` Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 03/46] net drivers: remove unnecessary dma_sync_to_device(DMA_FROM_DEVICE) Michał Mirosław
2011-07-11 8:30 ` Vlad Zolotarov
2011-07-11 9:29 ` Michał Mirosław
2011-07-11 9:46 ` Vlad Zolotarov
2011-07-11 0:52 ` [PATCH v2 08/46] net/wireless: b43: fix DMA direction for RX buffers Michał Mirosław
[not found] ` <cover.1310339688.git.mirq-linux-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-11 0:52 ` [PATCH v2 07/46] net/wireless: ath9k: fix DMA API usage Michał Mirosław
2011-07-12 4:36 ` Felix Fietkau
[not found] ` <4E1BCF36.2010506-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2011-07-12 5:30 ` [ath9k-devel] " Ben Greear
2011-07-12 9:55 ` Michał Mirosław
2011-07-12 12:54 ` Felix Fietkau
[not found] ` <B4765EFC-B5C9-4E2D-BE00-ED5519D13A4E-Vt+b4OUoWG0@public.gmane.org>
2011-07-12 13:03 ` [ath9k-devel] " Michał Mirosław
[not found] ` <20110712130316.GA8621-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 14:21 ` Felix Fietkau
2011-07-12 15:58 ` Michał Mirosław
[not found] ` <20110712155849.GB10651-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 16:04 ` Felix Fietkau
2011-07-12 19:13 ` Michał Mirosław
2011-07-12 19:32 ` Ralf Baechle
[not found] ` <20110712193204.GB13413-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
2011-07-12 20:53 ` Michał Mirosław
[not found] ` <20110712205316.GA13503-CoA6ZxLDdyEEUmgCuDUIdw@public.gmane.org>
2011-07-12 20:59 ` Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 09/46] net: octeon_mgmt: fix DMA unmap size Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 11/46] net: sungem: cleanup RX skb allocation Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 10/46] net: jme: convert to generic DMA API Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 12/46] net: sunhme: cleanup RX skb allocation Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 13/46] net: sunbmac: " Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 46/46] net: mark drivers that drop packets from rx queue head under memory pressure Michał Mirosław
2011-07-11 5:40 ` Francois Romieu
2011-07-11 6:47 ` Eilon Greenstein
2011-07-11 10:04 ` Michał Mirosław
2011-07-11 10:16 ` Eilon Greenstein
2011-07-11 15:24 ` Stephen Hemminger
2011-07-11 0:52 ` [PATCH v2 16/46] net: cxgb3: don't drop packets on memory pressure in driver Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 14/46] net: sunbmac: cleanup magic '34' Michał Mirosław
2011-07-11 0:52 ` [PATCH v2 15/46] net/wireless: b43: use kfree_skb() for untouched skbs Michał Mirosław
2011-07-11 6:54 ` [PATCH v2 00/46] Clean up RX copybreak and DMA handling David Miller
2011-07-11 9:16 ` Michał Mirosław
2011-07-11 9:24 ` David Miller
2011-07-11 9:47 ` Michał Mirosław
2011-07-11 10:11 ` David Miller
2011-07-11 11:17 ` Michał Mirosław
2011-07-11 12:36 ` Ben Hutchings
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=cover.1310339688.git.mirq-linux@rere.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--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).