jafingerhut / p4-guide

Guide to p4lang repositories and some other public info about P4
530 stars 155 forks source link

Bmv2 queue size modification #28

Closed shahzad46 closed 4 years ago

shahzad46 commented 4 years ago

Hello there, I am working on the ECN problem from the tutorials page (reference). I would like to change the queue size of the switch. I tried changing it through the accompanied topology.json (modified the run_exercise.py accordingly). I can see the queue size to be changed using tc -s class show dev eth on the switch terminal but it seems like that is over ridden by the bmv2 and it uses it's default queue size (64 packets) everytime. My question: how can I change the bmv2 queue size (hardcoded/programmatic)?

jafingerhut commented 4 years ago

I have never tried modifying the queue sizes in bmv2, but this issue on the behavioral-model repo might help: https://github.com/p4lang/behavioral-model/issues/311

shahzad46 commented 4 years ago

Thanks for the quick reply. I am checking your referred thread.

rosstex commented 4 years ago

Were you able to solve this?

shahzad46 commented 4 years ago

Yes. As suggested by @jafingerhut , you should check out the behavioral-model repo. @antoninbas has provided the detail on how to change the queue size. I used the switch CLI to modify the queue depth. Here is how I did it (if you are using one of the P4 tutorials as base).

  1. start up your mininet environment.
  2. Open another terminal.
  3. Enter command simple_switch_CLI --thrift-port <switch-thrift-port>
  4. After that simply input set_queue_depth <size> <port>
jafingerhut commented 4 years ago

@shahzad46 If you are willing to help document this command in a place that others can find more easily, creating a PR for the p4lang/behavioral-model repository on this file: https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md

would be helpful.

Is the command perhaps set_queue_depth, not switch_queue_depth? I saw the former in the output of the help command in simple_switch_CLI, but did not see switch_queue_depth.

shahzad46 commented 4 years ago

@shahzad46 If you are willing to help document this command in a place that others can find more easily, creating a PR for the p4lang/behavioral-model repository on this file: https://github.com/p4lang/behavioral-model/blob/master/docs/runtime_CLI.md

would be helpful.

Is the command perhaps set_queue_depth, not switch_queue_depth? I saw the former in the output of the help command in simple_switch_CLI, but did not see switch_queue_depth.

My bad, it was a typo. Corrected it now. Sure I would like to help. Will follow up on your suggestion.