public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech•com>
To: Neil Horman <nhorman@tuxdriver•com>
Cc: Eric Dumazet <eric.dumazet@gmail•com>,
	Jiri Pirko <jpirko@redhat•com>,
	netdev@vger•kernel.org, Alexey Dobriyan <adobriyan@gmail•com>,
	"David S. Miller" <davem@davemloft•net>
Subject: Re: [PATCH] pktgen: Clone skb to avoid corruption of skbs in ndo_start_xmit methods
Date: Tue, 19 Jul 2011 21:19:10 -0700	[thread overview]
Message-ID: <4E26573E.5060202@candelatech.com> (raw)
In-Reply-To: <20110720020737.GB2692@neilslaptop.think-freely.org>

On 07/19/2011 07:07 PM, Neil Horman wrote:
> On Tue, Jul 19, 2011 at 05:52:49PM -0700, Ben Greear wrote:
>> On 07/19/2011 05:43 PM, Eric Dumazet wrote:
>>> Le mardi 19 juillet 2011 à 20:19 -0400, Neil Horman a écrit :

>> When the features-flags work gets completed so that we can start adding
>> new flags, we could add a CANT_DO_MULTI_SKB flag to drivers with known
>> issues and then restrict pktgen config accordingly.
>>
> I think this is a good idea.  It lets pktgen dynamically make the clone/share
> decision dynamically and only impacts performance for those systems.
>
>> Upstream code already clears skb memory to avoid leaking kernel memory
>> contents, so if you take away multi-skb too, pktgen is going to suck
>> at what it is supposed to do:  run fast as possible.
>>
> I don't want to take away multi-skb, but I do want pktgen to work reliably.  I
> think flagging drivers that need unshared skbs is the way to go.

Lets all cheer on the Intel NIC driver guys and Mr. Miraslaw then!

>> If you want real fun, use pktgen on a wlan0 device...it will crash
>> regardless of whether you use multi-skb or not because of xmit-queue
>> number issues :P
>>
> I'll try that, thanks :)

Here's a probably-white-space damaged, and deemed-unfit-for-kernel patch
that at least works around the problem...my users don't really need pktgen
on wlans, so I didn't put any extra effort into it, but for someone
more motivated..this might be a good starting point :)

I guess it doesn't really crash, but if I recall correctly, it filled
up the queues in a bad way and effectively blocked all wifi traffic
until reboot, or maybe rmmod ath9k.


 From d57130f29843cab30196b11d4476231f245e3f92 Mon Sep 17 00:00:00 2001
From: Ben Greear <greearb@candelatech•com>
Date: Wed, 9 Feb 2011 16:58:42 -0800
Subject: [PATCH 31/38] mac80211: Set up tx-queue-mapping in subif_start_xmit.

Otherwise, ath9k gets confused about which queue to use
and spews a warning like this when driving traffic with
pktgen.

WARNING: at /home/greearb/git/linux.wireless-testing-ct/drivers/net/wireless/ath/ath9k/xmit.c:1748 ath_tx_start+0x4a2/0x662 [ath9k]()
Hardware name: To Be Filled By O.E.M.
Modules linked in: ath5k arc4 ath9k mac80211 ath9k_common ath9k_hw ath cfg80211 nfs lockd bluetooth cryptd aes_i586 aes_generic veth 8021q garp stp l]
Pid: 1729, comm: kpktgend_0 Tainted: G        W   2.6.38-rc4-wl+ #21
Call Trace:
  [<c043091b>] ? warn_slowpath_common+0x65/0x7a
  [<fabe784e>] ? ath_tx_start+0x4a2/0x662 [ath9k]
  [<c043093f>] ? warn_slowpath_null+0xf/0x13
  [<fabe784e>] ? ath_tx_start+0x4a2/0x662 [ath9k]
  [<fabe14d0>] ? ath9k_tx+0x14f/0x183 [ath9k]
  [<fab9026d>] ? __ieee80211_tx+0x10c/0x18c [mac80211]
  [<fab90397>] ? ieee80211_tx+0xaa/0x188 [mac80211]
  [<fab905f3>] ? ieee80211_xmit+0x17e/0x186 [mac80211]
  [<fab8ecc0>] ? ieee80211_skb_resize+0x8e/0xd2 [mac80211]
  [<fab9148b>] ? ieee80211_subif_start_xmit+0x643/0x65c [mac80211]
  [<c0440000>] ? rescuer_thread+0x25/0x1c8
  [<f92cd354>] ? pktgen_thread_worker+0x114c/0x1b44 [pktgen]
  [<fab90e48>] ? ieee80211_subif_start_xmit+0x0/0x65c [mac80211]
  [<c042d612>] ? default_wake_function+0xb/0xd
  [<c04254c7>] ? __wake_up_common+0x34/0x5c
  [<c0443a29>] ? autoremove_wake_function+0x0/0x2f
  [<f92cc208>] ? pktgen_thread_worker+0x0/0x1b44 [pktgen]
  [<c044371a>] ? kthread+0x62/0x67
  [<c04436b8>] ? kthread+0x0/0x67
  [<c04035f6>] ? kernel_thread_helper+0x6/0x10

Signed-off-by: Ben Greear <greearb@candelatech•com>
---
:100644 100644 64e0f75... e8ff199... M	net/mac80211/tx.c
  net/mac80211/tx.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 64e0f75..e8ff199 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1971,6 +1971,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
  	} else
  		memcpy(skb_push(skb, hdrlen), &hdr, hdrlen);

+	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
+
  	nh_pos += hdrlen;
  	h_pos += hdrlen;

-- 
1.7.3.4


>
> Regards
> Neil


-- 
Ben Greear <greearb@candelatech•com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2011-07-20  4:19 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 19:52 [PATCH] pktgen: Clone skb to avoid corruption of skbs in ndo_start_xmit methods Neil Horman
2011-07-19 20:02 ` Eric Dumazet
2011-07-19 20:17   ` Joe Perches
2011-07-19 20:29   ` Jiri Pirko
2011-07-19 20:41     ` Eric Dumazet
2011-07-19 21:01       ` Ben Greear
2011-07-20  0:19       ` Neil Horman
2011-07-20  0:25         ` Rick Jones
2011-07-20 15:23           ` Loke, Chetan
2011-07-20  0:43         ` Eric Dumazet
2011-07-20  0:52           ` Ben Greear
2011-07-20  2:07             ` Neil Horman
2011-07-20  4:19               ` Ben Greear [this message]
2011-07-20  4:24               ` Eric Dumazet
2011-07-20 15:17                 ` Loke, Chetan
2011-07-20 15:18                 ` Neil Horman
2011-07-20 15:30                   ` Eric Dumazet
2011-07-20 15:39                     ` Neil Horman
2011-07-20 15:44                       ` Eric Dumazet
2011-07-20 16:19                         ` Neil Horman
2011-07-20 15:35                   ` Michał Mirosław
2011-07-20 15:40                     ` Neil Horman
2011-07-20 16:08                       ` Michał Mirosław
2011-07-20 16:18                         ` Neil Horman
2011-07-20 16:37                     ` Ben Greear
2011-07-20 16:33                   ` Ben Greear
2011-07-20 16:36                     ` Neil Horman
2011-07-21 22:01                   ` David Miller
2011-07-21 22:14                     ` Ben Greear
2011-07-21 22:19                       ` David Miller
2011-07-21 22:26                         ` Ben Greear
2011-07-21 23:50                         ` Neil Horman
2011-07-22  0:08                           ` David Miller
2011-07-22  1:37                             ` Neil Horman
2011-07-20  1:59           ` Neil Horman
2011-07-25 19:45 ` [PATCH 0/2] pktgen: Clone skb to avoid corruption of skbs in ndo_start_xmit methods (v2) Neil Horman
2011-07-25 19:45   ` [PATCH 1/2] net: add IFF_SKB_TX_SHARED flag to priv_flags Neil Horman
2011-07-25 20:11     ` Eric Dumazet
2011-07-26 14:54       ` Neil Horman
2011-07-25 19:45   ` [PATCH 2/2] net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared Neil Horman
2011-07-26 18:34     ` Krzysztof Halasa
2011-07-26 16:05 ` [PATCH 0/2] pktgen: Clone skb to avoid corruption of skbs in ndo_start_xmit methods (v3) Neil Horman
2011-07-26 16:05   ` [PATCH 1/2] net: add IFF_SKB_TX_SHARED flag to priv_flags Neil Horman
2011-07-28  5:42     ` David Miller
2011-07-28  8:15     ` Robert Olsson
2011-07-28 10:50       ` Neil Horman
2011-07-26 16:05   ` [PATCH 2/2] net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared Neil Horman
2011-07-28  5:42     ` David Miller
2011-07-29  6:16   ` [PATCH 0/2] pktgen: Clone skb to avoid corruption of skbs in ndo_start_xmit methods (v3) Michael S. Tsirkin
2011-07-29 11:19     ` Neil Horman
2011-08-17 15:07   ` Ben Hutchings
2011-08-22  0:27     ` Neil Horman
2011-08-22 16:17       ` Ben Hutchings
2011-08-22 17:33         ` Ben Hutchings
2011-08-22 18:14         ` Neil Horman
2011-08-23 14:01           ` Ben Hutchings
2011-08-23 15:13             ` Neil Horman
2011-08-23 15:53               ` Ben Hutchings
2011-08-23 16:21                 ` Neil Horman

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=4E26573E.5060202@candelatech.com \
    --to=greearb@candelatech$(echo .)com \
    --cc=adobriyan@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jpirko@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@tuxdriver$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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