# Priority queueing

**URL:** <https://forum.p4.org/t/priority-queueing/743>\
**Category:** Getting Started with P4\
**Created:** [April 16, 2023, 12:05pm UTC](https://forum.p4.org/t/priority-queueing/743 "2023-04-16T12:05:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuananh01](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@tuananh01](https://forum.p4.org/u/tuananh01)\
**Post date:** [April 16, 2023, 12:05pm UTC](https://forum.p4.org/t/priority-queueing/743/1 "2023-04-16T12:05:32Z")

</div>

Hello everyone,

I’m using the latest Development VM released in April and working on p4-learning repo.  
I’ve read the _[BMv2 Simple Switch](https://github.com/nsg-ethz/p4-learning/wiki/BMv2-Simple-Switch#using-strict-priority-queues)_ article and also looked into the [multiqueuing.p4](https://github.com/nsg-ethz/p4-learning/tree/master/examples/multiqueueing) example. They all said that if I want to use multiple priority queues, I have to uncomment the line:  
`#define SSWITCH_PRIORITY_QUEUEING_ON`

But when I go to the `simple_switch.h` file at the directory ` /home/vagrant/behavioral-model/targets/simple_switch`, I can’t find the above line, what I saw is in the following image:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/p4/original/1X/41cc3f80cfb260ed0461eced43fc93b20959f2a4.png)  
So my question is do I need to type the line `#define SSWITCH_PRIORITY_QUEUEING_ON` like you see in the image, then compile and install bmv2 again to use the feature?

Also when I scroll down, I see this:  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/p4/original/1X/21f85b639c0878ea7c370b853b749c354c83ac36.png)  
Am I supposed to changes the `default_nb_queues_per_port = 1` to another value? Does changing this value has the same effect as I use multiple priority queues?

So far I’ve added the line mentioned above and also compiled and installed bmv2 again but when I test the multiqueuing.p4 example, just only 1 flow can send to h3, the other flow has no information on the iperf server on h3. Do you have any solution?

Thanks!

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [April 17, 2023, 6:50pm UTC](https://forum.p4.org/t/priority-queueing/743/2 "2023-04-17T18:50:59Z")

</div>

As of about 2022-Apr some time, there was a change made to the behavioral-model code [1] such that by default there is 1 queue per output port, but you can change this by a command line option `--priority-queues 8` to change it to 8 queues per output port (replace the example 8 with any other number you prefer). It is not necessary to change the source code and recompile in order for this to work.

When you run `simple_switch_grpc --help` to see the command line options, it should appear in the output of that command. Note that `--priority-queues` is in a list of “target-specific” options, and somewhere on the command line before `--priority-queues 8` you must have `--` as an option by itself, to separate earlier not-target-specific options from later target-specific options.

[1] [simple\_switch: make the number of queues a command line option (#1101) · p4lang/behavioral-model@adff022 (github.com)](https://github.com/p4lang/behavioral-model/commit/adff022fc8679f5436d07e7af73c3300431df785)
