From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27B9843EB4; Sat, 20 Apr 2024 00:45:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2299402A5; Sat, 20 Apr 2024 00:45:21 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 345DA402A3 for ; Sat, 20 Apr 2024 00:45:20 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1e51398cc4eso23189935ad.2 for ; Fri, 19 Apr 2024 15:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713566719; x=1714171519; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=OCqz1R/iXWbJvYaa+vrRuaFU8um+5j/DAo1aK1BY/e0=; b=tMk0j1J/Y3Ci/xa18y0qQQ+pRQ5F+XCSWoZXi5+YGqISuGWDP/cGakPvP54W8XnwIV e0ERH5rraYiZ7Pj/3Fhuf+VpgykSHLS+jirO9FwHbrl5eZii3Qm8+Q0agxMN3CesI9cS AyL0c6SS3Sl5o6lLsNT+xJGDa/y63JqbhsV9rhbLv/kypISjt8MRRSgOkLHBXxNS4fv7 n2qFiQ95h74LVJ4qd8V7nyNd8VzImtPQZb0PAZtPt6FtSD4BYXngA8JQo7ON+np5wdxv KMNI7KoyGdmLo+Ia9XMT9xHbHQbDlMZMWqnSOMoFdLmJhAsLHoASMrZGTjC7hmztwUMN FHTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713566719; x=1714171519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OCqz1R/iXWbJvYaa+vrRuaFU8um+5j/DAo1aK1BY/e0=; b=gLHQQ7ewWrV2g2tkplVlRSZzaV75mvbKqAAbWqbhcCr5Q8hio42CKmFqzQwLnCNjfj d7IwQN10RCk300c19i46+2rp0S1J5u+Hy9mcIv34XRf2Z45BnEvJibmYRsMWaWZlL+4j cVVeoyPDNouxsqtcjYe+nveMZ0SYdDkP1IawexQsitKguT06JlEkpXrWWRbaOt+xNp9n 5q6qBAzBLOPc8nm/ui0UyPcah7ts4vnRrVYU9e6Ysj3towf0Rz6SMYBU+DkXTJMubznY HB3wdzRGTk4MEh4Iu4hOEdCoCjaK2NHfn0Ri1840Zw6+2BGXszJEZB23Yr1EiM9eBnRq qRPg== X-Gm-Message-State: AOJu0YzixduSL8CoFBCG56fxD7LXywt+sYrpJU3HOw21gw6YI6l0pJxP RQNh6RRsz4wW/dgJ9TqGveMdaCWzwNFErX3db5SPfZSoJgI0bdOqk/Ea/lye5OI= X-Google-Smtp-Source: AGHT+IFH9QFTjb5QVZPBOMlM+3YRwwezEdFsesPRxqdIrQl2NnE4Tau1pqBW6KIedlK4AXilfiPdbg== X-Received: by 2002:a17:903:1110:b0:1e7:7832:b5b3 with SMTP id n16-20020a170903111000b001e77832b5b3mr4983773plh.41.1713566719292; Fri, 19 Apr 2024 15:45:19 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id kk14-20020a170903070e00b001e560db091asm3894743plb.72.2024.04.19.15.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 15:45:19 -0700 (PDT) Date: Fri, 19 Apr 2024 15:45:16 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: , "Tyler Retzlaff" , "Reshma Pattan" Subject: Re: [PATCH v4 3/6] latencystats: do not use floating point Message-ID: <20240419154516.6c934212@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F3CE@smartserver.smartshare.dk> References: <20240408195036.182545-1-stephen@networkplumber.org> <20240419172926.55447-1-stephen@networkplumber.org> <20240419172926.55447-4-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35E9F3CE@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 19 Apr 2024 20:49:56 +0200 Morten Br=C3=B8rup wrote: > > - /* > > - * The average latency is measured using exponential moving > > - * average, i.e. using EWMA > > - * https://en.wikipedia.org/wiki/Moving_average > > - */ > > - glob_stats->avg_latency +=3D > > - alpha * (latency - glob_stats->avg_latency); > > + glob_stats->avg_latency =3D latency; > > + glob_stats->jitter =3D latency / 2; =20 >=20 > Setting jitter at first sample as latency / 2 is wrong. > Jitter should remain zero at first sample. Chose that because it is what the TCP RFC does. RFC 6298 =09 (2.2) When the first RTT measurement R is made, the host MUST set SRTT <- R RTTVAR <- R/2 RTO <- SRTT + max (G, K*RTTVAR) The problem is that the smoothing constant in this code is quite small. Also, the TCP RFC has, not sure if matters. (2.3) When a subsequent RTT measurement R' is made, a host MUST set RTTVAR <- (1 - beta) * RTTVAR + beta * |SRTT - R'| SRTT <- (1 - alpha) * SRTT + alpha * R' The value of SRTT used in the update to RTTVAR is its value before updating SRTT itself using the second assignment. That is, updating RTTVAR and SRTT MUST be computed in the above order. The above SHOULD be computed using alpha=3D1/8 and beta=3D1/4 (as suggested in [JK88]). After the computation, a host MUST update RTO <- SRTT + max (G, K*RTTVAR)