From patchwork Tue Mar 15 18:28:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 87026 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 18F22B70D4 for ; Wed, 16 Mar 2011 05:28:47 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758279Ab1COS2m (ORCPT ); Tue, 15 Mar 2011 14:28:42 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:61503 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758218Ab1COS2m (ORCPT ); Tue, 15 Mar 2011 14:28:42 -0400 Received: by bwz15 with SMTP id 15so825708bwz.19 for ; Tue, 15 Mar 2011 11:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=XESGFmlYZii+qEB9W8pL4pVTKzMXNknzL/KvxP8bbHY=; b=FEaQoZcYQLYWH6Y/PO9fsov6iKFCMNcJ4sX1l079DXMxHbrpZ2OiHHyKfVX+PcqYoF BO/mZWRUG96KcxfgNxBNWHHcV9sNg8bIg4fT2DZ0XU8H2V7/ArzEV2T2EOjnl4qL+c7M HqYK7s9QbTkJE51jKcqyYHFIoX5LiOqOAKnqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=WYzUJ+kfvG84DxP6bLUAm+V9FHaE3K/4latPur5jHrYnzA55YeeP2/Bq8NRmd3UKbJ oDe4zJs8lhs86kVlOAZUoBDUUKs2MDxK8jUkqiVdMP4iY4h13GLXZasic6I8hUxNS+8r h5tBrzXWfrWEOugeMEtDq9U7tP0bOecIcGaFE= Received: by 10.204.20.74 with SMTP id e10mr5456069bkb.148.1300213719406; Tue, 15 Mar 2011 11:28:39 -0700 (PDT) Received: from [10.150.51.214] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id k5sm64139bku.4.2011.03.15.11.28.36 (version=SSLv3 cipher=OTHER); Tue, 15 Mar 2011 11:28:37 -0700 (PDT) Subject: Re: ECN + pfifo_fast borked? (Was Re: [Bloat] shaper team forming up) From: Eric Dumazet To: Jonathan Morton Cc: Dave =?ISO-8859-1?Q?T=E4ht?= , David Miller , netdev In-Reply-To: <3D05C1F1-B75E-426B-8267-6DB5323A839D@gmail.com> References: <87wrk1a4gx.fsf@cruithne.co.teklibre.org> <5BC42741-852B-4699-BA5D-D70B8D610D96@gmail.com> <1300134277.2649.19.camel@edumazet-laptop> <1300164166.2649.70.camel@edumazet-laptop> <87ipvlosvz.fsf_-_@cruithne.co.teklibre.org> <1300169749.2649.142.camel@edumazet-laptop> <3D05C1F1-B75E-426B-8267-6DB5323A839D@gmail.com> Date: Tue, 15 Mar 2011 19:28:34 +0100 Message-ID: <1300213714.2927.37.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le mardi 15 mars 2011 à 19:09 +0200, Jonathan Morton a écrit : > On 15 Mar, 2011, at 8:15 am, Eric Dumazet wrote: > > > band 0 : high priority packets (like now) > > band 1 : (old band 1, ECN capable flows) > > band 2 : (old band 1, no ECN flows) > > band 3 : low priority packets (old band 2) > > This seems good to me. It would provide a concrete (if minor) enticement to turn ECN on. > > Here is a patch to implement that, on top of net-next-2.6 git tree qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 4 priomap 2 1 3 3 2 3 0 0 2 2 2 2 2 2 2 2 Sent 168 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index c84b659..95ddf54 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -412,19 +412,39 @@ static struct Qdisc noqueue_qdisc = { }; -static const u8 prio2band[TC_PRIO_MAX + 1] = { - 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 +/* 4-band FIFO queue: old style, but should be a bit faster than + generic prio+fifo combination. + */ + +enum { + BAND_HIGH_PRIO, + BAND_MEDIUM_ECN_PRIO, + BAND_MEDIUM_PRIO, + BAND_LOW_PRIO, + + PFIFO_FAST_BANDS }; -/* 3-band FIFO queue: old style, but should be a bit faster than - generic prio+fifo combination. +/* + * We give a litle incent to ECN flows */ +static const u8 prio2band[TC_PRIO_MAX + 1] = { + [TC_PRIO_BESTEFFORT] = BAND_MEDIUM_PRIO, + [TC_PRIO_FILLER] = BAND_MEDIUM_ECN_PRIO, + [TC_PRIO_BULK] = BAND_LOW_PRIO, + [TC_PRIO_BULK + 1] = BAND_LOW_PRIO, + [TC_PRIO_INTERACTIVE_BULK] = BAND_MEDIUM_PRIO, + [TC_PRIO_INTERACTIVE_BULK + 1] = BAND_LOW_PRIO, + [TC_PRIO_INTERACTIVE] = BAND_HIGH_PRIO, + [TC_PRIO_CONTROL] = BAND_HIGH_PRIO, + + [TC_PRIO_CONTROL+1 ... TC_PRIO_MAX] = BAND_MEDIUM_PRIO, +}; -#define PFIFO_FAST_BANDS 3 /* * Private data for a pfifo_fast scheduler containing: - * - queues for the three band + * - queues for the four bands * - bitmap indicating which of the bands contain skbs */ struct pfifo_fast_priv { @@ -436,9 +456,13 @@ struct pfifo_fast_priv { * Convert a bitmap to the first band number where an skb is queued, where: * bitmap=0 means there are no skbs on any band. * bitmap=1 means there is an skb on band 0. - * bitmap=7 means there are skbs on all 3 bands, etc. + * bitmap=2 means there is an skb on band 1. + * bitmap=15 means there are skbs on all 4 bands. */ -static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0}; +static const int bitmap2band[1 << PFIFO_FAST_BANDS] = { + -1, 0, 1, 0, 2, 0, 1, 0, + 3, 0, 1, 0, 2, 0, 1, 0 +}; static inline struct sk_buff_head *band2list(struct pfifo_fast_priv *priv, int band)