Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Patch for assigning multiple queues to the same interface

    Scheduled Pinned Locked Moved Routing and Multi WAN
    5 Posts 2 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      Waldemar
      last edited by

      I have a Multi-WAN setup and need to shape the traffic on the LAN interface through 3 different queues. pfSense is almost set to do it, but the get_queue_bandwidth() function is not prepared to get a list of queues as an argument. Once the following patch is applied (which is not perfect, but will be fine for most setups), once can do this. One can of course still only define one default queue, but the others can be defined through rules. This patch should fix "no parent queue" type errors in Multi-WAN setups. It basically just returns the sum of bandwidths when it receives several queues as an argument. Watch out though, it assumes that you have used the same bandwidth types for the queues in question. Otherwise things will probably not work.

      
      --- shaper.inc.dist     2008-01-27 16:31:51.000000000 +0100
      +++ shaper.inc  2008-01-27 16:33:47.000000000 +0100
      @@ -251,6 +251,17 @@
      
       function get_queue_bandwidth($name) {
              global $config;
      +        if (strpos($name, ' ') !== false) {
      +                $names = split(' ', $name);
      +                foreach ($names as $queue) {
      +                        $bw = get_queue_bandwidth($queue);                        
      +                        $bw_sum += $bw['bandwidth']; 
      +                }
      +                return  array(
      +                                'bandwidth' => $bw_sum,
      +                                'bandwidthtype' => $bw['bandwidthtype']
      +                );
      +        } 
              foreach ($config['shaper']['queue'] as $queue) {
                      if ($queue['name'] == $name) {
                              return array(
      
      
      1 Reply Last reply Reply Quote 0
      • W
        Waldemar
        last edited by

        Actually after reading of the major overhaul of the Traffic Shaping for 1.3, this probably is only relevant to 1.2.

        1 Reply Last reply Reply Quote 0
        • E
          eri--
          last edited by

          I still don't understand what this is useful for but anyway!

          1 Reply Last reply Reply Quote 0
          • W
            Waldemar
            last edited by

            If by "anyway" you mean it doesn't matter, then I suppose it doesn't. I don't want to steal anyone's show. I just came across errors when assigning several root queues to the same interface and that was because the get_queues_bandwidth function returned an empty string when it received several queues as an argument. That resulted in a faulty "altq on" rule. This patch seemed to me the simplest way of fixing it for the moment and I thought perhaps other people can benefit from it as well. This was the only reason for this post. Feel free to delete it.

            1 Reply Last reply Reply Quote 0
            • E
              eri--
              last edited by

              No, sorry, the anyway means its me not understanding it!

              Oh i see, yeah for some setups it is useful.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.