-
Notifications
You must be signed in to change notification settings - Fork 628
Queue disc #12
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
Closed
Closed
Queue disc #12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch adds a NetDeviceQueue class to store information about a single transmission queue of a network device. This class is meant to store the state of a transmission queue (i.e., whether the queue is stopped or not) and some data used by techniques such as Byte Queue Limits. Also, multi-queue aware queue discs can aggregate a child queue disc to an object of this class. These features (excluding BQL) are added in subsequent commits. The NetDevice class maintains a vector of NetDeviceQueue pointers, one for each transmission queue. A NetDevice constructor is added which creates a single transmission queue by default for every device. The number of transmission queues can be modified (by child classes) by calling NetDevice::SetTxQueuesN. Two public methods, GetTxQueue and GetTxQueuesN, are also added to the NetDevice class to return the i-th NetDeviceQueue and the number of transmission queues, respectively.
…the installed MAC For WifiNetDevices, the number of transmission queues is set when installing the MAC (in WifiNetDevice::SetMac), given that the number of queues is 4 if the MAC supports QoS and 1 otherwise.
Add public methods to the NetDeviceQueue class to start, stop or wake a transmission queue. These methods are primarily called by NetDevices, but can also be invoked by the network stack once techniques like BQL are implemented. An IsStopped method is also added to allow queue discs to check the current status of a transmission queue. A wake callback is provided, so that upper layers (queue discs) can be solicited to send packets down.
The (unique) transmission queue is stopped when enqueuing a packet fails, so that upper layers do not send other packets down. When a packet transmission is completed, if the queue is empty then wake the upper layers. If the queue was stopped, there is now room for another packet and hence wake the upper layers as well.
… a given packet This commit just adds a GetSelectedQueue method to the NetDevice class. This method is called by the Traffic Control layer before enqueuing a packet in the queue disc to determine in which transmission queue the device will enqueue the packet. Such information is exploited by multi-queue aware queue discs. By default, this function returns 0, so that single-queue devices do not need to be modified.
A QueueItem base class is introduced to represent the items stored in a Queue. The base class only contains a Ptr<Packet>. Derived classes can store additional information. DropTailQueue, RedQueue and CodelQueue, along with their examples and testsuits, have been adapted. Objects using such queues have been adapted too.
QueueDisc is a base class providing the interface and implementing the operations common to all the queueing disciplines. Child classes need to implement the methods used to enqueue a packet (DoEnqueue), dequeue a single packet (DoDequeue), get a copy of the next packet to extract (DoPeek), plus methods to classify enqueued packets in case they manage multiple queues internally.
...aggregated to the outgoing network device, if any. Otherwise, packets are sent directly to the device.
…m the queue disc
When a packet is passed to the Traffic Control layer, the IPv{4,6} header has not
been added yet. It will be added when the packet is dequeued from the queue disc.
Linux pfifo_fast is the default priority queue enabled on Linux systems. Packets are enqueued in three FIFO droptail queues according to three priority bands based on their Type of Service bits or DSCP bits.
Signed-off-by: Stefano Avallone <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry but I'm new to GitHub, and I wasn't able to comment the code in-line.
here are some comments:
There's no need to add a function for this (unless it's virtual, and we could discuss also about this). Anyway, it's never used, so you can remove it.
9b) Why the txq is stopped if it couldn't enqueue packets ?
General comment: Did I miss something or the only NetDevice taking advantage of the new TC is PointToPoint so far ?