From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 590F6311C35 for ; Fri, 24 Apr 2026 23:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777071975; cv=none; b=gSWxDhmeLOjKLi/qNkG6oDb+xME9Jp4zZotgt+wZp7OUEbtrhNNWinYCIfNGieTEDkemnvlHDXDhQ129C0ZthyNIbSAaueA0rdawLqiZ4OP+Y7mIYUWcuhsBpGY9L9bhGy6HazZxZyZMEP62uymBNFAhpkHjzNpnbf+DV1eMXTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777071975; c=relaxed/simple; bh=xmNYLGpNOpWPTvW0iyF7wwkU1PTu/CKwR6kdBPQytfI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EWB6uB4qC6QBRL4qEBloyAK5XQQ2bek06GYpwJGAeTHsRC3Kyac225SgIXMSslWHUtvpecHXsVoyM7ztw8C0KAheB9NvRxwB7Gtsm/hODeRqOBEIBxgkmv5IrahJLVpCpDEcK4cpMVZcGYK5Fc7Em2r0PcxHFOC7NZazRsWTXYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20251104.gappssmtp.com header.i=@networkplumber-org.20251104.gappssmtp.com header.b=lHxx8OID; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20251104.gappssmtp.com header.i=@networkplumber-org.20251104.gappssmtp.com header.b="lHxx8OID" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-466ec4c6846so2896266b6e.3 for ; Fri, 24 Apr 2026 16:06:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20251104.gappssmtp.com; s=20251104; t=1777071973; x=1777676773; darn=vger.kernel.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=y0P4/bNY3ogAryjqIy22wFzuj5GPxjxBtHlZnmt3BwQ=; b=lHxx8OIDcxZiAD88RcctBMxvNB2akOEVvxp8Nhe82au7ae44KjdgBjLMjGuew7CxAq ZFKohotSyw3Zqna+BC+y4jsR/tN6TU7DyCpqGrNuFA4tBa7oLZ9e6Ushw1oVMvdLM8wj dHdbRo3leXpI2hhCyHlVStaEyIw2allDnUM3nVQTk2a0Y7rI+4yWehj1oyl6E+6n3zUC 3CnyNEcXJCmiOLMXbe54rV2OzeDNTGy1voiUlTgd0xVy1nMuOth2gFMaFcW4v1ycbQxn 1Ypw14YetfMiCrAuk0GTgvTUUxeJIR2EfJwt1v9w889GXe6mOPDoP2pwsVdKhoSTFgz9 OwIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777071973; x=1777676773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=y0P4/bNY3ogAryjqIy22wFzuj5GPxjxBtHlZnmt3BwQ=; b=Hcigsd+Cjbr6/CH9vTOfGlzjpitMfs5tOdfr3aewjzbVt/bgCqz7y2l0qnEaoiT8L3 0/lF48vDv2vI+t817KEFgGebA1cEH8YRU+N/nvP4r8tP5G8gdAqFGUMg9O/V3vN/zVon ecDMg2RKv2CS4OdOLE+IYuJO93rDhJV7o14EVc6WFjtjxBPbyjzuS3YiNlfxXZa7W7/Y ikiQCM2xYPPGhU9slML8BLTR4QRgbopEmgh8yNSIk307OfBvgZbtPD8WX/N0Wc4e4bO6 BbMKI0t7Rdthqs8TvHbvAcavbfhVgHq9DCYtQuPtm6Q6VIeb7uilYNXqIHdd/5E042G3 OeDw== X-Forwarded-Encrypted: i=1; AFNElJ8gCHHwpj/Ul8xuP3oL3b6yMlS37A+Mlz4Hp8VEISXgBjralFw1xKLeukwcj/R3AdxWz2Ess4IMroX3hDo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/3Fd1S7Xttl9IsLMBFrQBHbVBsIJey6Tc9GB0OBs2whUtk2kI ICjimyxrawaXUr5uj9hguAI4rQ7r+BFEE5hLqP3EANn2aip4Vjftwq+oc+PlSgNUBxA= X-Gm-Gg: AeBDiev33j4YaA9POpoIeu0pKOzv/NYvwKcVmTAc9dpTGUv0DDDBwdTv8HWvKlsDsl6 T6Nn5aiszJDzjwkwPi5FFGydVmis4FoSpJNHeSao7Z8+Pyvkp0gHN52h6nbZ2z3CVEMYSpyyF1U 66n0JDM0pple5b5p8LHWQ0r/cegXoJwcEmovwEBXuVLBcBCup4H1btFvUJxeFN04gLRJGUOVlR5 HMHiggkkfTDBoj3VxVWa+1068DBV+VvEJMMZVsW+n2WuJcrt146xsSbxLhSdstvETHwLAkdTzdH M9PBfg0YbEqxaqKDP4oGeg5MLDANomeVpkSpgfJCuZwtXHTYEGeRHNQ6inwir0wkywrMzGVjT1r uSm9E3132sUJ3zGRfj+ddbxd5rxwS02AukfviIuKVCrM/Z0nKqRWNdNx69+0AMj8gX2jpvDEtsU Vy82UqXMY6NWFmHsmxgSo7I7Xqo5WH+pFgbJGS4yTaoWThUQ== X-Received: by 2002:a05:6808:e3cd:b0:47a:c2f:db2b with SMTP id 5614622812f47-47a0c301739mr5202111b6e.38.1777071973269; Fri, 24 Apr 2026 16:06:13 -0700 (PDT) Received: from phoenix.local ([104.202.41.210]) by smtp.gmail.com with ESMTPSA id 5614622812f47-479f6705d7asm7990554b6e.10.2026.04.24.16.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 16:06:13 -0700 (PDT) Date: Fri, 24 Apr 2026 16:06:09 -0700 From: Stephen Hemminger To: Jamal Hadi Salim Cc: Paolo Abeni , netdev@vger.kernel.org, jiri@resnulli.us, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Dave Taht , open list , Simon Horman Subject: Re: [PATCH net v8 4/6] net/sched: netem: validate slot configuration Message-ID: <20260424160609.45ff9a0a@phoenix.local> In-Reply-To: References: <20260418032027.900913-1-stephen@networkplumber.org> <20260418032027.900913-5-stephen@networkplumber.org> <20260421131039.GA651125@horms.kernel.org> <87f5e94e-d354-423d-9976-6cf3fb0710b1@redhat.com> <20260424080700.6846dfcb@phoenix.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 24 Apr 2026 16:17:13 -0400 Jamal Hadi Salim wrote: > () ncalls s >=20 >=20 > On Fri, Apr 24, 2026 at 11:07=E2=80=AFAM Stephen Hemminger > wrote: > > > > On Thu, 23 Apr 2026 17:12:15 -0400 > > Jamal Hadi Salim wrote: > > =20 > > > > > This is intended and explicitly explained in the cover letter. =20 > > > > Jamal, given the uAPI implication, could you please double check th= at > > > > the change is fine? > > > > =20 > > > > > > It should be fine; at least iproute2 will never allow the kernel to > > > receive a negative number. > > > Stephen brought up the fact that strtod() could return a -ve number > > > (but at least iproute2 makes sure negative numbers are not carried > > > forward to the kernel). > > > > > > cheers, > > > jamal =20 > > > > Iproute2 blocks negative values kind of by accident. > > The NEXT_IS_NUMBER() macro looks for digit at start of arg. > > To hit this you need to either use raw netlink or change NEXT_IS_NUMBER= () > > to NEXT_IS_SIGNED_NUMBER() where slot values are parsed. =20 >=20 > For this specific attribute it was intentional: > ... > if (get_time64(&slot.dist_jitter, *argv)) { //get_time64 calls > strtod() which could set dist_jitter -ve > explain1("slot jitter"); > return -1; > } > if (slot.dist_jitter <=3D 0) { // we reject -ve values > fprintf(stderr, "Non-positive jitter\n"); > return -1; > } >=20 > cheers, > jamal I see no cases where negative time value is a valid input. Doing audit of netem: - slot times parsing rejects -10ms for min delay and -100ms for max delay - delay negative value is accepted, but internally acts like 0 - jitter negative value is rejected (i.e What is "-2s") - slot distribution delay same as regular delay, accepted but internally acts like 0 negative jitter is rejected "Non positive jitter" Gate: Codel: - setting negative target, interval or ce_threshold gives huge value 4.29e+03s Pi: - setting negative target gets absolute value Hhf: - setting negative value gets 4.29e+03s So I can't see any valid use for negative intervals