Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority queuing in Simple Switch #42

Open
tuananh01 opened this issue Apr 16, 2023 · 4 comments
Open

Priority queuing in Simple Switch #42

tuananh01 opened this issue Apr 16, 2023 · 4 comments

Comments

@tuananh01
Copy link

Hello everyone,

I'm using the latest Development VM released in April.
I've read the BMv2 Simple Switch article and also looked into the multiqueuing.p4 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
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
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?

Thanks!

`

@jafingerhut
Copy link
Contributor

See my answer here: https://forum.p4.org/t/priority-queueing/743

If the p4-learning repo uses source code of the p4lang/behavioral-model repository after the enhancement was made, I would recommend updating the instructions in this repo, since changing the source code and recompiling is no longer necessary.

@edgar-costa
Copy link
Contributor

Hi @jafingerhut!

Thanks for the info. I will have a look at it and update it as soon as possible.

@WigginsLi
Copy link

WigginsLi commented Jun 17, 2023

How can i add the -- --priority-queues 8 in p4app.json or somewhere?


i simply modify the /<path to p4-utils>/p4utils/mininetlib/node.py as below and reinstall p4-utils. It works.
Is there a easy way to allow user to add custom options to simple_switch?

def add_arguments(self):
        """Adds arguments to the simple switch process"""
        args = [self.sw_bin]
        for port, intf in list(self.intfs.items()):
            if not intf.IP():
                args.extend(['-i', str(port) + '@' + intf.name])
        if self.pcap_dump:
            if self.pcap_dir:
                args.append('--pcap=' + self.pcap_dir)
            else:
                args.append('--pcap')
        if self.thrift_port:
            args.extend(['--thrift-port', str(self.thrift_port)])
        if self.nanomsg:
            args.extend(['--nanolog', self.nanomsg])
        args.extend(['--device-id', str(self.device_id)])
        if self.json_path:
            args.append(self.json_path)
        else:
            args.append('--no-p4')
        if self.enable_debugger:
            args.append('--debugger')
        if self.log_enabled:
            args.append('--log-console')
/*modify begin*/
        args.extend(['-- --priority-queue', str(8)])
/*end*/
        return args

@edgar-costa
Copy link
Contributor

Hi @WigginsLi,

I recently added the option.

This p4-learning example already uses it (just check the readme or the topology files):
https://github.com/nsg-ethz/p4-learning/tree/master/examples/multiqueueing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants