dummynet: bandwidth is limited to 2 Gbit/s ?

Luigi Rizzo rizzo at iet.unipi.it
Wed Sep 25 14:09:58 UTC 2019


On Mon, Sep 23, 2019 at 10:43 PM Andriy Gapon <avg at 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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo at 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)
-----------------------------------------+-------------------------------


More information about the freebsd-net mailing list