Sinding A-MPDU
Hi all,
I have some questions concerning the transmission of an A-MPDUs using ath9k:
* If we aggregate several MPDUs, say 10 MPDUs, into an A-MPDU and send them to receiver "R1". And during the transmission of this A-MPDU, a priority frame, say "Fp", comes from the upper layer and should be transmitted urgently to "R1". Let suppose that the 5th MPDU is being transmitted when the frame "Fp" comes. Is it possible to insert "Fp" into the A-MPDU in the 6th position and send it without waiting the transmission end of the current A-MPDU?
* What is the difference between the hardware transmission queue and the software transmission queue? Do I have the choice to use the software queue instead of the hardware queue, or is the software queue and intermediate queue and any frame will end in the hardware queue?
Best regard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20111128/0ab0f1ec/attachment.htm
Quoted 10 lines · daldoul yousri
Hi all,
I have some questions concerning the transmission of an A-MPDUs using ath9k:* If we aggregate several MPDUs, say 10 MPDUs, into an A-MPDU and send them to receiver "R1". And during the transmission of this A-MPDU, a priority frame, say "Fp", comes from the upper layer and should be transmitted urgently to "R1". Let suppose that the 5th MPDU is being transmitted when the frame "Fp" comes. Is it possible to insert "Fp" into the A-MPDU in the 6th position and send it without waiting the transmission end of the current A-MPDU?
The aggregate field has a "total length" field in the first frame, so I think you may confuse the hardware.
There's no guarantee that you'll be able to sneak in that frame before the hardware reads the next/last descriptor, so you may have it sometimes TX and sometimes not.
If RTS/CTS protection is being used then you've already announced how long the aggregate frame is, so you'd be breaking the spec by adding to it.
There's no guarantee that priority frame will be within the block-ack window (or that it should even be -in- an aggregate - eg, a null data frame) so you may not want to aggregate it anyway.
Quoted 5 lines
* What is the difference between the hardware transmission queue and the software transmission queue? Do I have the choice to use the software queue instead of the hardware queue, or is the software queue and intermediate queue and any frame will end in the hardware queue?
Best regard
The hardware queue is for frames that are actually pending to the hardware. Ie, the descriptors are setup in the relevant ring/chain (depending upon your chipset) and the hardware will eventually TX those.
The software queue is a staging ground for what is put into the hardware queue. It gives the aggregation logic time to figure out what/how to aggregate and allows for out of order transmission and software retransmit (however strictly speaking these latter two can be done without a software queue..)
There's also the CAB and multicast queues - the multicast queue is a software queue; a staging ground for what goes into the hardware CAB queue just before the beacon goes out.
Adrian
Thank you a lot for your answer.
I am aware about the A-MPDU size constraint. Data exceeding the?announced size will be considered as noise. This is not a problem!
I do not use RTS/CTS
I will disable the use of the Block ack. I do not need any feedback policy!
When I saw your example :
http://people.freebsd.org/~adrian/pcap4-ampdu-tx-dup.pcapI understood that the hardware does not wait the reception end of the entire A-MPDU to deliver the received MPDUs to the upper layer. Each MPDU is delivered once it is received (conclusion made based on the reception time in your example). That is why I am saying "may be" the same thing is done for the transmission: MPDUs are stored somewhere by the driver and delivered to the hardware at the transmission time. If this is the case, then may be I can deliver the priority frame instead of the 6th frame, and afterward I deliver the 6th to the 9th frames and I cancel the 10th frame since it will be considered as noise.
However I do not see where the driver asks the hardware to start
transmitting an A-MPDU. The function "ath_tx_send_ampdu()" calls "ath_tx_txqaddbuf()" which will never call "ath9k_hw_txstart()" since
"edma" is always "True". And I do not see any place else where the
driver may ask the hardware to start transmitting an A-MPDU. Do you have any idea about this?
Regards,
Quoted 10 lines
Hi all,
I have some questions concerning the transmission of an A-MPDUs using ath9k:* If we aggregate several MPDUs, say 10 MPDUs, into an A-MPDU and send them to receiver "R1". And during the transmission of this A-MPDU, a priority frame, say "Fp", comes from the upper layer and should be transmitted urgently to "R1". Let suppose that the 5th MPDU is being transmitted when the frame "Fp" comes. Is it possible to insert "Fp" into the A-MPDU in the 6th position and send it without waiting the transmission end of the current A-MPDU?
The aggregate field has a "total length" field in the first frame, so I think you may confuse the hardware.
There's no guarantee that you'll be able to sneak in that frame before the hardware reads the next/last descriptor, so you may have it sometimes TX and sometimes not.
If RTS/CTS protection is being used then you've already announced how long the aggregate frame is, so you'd be breaking the spec by adding to it.
There's no guarantee that priority frame will be within the block-ack window (or that it should even be -in- an aggregate - eg, a null data frame) so you may not want to aggregate it anyway.
Quoted 5 lines
* What is the difference between the hardware transmission queue and the software transmission queue? Do I have the choice to use the software queue instead of the hardware queue, or is the software queue and intermediate queue and any frame will end in the hardware queue?
Best regard
The hardware queue is for frames that are actually pending to the hardware. Ie, the descriptors are setup in the relevant ring/chain (depending upon your chipset) and the hardware will eventually TX those.
The software queue is a staging ground for what is put into the hardware queue. It gives the aggregation logic time to figure out what/how to aggregate and allows for out of order transmission and software retransmit (however strictly speaking these latter two can be done without a software queue..)
There's also the CAB and multicast queues - the multicast queue is a software queue; a staging ground for what goes into the hardware CAB queue just before the beacon goes out.
Adrian
On 28 November 2011 22:24, daldoul yousri <[email protected]> wrote:
.. hm. If edma is true, then you're using an AR9300 or later series NIC. I have no idea (yet) about how the EDMA stuff works for the AR9300 and later MAC/PCU.
Sorry. :)
MPDUs aren't delivered to the hardware at transmission time. They're delivered before the transmission time. Otherwise throughput is going to be quite a bit lower than maximum. The software aggregation queue code will queue upto N (=2?) aggregate frames to the hardware, to ensure the TX FIFO is kept busy and thus the MAC keeps transmitting frames.
At low frame rates, you'll be queuing frames just before transmission time because the hardware TX'es aggregate frames very quickly.
But the minute you start doing more than a few tens of frames a second (which you can calculate with some reasonably simple modelling), depending upon how busy your air is (ie, how often it can actually get the air and start TX'ing), you'll soon find you can queue frames faster than the hardware can squeeze them into the air. Doubly so if it's also doing RX.
Note: the RX timestamp in my traces (why are you looking there? those are for failures.. :) are done by the MAC, not the OS.
Again, your problem is going to be knowing if the hardware has begun transmitting the A-MPDU or not. You can't just assume that you can fondle with the TX frame chain at any stage - once it's passed to the hardware, I think the only way you can _reliably_ achieve what you're doing is:
* shut down TX DMA;
* wait for the TX DMA to complete (and hope it does, rather than get stuck);
* investigate whether your A-MPDU has been TX'ed or not.
* Fondle with the descriptor/ring buffer, again I don't know EDMA;
* restart TX DMA.
You can't just check "is the TX DMA (TXDP) pointer pointing at my entry or before it? (or the EDMA equivalent)" because by the time that check has run, the hardware may have begun TX'ing whilst your check is running.
To answer the rest of your question - you can find all the bits you need in ath9k/xmit.c to figure out exactly how/when an A-MPDU frame is created and queued to the hardware. Just keep in mind it queues >1 (up to a maximum of two) and then queues another the minute that it gets notification of the completion of the first A-MPDU. So hopefully the MAC/PCU is always TX'ing an A-MPDU ahead of what the software is queuing.
Good luck!
Adrian
[ath9k-devel] Stuck TX DMA
Quoted 1 line · Adrian Chadd
* wait for the TX DMA to complete (and hope it does, rather than get stuck);
Under what circumstances does DMA typically get stuck in your experience?
//Peter
[ath9k-devel] Stuck TX DMA
Quoted 5 lines · Peter Stuge
Quoted 1 line · Adrian Chadd
* wait for the TX DMA to complete (and hope it does, rather than get stuck);
Under what circumstances does DMA typically get stuck in your experience?
On FreeBSD? I only get that when doing channel scans. I haven't figured out why though (and it's not a big deal as FreeBSD doesn't do fast channel change, so a full reset is fine.)
I haven't seen it happen in normal everyday hostap mode or STA mode when not scanning.
I'll do some digging once I've finished off the FreeBSD atheros 11n changes. (Yes, I have 11n working in FreeBSD now..)
Adrian