All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: stable@vger.kernel.org, Neil Horman <nhorman@tuxdriver.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	"David S. Miller" <davem@davemloft.net>,
	netem@lists.linux-foundation.org, stephen@networkplumber.org
Subject: Re: [patch added to 3.12-stable] netem: Segment GSO packets on enqueue
Date: Wed, 18 May 2016 16:59:02 +0200	[thread overview]
Message-ID: <573C8336.9020507@suse.cz> (raw)
In-Reply-To: <1463583286.18194.116.camel@edumazet-glaptop3.roam.corp.google.com>

On 05/18/2016, 04:54 PM, Eric Dumazet wrote:
> On Wed, 2016-05-18 at 16:44 +0200, Jiri Slaby wrote:
>> From: Neil Horman <nhorman@tuxdriver.com>
>>
>> This patch has been added to the 3.12 stable tree. If you have any
>> objections, please let us know.
>>
>> ===============
>>
>> [ Upstream commit 6071bd1aa13ed9e41824bafad845b7b7f4df5cfd ]
>>
>> This was recently reported to me, and reproduced on the latest net kernel,
>> when attempting to run netperf from a host that had a netem qdisc attached
>> to the egress interface:
>>
>> [  788.073771] ---------------------[ cut here ]---------------------------
>> [  788.096716] WARNING: at net/core/dev.c:2253 skb_warn_bad_offload+0xcd/0xda()
>> [  788.129521] bnx2: caps=(0x00000001801949b3, 0x0000000000000000) len=2962
>> data_len=0 gso_size=1448 gso_type=1 ip_summed=3
>> [  788.182150] Modules linked in: sch_netem kvm_amd kvm crc32_pclmul ipmi_ssif
>> ghash_clmulni_intel sp5100_tco amd64_edac_mod aesni_intel lrw gf128mul
>> glue_helper ablk_helper edac_mce_amd cryptd pcspkr sg edac_core hpilo ipmi_si
>> i2c_piix4 k10temp fam15h_power hpwdt ipmi_msghandler shpchp acpi_power_meter
>> pcc_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c
>> sd_mod crc_t10dif crct10dif_generic mgag200 syscopyarea sysfillrect sysimgblt
>> i2c_algo_bit drm_kms_helper ahci ata_generic pata_acpi ttm libahci
>> crct10dif_pclmul pata_atiixp tg3 libata crct10dif_common drm crc32c_intel ptp
>> serio_raw bnx2 r8169 hpsa pps_core i2c_core mii dm_mirror dm_region_hash dm_log
>> dm_mod
>> [  788.465294] CPU: 16 PID: 0 Comm: swapper/16 Tainted: G        W
>> ------------   3.10.0-327.el7.x86_64 #1
>> [  788.511521] Hardware name: HP ProLiant DL385p Gen8, BIOS A28 12/17/2012
>> [  788.542260]  ffff880437c036b8 f7afc56532a53db9 ffff880437c03670
>> ffffffff816351f1
>> [  788.576332]  ffff880437c036a8 ffffffff8107b200 ffff880633e74200
>> ffff880231674000
>> [  788.611943]  0000000000000001 0000000000000003 0000000000000000
>> ffff880437c03710
>> [  788.647241] Call Trace:
>> [  788.658817]  <IRQ>  [<ffffffff816351f1>] dump_stack+0x19/0x1b
>> [  788.686193]  [<ffffffff8107b200>] warn_slowpath_common+0x70/0xb0
>> [  788.713803]  [<ffffffff8107b29c>] warn_slowpath_fmt+0x5c/0x80
>> [  788.741314]  [<ffffffff812f92f3>] ? ___ratelimit+0x93/0x100
>> [  788.767018]  [<ffffffff81637f49>] skb_warn_bad_offload+0xcd/0xda
>> [  788.796117]  [<ffffffff8152950c>] skb_checksum_help+0x17c/0x190
>> [  788.823392]  [<ffffffffa01463a1>] netem_enqueue+0x741/0x7c0 [sch_netem]
>> [  788.854487]  [<ffffffff8152cb58>] dev_queue_xmit+0x2a8/0x570
>> [  788.880870]  [<ffffffff8156ae1d>] ip_finish_output+0x53d/0x7d0
>> ...
>>
>> The problem occurs because netem is not prepared to handle GSO packets (as it
>> uses skb_checksum_help in its enqueue path, which cannot manipulate these
>> frames).
>>
>> The solution I think is to simply segment the skb in a simmilar fashion to the
>> way we do in __dev_queue_xmit (via validate_xmit_skb), with some minor changes.
>> When we decide to corrupt an skb, if the frame is GSO, we segment it, corrupt
>> the first segment, and enqueue the remaining ones.
>>
>> tested successfully by myself on the latest net kernel, to which this applies
>>
>> [js] backport to 3.12: no qdisc_qstats_drop yet, update directly
> 
> ... But qdisc_tree_reduce_backlog() was not there in 3.12

Yeah, but I pulled the series from net_41 including the
qdisc_tree_reduce_backlog backport.

>> +		if (nb > 1)
>> +			qdisc_tree_reduce_backlog(sch, 1 - nb, prev_len - len);
>> +	}
>>  	return NET_XMIT_SUCCESS;
>>  }

thanks,
-- 
js
suse labs

  reply	other threads:[~2016-05-18 14:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 14:44 [patch added to 3.12-stable] crypto: hash - Fix page length clamping in hash walk Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] get_rock_ridge_filename(): handle malformed NM entries Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] Input: max8997-haptic - fix NULL pointer dereference Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] asmlinkage, pnp: Make variables used from assembler code visible Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] drm/radeon: fix PLL sharing on DCE6.1 (v2) Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] drm/i915: Bail out of pipe config compute loop on LPT Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] ARM: OMAP3: Fix booting with thumb2 kernel Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net/route: enforce hoplimit max value Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] decnet: Do not build routes to devices without decnet private data Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] route: do not cache fib route info on local routes with oif Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] atl2: Disable unimplemented scatter/gather feature Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] ipv4/fib: don't warn when primary address is missing if in_dev is dead Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net/mlx4_en: fix spurious timestamping callbacks Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net_sched: introduce qdisc_replace() helper Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net_sched: update hierarchical backlog too Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] sch_htb: update backlog as well Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] sch_dsmark: " Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] netem: Segment GSO packets on enqueue Jiri Slaby
2016-05-18 14:54   ` Eric Dumazet
2016-05-18 14:59     ` Jiri Slaby [this message]
2016-05-18 16:04       ` Eric Dumazet
2016-05-19  6:44         ` Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net: fix infoleak in llc Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net: fix infoleak in rtnetlink Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] VSOCK: do not disconnect socket when peer has shutdown SEND only Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net: bridge: fix old ioctl unlocked net device walk Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] net: fix a kernel infoleak in x25 module Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] ASN.1: Fix non-match detection failure on data overrun Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] KEYS: Fix ASN.1 indefinite length object parsing Jiri Slaby
2016-05-18 14:44 ` [patch added to 3.12-stable] sched: Remove lockdep check in sched_move_task() Jiri Slaby

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=573C8336.9020507@suse.cz \
    --to=jslaby@suse.cz \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=netem@lists.linux-foundation.org \
    --cc=nhorman@tuxdriver.com \
    --cc=stable@vger.kernel.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.