nsg-ethz/p4-learning

Queue length for priority queueing

axmaxati opened this issue · 2 comments

Hello,

I am somewhat new to P4 coding and for a personal project of mine, I would be interested to know how exactly one is supposed to set a particular queue length when enabling priority queues. I am aware that the current simple_switch version in the bmv2 git has those enabled by default, and it seems to me that you would want to set the length as anything other than 64 under there : https://github.com/p4lang/behavioral-model/blob/main/targets/simple_switch/simple_switch.cpp#L201
However, you specifically wrote that you could do it individually for each queue id and that you would explain if asked. So, provided you see this and are able to answer, I would like you to give me some advice.
Thank you for your help.

If things have not changed ( I did not check for a long time) the is API methods to change rate and length of all the queues for a given port.

If you want to do it per individual queue you need to modify a bit the API. Some years ago I made a pull request to bmv2 repo that shows how to do it. You could use that as a guideline. Keep in mind that this is an old pull request, not sure if the code has changed a lot, but it should help you to get what you want.

p4lang/behavioral-model#566

Thank you very much. I was able to find the way.