From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 1A07C208AAE for ; Sun, 17 Jun 2012 19:58:50 -0700 (PDT) Received: by wgbds1 with SMTP id ds1so1168586wgb.4 for ; Sun, 17 Jun 2012 19:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=PaU50TuzsGk3x+UTTYV4PIm70jrLdrFUPA1J21R59ro=; b=tWGXnfmCurvWL87tU9m4tw/V+6pFOLDTqGcmUpZvIR+ROqDHbpNpaM1t+EggDyhQA8 JPM1Mv0MNbWjfJcF+fUXPhIRGxAI//pgJlnCSscG+LnmQ9V1s7ia5ZVwiPOA2y/PSiYF vGsl4iKLpaR87jdGnc2G25X3DB1rKVp0dUHolDqM/aPTwXoSwzq4dGTalMsfPk75h7yy NVd3QLcwudnWsz+UpKL61XpSKhV/15v1lX5OuFQv786IgKXdjSqLOgyOq8abIoqmlRCD LN3BSUl4ZY3Gyayy5oZFk5Fp+MMih4wuwj5M6xcNVOOrmbZPIUmTHZp2EtOSX59e1mqK 55rg== Received: by 10.216.198.23 with SMTP id u23mr7514521wen.195.1339988308695; Sun, 17 Jun 2012 19:58:28 -0700 (PDT) Received: from [192.168.1.37] (122.237.66.86.rev.sfr.net. [86.66.237.122]) by mx.google.com with ESMTPS id bn9sm22917294wib.5.2012.06.17.19.58.26 (version=SSLv3 cipher=OTHER); Sun, 17 Jun 2012 19:58:26 -0700 (PDT) From: Eric Dumazet To: Dave Taht In-Reply-To: References: <1339972217-19159-1-git-send-email-dave.taht@bufferbloat.net> <1339985869.7491.262.camel@edumazet-glaptop> Content-Type: text/plain; charset="UTF-8" Date: Mon, 18 Jun 2012 04:58:26 +0200 Message-ID: <1339988306.7491.306.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Cc: codel@lists.bufferbloat.net, Dave =?ISO-8859-1?Q?T=E4ht?= Subject: Re: [Codel] [RFC PATCH] Codel: Enable packet drop with ECN-marked packets on a threshold X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 02:58:51 -0000 On Sun, 2012-06-17 at 22:40 -0400, Dave Taht wrote: > On Sun, Jun 17, 2012 at 10:17 PM, Eric Dumazet wrote: > > if (A && B && C) > > > > Even if (C) is false, but A is true, B is evaluated. > > A is always true (or always false) > B in this case is usually false except on the kinds of ECN-heavy > workloads that exposed this issue > and C is probably higher overhead than A or B > > So a better conditional is possible... Not only better, but _correct_ ;) To have a chance to be correct, your patch should have been : if (params->ecn && vars->ldelay <= 2 * params->target && INET_ECN_set_ce(skb)) Because INET_ECN_set_ce(skb) is _doing_ ecn marking, and returns true is ECN was successfully applied to the packet.