From owner-dev-commits-src-all@freebsd.org Wed May 19 15:04:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A30A64482B; Wed, 19 May 2021 15:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Flbk52kB3z3v5b; Wed, 19 May 2021 15:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AF915013; Wed, 19 May 2021 15:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14JF4DS2095443; Wed, 19 May 2021 15:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14JF4DTZ095442; Wed, 19 May 2021 15:04:13 GMT (envelope-from git) Date: Wed, 19 May 2021 15:04:13 GMT Message-Id: <202105191504.14JF4DTZ095442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 4a6830761c65 - main - Fix packet cbs/ebs conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a6830761c6552bfe2c118a73a5a461694cb84c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2021 15:04:13 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4a6830761c6552bfe2c118a73a5a461694cb84c7 commit 4a6830761c6552bfe2c118a73a5a461694cb84c7 Author: Alexander Motin AuthorDate: 2021-05-19 15:00:21 +0000 Commit: Alexander Motin CommitDate: 2021-05-19 15:04:08 +0000 Fix packet cbs/ebs conversion. Each packet is counted as 128 bytes by the code, not 125. Not sure what I was thinking about here 14 years ago. May be just a typo. Reported by: Dmitry Luhtionov MFC after: 2 weeks --- sys/netgraph/ng_car.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netgraph/ng_car.c b/sys/netgraph/ng_car.c index 9474e2467439..ec61a3565ec9 100644 --- a/sys/netgraph/ng_car.c +++ b/sys/netgraph/ng_car.c @@ -491,14 +491,14 @@ ng_car_rcvmsg(node_p node, item_p item, hook_p lasthook) if (bconf->downstream.opt & NG_CAR_COUNT_PACKETS) { bconf->downstream.cir *= 1024; bconf->downstream.pir *= 1024; - bconf->downstream.cbs *= 125; - bconf->downstream.ebs *= 125; + bconf->downstream.cbs *= 128; + bconf->downstream.ebs *= 128; } if (bconf->upstream.opt & NG_CAR_COUNT_PACKETS) { bconf->upstream.cir *= 1024; bconf->upstream.pir *= 1024; - bconf->upstream.cbs *= 125; - bconf->upstream.ebs *= 125; + bconf->upstream.cbs *= 128; + bconf->upstream.ebs *= 128; } if ((bconf->downstream.cir > 1000000000) || (bconf->downstream.pir > 1000000000) ||