From owner-freebsd-net@FreeBSD.ORG Mon Jun 17 10:04:29 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02ABDF40; Mon, 17 Jun 2013 10:04:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 66CB018B2; Mon, 17 Jun 2013 10:04:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r5HA4Ro3016819; Mon, 17 Jun 2013 14:04:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r5HA4RRw016818; Mon, 17 Jun 2013 14:04:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 17 Jun 2013 14:04:27 +0400 From: Gleb Smirnoff To: Ermal Lu?i Subject: Re: [PATH] ALTQ(9) codel algorithm implementation Message-ID: <20130617100427.GH1400@glebius.int.ru> References: <20130614095125.GQ12443@FreeBSD.org> <51BAF1BA.8000603@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-net , Andre Oppermann X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jun 2013 10:04:29 -0000 Ermal, On Fri, Jun 14, 2013 at 03:05:16PM +0200, Ermal Lu?i wrote: E> >> I'm afraid we can't grow mbuf packet header with 8 bytes just to satisfy E> >> the ALTQ codel algo, which would definitely have a limited usage among E> >> FreeBSD users. Thus, "enqueue_time" should go into mbuf_tags(9) not into E> >> mbuf packet header. E> >> E> > E> > Agreed. We don't have space for that in the mbuf header. There's some E> > other E> > fields that may be repurposed though, the header pointer for example which E> > is E> > almost entirely unused. With some updates to the TSO and Checksum offload E> > mechanism I have in the pipeline the "header" field can be easily E> > repurposed. E> > E> > Though I'm against an "obscure" ALTQ mechanism having its own mbuf header E> > field E> > as such. It must be a generic field that can be used by others as well. E> > E> > Yeah i forgot to clarify that. E> The initial implementation had the added field in tag of pf but for some E> reason i did not investigate, E> and this can be a more deep problem the tag not always made it up to ALTQ. E> Hence it was put in the mbuf header. E> E> I did not find a direct way on why the mbuf tag was lost. E> Also with codel this does give lots of dropped packet hence i choose this E> way. E> I do not like to grow the mbuf tag as well but that was the only consistent E> way to get this to work reliably. My guess is, that's because in FreeBSD 10 the pf mtag isn't allocated unconditionally, like it was in 9.x. Packets can flow through pf w/o pf mtag. You don't need to pollute the pf mtag, you just need to create a new tag for the codel. Sorry, but failure to find why smth doesn't works as expected isn't an excuse for a gross hack that affects entire network stack. -- Totus tuus, Glebius.