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

Queue metadata with multiqueue #1258

Open
carlos-hfm opened this issue Jun 25, 2024 · 2 comments
Open

Queue metadata with multiqueue #1258

carlos-hfm opened this issue Jun 25, 2024 · 2 comments

Comments

@carlos-hfm
Copy link

Hi! I am working with 3 priority queues on simple_switch, and I am trying to collect InBand Network Telemetry data, about the occupation of these queues. But when I am generating traffic in only one queue (for example queue 0), the enq_qdepth and deq_qdepth values of all three queues are getting high, while the other queues (1 and 2) are supposed to be empty.

I am also checking deq_timedelta, and in this case only in queue 0 I am getting high values (it is the correct behavior I think).

Other thing that I noticed is that when I am generating traffic in 2 queues, the queue depth values are getting higher than 64 (I set the size with set_queue_depth command)

So I have a question: the enq_qdepth and deq_qdepth metadata are about the number of packets adding all the queues in total? Or something is wrong here?

@antoninbas
Copy link
Member

Yes, in the simple_switch implementation it seems that the qdepth is measured across all priority queues for a given port:

phv->get_field("queueing_metadata.enq_qdepth")
.set(egress_buffers.size(egress_port));

//! The occupancies of all the priority queues for this logical queue are
//! added.
size_t size(size_t queue_id) const {
LockType lock(mutex);
auto it = queues_info.find(queue_id);
if (it == queues_info.end()) return 0;
auto &q_info = it->second;
return q_info.size;
}
//! Get the occupancy of priority queue \p priority for logical queue with id
//! \p queue_id.
size_t size(size_t queue_id, size_t priority) const {
LockType lock(mutex);
auto it = queues_info.find(queue_id);
if (it == queues_info.end()) return 0;
auto &q_info = it->second;
auto &q_info_pri = q_info.at(priority);
return q_info_pri.size;
}

Notice how the first variant is called by simple_switch

@carlos-hfm
Copy link
Author

carlos-hfm commented Jul 1, 2024

Thank you @antoninbas. I changed the simple_switch.cpp code to use the second size method variant and recompiled bmv2. It seems that now I can get the depth of only specific priority queues using the enq_qdepth metadata.

But it is strange to me that the standard behavior implemented is to return the depth of all priority queues of the egress port together, instead of the specific queue that the packet is crossing.

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

2 participants