GithubHelp home page GithubHelp logo

Comments (4)

welink321 avatar welink321 commented on May 30, 2024

We also have another question: do all ports of our P4 switch share the same queue, or each port of our P4 switch have their own queue?

from p4-learning.

edgar-costa avatar edgar-costa commented on May 30, 2024

Hi @welink321,

What do you mean by physical space? If you want to get the occupancy of a queue you can check the following metadata fields:

    // flattening fields that exist in bmv2-ss
    // queueing metadata
    @alias("queueing_metadata.enq_timestamp")
    bit<32> enq_timestamp;
    @alias("queueing_metadata.enq_qdepth")
    bit<19> enq_qdepth;
    @alias("queueing_metadata.deq_timedelta")
    bit<32> deq_timedelta;
    /// queue depth at the packet dequeue time.
    @alias("queueing_metadata.deq_qdepth")
    bit<19> deq_qdepth;

You can find all the metadata fields for the bmv2 switch in the following include: https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4

Each port has a different queue. Also, there is a multiqueue mode in which 1 port can have N queues.

from p4-learning.

welink321 avatar welink321 commented on May 30, 2024

Oh, thank you very much for your answer. The physical space we refer to is the maximum size of switch queue. We know that there is information about the queue in the metadata, but the physical space size (queue size) of the queue we want to get is not in it. Because in a real switch, the queue size of the switch is determined by the hardware. We suspect that the simulation P4 environment has written a default value to the queue size set by the switch. So do you know how to get the default queue size of P4 switch in the simulated environment?

from p4-learning.

edgar-costa avatar edgar-costa commented on May 30, 2024

You can set the queue size https://github.com/nsg-ethz/p4-utils/blob/master/p4utils/utils/sswitch_API.py#L67 with this using the control plane API or using the CLI, then you will know the size. I think the default is 1000 (but I am not 100% sure right now).

from p4-learning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.