Development issues regarding the cerowrt test router project
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Sebastian Moeller <moeller0@gmx.de>
Cc: "cerowrt-devel@lists.bufferbloat.net"
	<cerowrt-devel@lists.bufferbloat.net>
Subject: Re: [Cerowrt-devel] some kernel updates
Date: Fri, 23 Aug 2013 17:05:44 +0200	[thread overview]
Message-ID: <20130823170544.696b1dda@redhat.com> (raw)
In-Reply-To: <2D3FE3C2-AD17-4CDF-8DC3-D807B361EE66@gmx.de>

On Fri, 23 Aug 2013 14:37:47 +0200
Sebastian Moeller <moeller0@gmx.de> wrote:

> On Aug 23, 2013, at 13:16 , Jesper Dangaard Brouer <jbrouer@redhat.com> wrote:
> 
> > On Fri, 23 Aug 2013 12:15:12 +0200
> > Sebastian Moeller <moeller0@gmx.de> wrote:

[...]

> >>>>> Especially since the kernel already fudges
> >>>>> the packet size to account for the ethernet header and then some, so this
> >>>>> path should receive more scrutiny by virtue of having more users?
> >>> 
> >>> As you mention, the default kernel path (not tc stab) fudges the packet
> >>> size for Ethernet headers, AND I made a mistake (back in approx 2006,
> >>> sorry) that the "overhead" cannot be a negative number.  
> >> 
> >> 	Mmh, does this also apply to stab?
> > 
> > This seems to be two question...
> > 
> > Yes, the Ethernet header size gets adjusted/added before the "stab"
> > call.
> > For reference
> > See: net/core/dev.c function __dev_xmit_skb()
> > Call qdisc_pkt_len_init(skb); // adjust Ethernet and account for GSO
> > Call qdisc_calculate_pkt_len(skb, q); // is the stab call
> >  (ps calls __qdisc_calculate_pkt_len() in net/sched/sch_api.c)
> > 
> > The qdisc_pkt_len_init() call were introduced by Eric in
> > v3.9-rc1~139^2~411.
> 
> 	So I look at 3.10 here:
> 
> net/core/dev.c, qdisc_pkt_len_init
> line 2628: 	qdisc_skb_cb(skb)->pkt_len = skb->len;
> and in 
> line 2650: qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
> so the adjusted size does not seem to end in skb->len
> 
> 
> and then in 
> net/sched/sch_api.c, __qdisc_calculate_pkt_len
> line440: pkt_len = skb->len + stab->szopts.overhead;
> 
> So to my eyes this looks like stab is not honoring the changes made in qdisc_pkt_len_init, no? At least I fail to see where 
> skb->len is assigned qdisc_skb_cb(skb)->pkt_len
> But I happily admit that I am truly a novice in these matters and easily intimidated by C code.


You are absolutely correct, and I were wrong. Guess I didn't read
__qdisc_calculate_pkt_len() carefully enough, sorry.

When stab is enabled, it will override the skb pkt_len.


> > Thus, in kernels >= 3.9, you would need to change/reduce your tc
> > "overhead" parameter with -14 bytes (iif you accounted encapsulated
> > Ethernet header before)
> 
> 	That is what I thought before, but my kernel spelunking made
> me reconsider and switch to not subtract the 14 bytes since as I
> understand it the kernel actively does not do it if stab is used.

You are correct, and I was wrong.  Good to have more eyeballs on the
code :-)

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Sr. Network Kernel Developer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

  parent reply	other threads:[~2013-08-23 15:05 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 18:42 Dave Taht
     [not found] ` <56B261F1-2277-457C-9A38-FAB89818288F@gmx.de>
     [not found]   ` <CAA93jw6ku0OOXzNcAUtK4UL5uc7R2zVAOKo1+Fwzmr7gCH1pzA@mail.gmail.com>
     [not found]     ` <2148E2EF-A119-4499-BAC1-7E647C53F077@gmx.de>
2013-08-23  0:52       ` Sebastian Moeller
2013-08-23  5:13         ` Dave Taht
2013-08-23  7:27           ` Jesper Dangaard Brouer
2013-08-23 10:15             ` Sebastian Moeller
2013-08-23 11:16               ` Jesper Dangaard Brouer
2013-08-23 12:37                 ` Sebastian Moeller
2013-08-23 13:02                   ` Fred Stratton
2013-08-23 19:49                     ` Sebastian Moeller
2013-08-23 15:05                   ` Jesper Dangaard Brouer [this message]
2013-08-23 17:23                   ` Toke Høiland-Jørgensen
2013-08-23 20:09                     ` Sebastian Moeller
2013-08-23 20:46                       ` Toke Høiland-Jørgensen
2013-08-24 20:51                         ` Sebastian Moeller
2013-08-23 19:51             ` Sebastian Moeller
2013-08-23  9:16           ` Sebastian Moeller
2013-08-23 19:38           ` Sebastian Moeller
2013-08-23 19:47             ` Dave Taht
2013-08-23 19:56               ` Sebastian Moeller
2013-08-23 20:29                 ` Dave Taht
2013-08-24 20:51                   ` Sebastian Moeller
2013-08-24 20:51                   ` Sebastian Moeller
2013-08-25  9:21                     ` Fred Stratton
2013-08-25 10:17                       ` Fred Stratton
2013-08-25 13:59                         ` Sebastian Moeller
2013-08-25 14:26                           ` Fred Stratton
2013-08-25 14:31                             ` Fred Stratton
2013-08-25 17:53                             ` Sebastian Moeller
2013-08-25 17:55                               ` Dave Taht
2013-08-25 18:00                                 ` Fred Stratton
2013-08-25 18:30                               ` Fred Stratton
2013-08-25 18:41                                 ` Dave Taht
2013-08-25 19:08                                   ` Fred Stratton
2013-08-25 19:31                                     ` Fred Stratton
2013-08-25 21:54                                       ` Sebastian Moeller
2013-08-25 20:28                                     ` Dave Taht
2013-08-25 21:40                                       ` Sebastian Moeller
2013-08-25 21:50                                 ` Sebastian Moeller
2013-08-27 11:10                   ` Jesper Dangaard Brouer
2013-08-27 10:45                 ` Jesper Dangaard Brouer
2013-08-30 15:46                 ` [Cerowrt-devel] some kernel updates + new userspace patch Jesper Dangaard Brouer
2013-08-27 10:42             ` [Cerowrt-devel] some kernel updates Jesper Dangaard Brouer
2013-08-24 23:08           ` Sebastian Moeller

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

  List information: https://lists.bufferbloat.net/postorius/lists/cerowrt-devel.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130823170544.696b1dda@redhat.com \
    --to=jbrouer@redhat.com \
    --cc=cerowrt-devel@lists.bufferbloat.net \
    --cc=moeller0@gmx.de \
    /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