Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 2019 07:09:44 -0700
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: dummynet: bandwidth is limited to 2 Gbit/s ?
Message-ID:  <CA%2BhQ2%2BjXxwkVMMoLMMdXU5RVqsMxfbQfNazVKTp9rB9i6z%2BJ3A@mail.gmail.com>
In-Reply-To: <a1c0ac18-1290-a109-1c46-c8d6047cd8c1@FreeBSD.org>
References:  <a1c0ac18-1290-a109-1c46-c8d6047cd8c1@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 23, 2019 at 10:43 PM Andriy Gapon <avg@freebsd.org> wrote:
>
>
> It seems that the userland component of ipfw/dummynet uses int for the bandwidth
> represented in bit/s.  Also, int is used for passing that value from the
> userland to the kernel.
>
> What would be the best way to extend this?
> Just use a larger type?
> Or maybe add another field to try to preserve KBI backward compatibility?

As others have commented changing the ABI is a no-go.
However the command structure can be extended:
- define a new type, say DN_LINK64, and a new struct dn_link64 with a
64-bit bw field;
- modify the kernel to accept the new type in addition to DN_LINK to
set link speed,
  and reply with DN_LINK64 for links whose bandwidth cannot be
represented on 31 bits
  (these must come from a userland that understands the new format, so
it is reasonable
  to reply to queries with those)
- modify the ipfw libraries to, likewise, understand DN_LINK64 on
queries, and issue
  DN_LINK64 when bw requests do not fit on 31 bits (on failure).

An alternate, hack-ish approach would be to encode high speeds with
coarse granularity,
say speed 0x7fnnnnnn with n = 0.. 0xffffe representing speed in
Mbits/s (so that would give
you up to 16 Pbit/s) and reserve 0x7fffffff for the pre-existing
"2Gbit/s - 1" to avoid breaking
former userland that may pick that value.

cheers
luigi
that uses an extended field size for length.
One thing that could be done is _extend_ the ABI
>
> Thank you.
> --
> Andriy Gapon
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"



-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo@iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
 TEL      +39-050-2217533               . via Diotisalvi 2
 Mobile   +39-338-6809875               . 56122 PISA (Italy)
-----------------------------------------+-------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2BjXxwkVMMoLMMdXU5RVqsMxfbQfNazVKTp9rB9i6z%2BJ3A>