From owner-freebsd-net@freebsd.org Wed Sep 25 14:09:58 2019 Return-Path: Delivered-To: freebsd-net@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 7A8E81282BD for ; Wed, 25 Sep 2019 14:09:58 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dg1K3Fppz3wqv; Wed, 25 Sep 2019 14:09:57 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-io1-f65.google.com with SMTP id c25so14124854iot.12; Wed, 25 Sep 2019 07:09:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q811NGNFNQ0jhBRbZ4EH6j4fiOcwGvc0Bn/QClsWfN0=; b=pCVRlnh+Swld95B5UJzNOFDbQ/TScoXmKP9rG0ajaSvUjgVRbh4UNxtgR0sBjVur5k FRFwEBZ3e6RP6Si2qHjnwE7QJvnNH+kLDQvi3Zwfa+UE+3TYdFFQ9t4DuuxWCsa4ho3f ma/LdG2favG3yrqbdP/l/yvkFAYHZ3VrjXMmqtege0lVEVEQllThTHsjME0IT+kvt3lG 4rRLc4///Cf8BFwvg0EM3X0ZTF7mXiVLxVlrAcvXoMG7oBiXt+kGzk8A9V7VS8iykePH 0fbtuZk8V6ZILLGf9oNsZfps0JDjuSpiV1SPESlrKVIVMhKnfP2KH3GTrfIQM2nv/RCT 0BwA== X-Gm-Message-State: APjAAAUFZlqbW/2SXFf6w74J4AWcSnJWf0VG3GQLecRJUUaUvn3bCfTl p5eETJfSaQZineU6saZIQQJc77I8a24tn7nl86V14g== X-Google-Smtp-Source: APXvYqyOlNt1ya/CV1P4Krba28htc+1oyEmARCVX7mBAOjaS6yoUcBC6hpUEStv7HzseYdkBbpT3umcysiZ8doqY79E= X-Received: by 2002:a02:65cd:: with SMTP id u196mr5410154jab.3.1569420595874; Wed, 25 Sep 2019 07:09:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Luigi Rizzo Date: Wed, 25 Sep 2019 07:09:44 -0700 Message-ID: Subject: Re: dummynet: bandwidth is limited to 2 Gbit/s ? To: Andriy Gapon Cc: freebsd-net Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dg1K3Fppz3wqv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rizzounipi@gmail.com designates 209.85.166.65 as permitted sender) smtp.mailfrom=rizzounipi@gmail.com X-Spamd-Result: default: False [-2.18 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[unipi.it]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.18)[ip: (-0.35), ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.18), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[65.166.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FORGED_SENDER(0.30)[rizzo@iet.unipi.it,rizzounipi@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[65.166.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rizzo@iet.unipi.it,rizzounipi@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2019 14:09:58 -0000 On Mon, Sep 23, 2019 at 10:43 PM Andriy Gapon 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) -----------------------------------------+-------------------------------