Skip to contentSkip to conversation

TX status reporting with help of an ack queue

RFC PATCH Ivo van Doorn 7 participants 35 messages Sep 15, 2008 – Oct 19, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1221494693.14102.22.camel@virkkmi-linux

#1 lore raw
Quoted 10 lines · On Monday 15 September 2008, Mikko Virkkil=C3=A4 wrote:

Modeled after the waiting-for-ack queue in the zd1211rw driver, this patch adds a similar queue to the rt2x00. If the tx state of a packet is unknown and a tx ack or tx fail is needed, then the packet is pushed to a waiting-for-ack queue. Each time an ack is received the queue is checked and a possible match is reported to mac80211 as a tx ack.
=20
If the queue gets filled up the oldest waiting packet will be discarded and a tx fail will be reported.

I believe it was mentioned it earlier as well, but this code belongs to mac80211 rather than being copied in all individual drivers.

I think the best solution would be:
- Drivers set *unknown TX status* flag for mac80211
- Mac80211 sets the FIF_CONTROL flag for the RX filter (or adds a new more specific flag FIF_ACK for hardware that allows this specific fi=
ltering (rt2800))
- Driver will set a *unknown TX status* flag per send out frame
- Mac80211 keeps track of ACK responses, and decides what to do when no ACK has been received for the frame.

Note that rt61 might be tricky since that does support TX status report= ing,
but it fails in only 1% of the cases to do this, which means enabling t= his for rt61
would be far too much overhead.

Quoted 2 lines

This doesn't use timers so a message might in theory be stuck in the queue indefinitely.

Well you wouldn't need timers actually, if you have a list of packets waiting to be acked you can expect the frames to be acked in the order of which they were send (when using the same queue).

drivers/net/wi=

Quoted 1 line
drivers/net/wi= renamed from drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0

reless/rt2x00/rt2x00dev.c

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_beacondone(struct rt2x00_dev *rt2=

Quoted 4 lines

index 2f3bfc6..57020de 100644

drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
@@ -495,6 +495,30 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2=

x00dev)

drivers/net/wireless/rt2x00/rt2x00dev.c

Quoted 8 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);

=20

drivers/net/wireless/rt2x00/rt2x00dev.c +5 -0
+static struct sk_buff *rt2x00lib_get_match_from_ack_queue(
+	struct sk_buff_head *q, struct ieee80211_hdr *rx_hdr)
+{
+	struct sk_buff *skb;
+	for (skb =3D q->next; skb !=3D (struct sk_buff *)q; skb =3D skb->ne=

xt) {

drivers/net/wireless/rt2x00/rt2x00dev.c

Quoted 3 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +3 -0
+		struct ieee80211_hdr *tx_hdr;
+		tx_hdr =3D (struct ieee80211_hdr *)skb->data;
+		if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) {

Why is this likely() do we really expect the first ack in the list to b= e the rigth one?
And is this enough to match a frame to an ack?

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00d=

Quoted 25 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +16 -1
@@ -560,7 +584,22 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 	 * status report back.
 	 */
 	if (tx_info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)
-		ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb);
+		if (test_bit(TXDONE_UNKNOWN, &txdesc->flags)) {
+			struct sk_buff *failed_skb;
+			failed_skb =3D rt2x00lib_push_to_ack_queue(
+				&rt2x00dev->ack_wait_queue, entry->skb);
+			if (failed_skb) {
+				struct ieee80211_tx_info *info;
+				info =3D IEEE80211_SKB_CB(failed_skb);
+				info->status.excessive_retries =3D 1;
+				rt2x00dev->link.qual.tx_failed++;
+				rt2x00dev->low_level_stats.dot11RTSFailureCount++;
+				DEBUG(rt2x00dev, "ACK queue: fail oldest\n");
+				ieee80211_tx_status_irqsafe(rt2x00dev->hw,
+					failed_skb);
+			}
+		} else
+			ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb);
 	else
 		dev_kfree_skb_irq(entry->skb);

=20

drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
@@ -694,7 +733,26 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00d=

ev,

Quoted 4 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -1
 	 * mac80211 will clean up the skb structure.
 	 */
 	rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_RXDONE, entry->skb);
-	ieee80211_rx_irqsafe(rt2x00dev->hw, entry->skb, rx_status);

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00d= · line 745

Quoted 10 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +10 -0
+
+	if (ieee80211_is_ack(hdr->frame_control)) {
+		struct sk_buff *match =3D NULL;
+		match =3D rt2x00lib_get_match_from_ack_queue(
+			&rt2x00dev->ack_wait_queue,	hdr);
+		if (match) {
+			struct ieee80211_tx_info *tx_info;
+			tx_info =3D IEEE80211_SKB_CB(match);
+			tx_info->flags |=3D IEEE80211_TX_STAT_ACK;
+			rt2x00dev->low_level_stats.dot11RTSSuccessCount++;

Incorrect, you need to check if this was an RTS frame if you want to in= crement this counter.

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00d= · line 755

Quoted 10 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +10 -0
+			rt2x00dev->link.qual.tx_success++;
+			DEBUG(rt2x00dev, "ACK hit in queue\n")
+			ieee80211_tx_status_irqsafe(rt2x00dev->hw, match);
+		} else {
+			DEBUG(rt2x00dev, "Got ACK but not in queue\n")
+		}
+		/* Unmap done at start of func, so just free */
+		dev_kfree_skb_irq(entry->skb);
+    } else
+		ieee80211_rx_irqsafe(rt2x00dev->hw, entry->skb, rx_status);

This breaks when mac80211 requested FIF_CONTROL, you are now always filtering out ACK frames no matter what mac80211 requested.

drivers/net/wireless/rt2x00/rt2x00dev.c static int rt2x00lib_initialize(struct rt2x00_d=

Quoted 3 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
 	/*
 	 * Replace the skb with the freshly allocated one.
@@ -974,6 +1032,11 @@ static int rt2x00lib_initialize(struct rt2x00_d=

ev *rt2x00dev)

Quoted 14 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
 		return status;

=20

drivers/net/wireless/rt2x00/rt2x00dev.c +5 -0
 	/*
+	 * Initialize queue for messages waiting for acks
+	 */
+	skb_queue_head_init(&rt2x00dev->ack_wait_queue);
+
+	/*
 	 * Initialize the device.
 	 */
 	status =3D rt2x00dev->ops->lib->initialize(rt2x00dev);
@@ -1107,6 +1170,14 @@ exit:
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_probe_dev);
Quoted 2 lines

=20
+static void rt2x00lib_free_ack_wait_queue(struct rt2x00_dev *rt2x00d=

ev)

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_remove_dev(struct rt2x00_dev *r=

Quoted 11 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +7 -0
+{
+	struct sk_buff_head *ack_wait_queue =3D &rt2x00dev->ack_wait_queue;
+	struct sk_buff *skb;
+	while ((skb =3D skb_dequeue(ack_wait_queue)))
+		dev_kfree_skb_any(skb);
+}
+
 void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 {
 	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
@@ -1142,6 +1213,11 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *r=

t2x00dev)

drivers/net/wireless/rt2x00/rt2x00dev.c void rt2x00lib_remove_dev(struct rt2x00_dev *r= · line 1220

Quoted 8 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +5 -0
 	 * Free queue structures.
 	 */
 	rt2x00queue_free(rt2x00dev);
+
+	/*
+	 * Free ack wait queue
+	 */
+	rt2x00lib_free_ack_wait_queue(rt2x00dev);
	skb_queue_purge(&rt2x00dev->ack_wait_queue) ?

drivers/net/wire=

Quoted 4 lines
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -0
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev);

=20

drivers/net/wire= renamed from drivers/net/wireless/rt2x00/rt73usb.c +0 -0

less/rt2x00/rt73usb.c

drivers/net/wireless/rt2x00/rt73usb.c static void rt73usb_config_filter(struct rt2x00_d=

Quoted 4 lines

index 27dde3e..e082d30 100644

drivers/net/wireless/rt2x00/rt73usb.c +0 -0
@@ -593,8 +593,7 @@ static void rt73usb_config_filter(struct rt2x00_d=

ev *rt2x00dev,

drivers/net/wireless/rt2x00/rt73usb.c static void rt73usb_config_filter(struct rt2x00_d=

Quoted 10 lines
drivers/net/wireless/rt2x00/rt73usb.c +1 -2
 			   !(filter_flags & FIF_FCSFAIL));
 	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_PHYSICAL,
 			   !(filter_flags & FIF_PLCPFAIL));
-	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL,
-			   !(filter_flags & FIF_CONTROL));
+	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL, 0);
 	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME,
 			   !(filter_flags & FIF_PROMISC_IN_BSS));
 	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS,
@@ -604,8 +603,7 @@ static void rt73usb_config_filter(struct rt2x00_d=

ev *rt2x00dev,

Quoted 9 lines
drivers/net/wireless/rt2x00/rt73usb.c +1 -2
 	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_MULTICAST,
 			   !(filter_flags & FIF_ALLMULTI));
 	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_BROADCAST, 0);
-	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_ACK_CTS,
-			   !(filter_flags & FIF_CONTROL));
+	rt2x00_set_field32(&reg, TXRX_CSR0_DROP_ACK_CTS, 0);
 	rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
 }

=20

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

[ I've added Johannes to the CC, I hope he can provide us with some mor= e
informed comments regarding mac80211 architecture ]

Quoted 11 lines · Ivo van Doorn
Quoted 10 lines · On Monday 15 September 2008, Mikko Virkkil=E4 wrote:

Modeled after the waiting-for-ack queue in the zd1211rw driver, this patch adds a similar queue to the rt2x00. If the tx state of a packet is unknown and a tx ack or tx fail is needed, then the packet is pushed to a waiting-for-ack queue. Each time an ack is received the queue is checked and a possible match is reported to mac80211 as a tx ack.
=20
If the queue gets filled up the oldest waiting packet will be discarded and a tx fail will be reported.

Quoted 7 lines

=20
I believe it was mentioned it earlier as well, but this code belongs to mac80211 rather than being copied in all individual drivers. =20
I think the best solution would be:
- Drivers set *unknown TX status* flag for mac80211
- Mac80211 sets the FIF_CONTROL flag for the RX filter (or adds a ne=

w

Quoted 1 line

more specific flag FIF_ACK for hardware that allows this specific =

filtering (rt2800))

Quoted 3 lines

- Driver will set a *unknown TX status* flag per send out frame
- Mac80211 keeps track of ACK responses, and decides what to do when no ACK has been received for the frame.

I've also spent some time thinking about this. IMHO, he difficult part is to come up with an interface between mac80211 and the driver which i= s
convenient to use for driver writers and integrates well with mac80211. The following ideas came to my mind:

1. Add another callback to struct ieee80211_ops that would be used for TX frame housekeeping. The standard implementation would just pass the frame on the regular tx handler, but we could provide an alternate implementation that keeps track of the packets we are expecting ACKs fo= r
before handing the packet to the hardware. Similarly, the RX path would provide new functions in addition to the existing ieee80211_rx[_irqsafe= ]
handlers that would do the matching ACK matching and pass the packet on to ieee80211_rx() afterwards.

2. Make the ACK queue approach generic and wrap it in some library functions that become part of mac80211 and are called from the driver's tx and rx handlers, respectively. This has the advantage that it is les= s
invasive than 1. It is essentially what Ivo has described above. Driver writers would be free to use this framework, but are not required to do so.

3. Make mac80211 unconditionally keep track about the packets it has passed down to the driver and do TX status matching on all ACKs that ar= e
received in the mac80211 rx path. (Note that this has the tendency of duplicating the ring buffers that most drivers probably already have fo= r
their TX queues. Maybe introduce a generic ring buffer framework and allow the drivers to store private data in data and that?) The advantag= e
of this approach is that mac80211 has information about all packets tha= t
are still in processing (don't know if that actually helps) and it's more convenient for driver writers.

Quoted 2 lines

=20
Note that rt61 might be tricky since that does support TX status repo=

rting,

Quoted 1 line

but it fails in only 1% of the cases to do this, which means enabling=

this for rt61

Quoted 1 line

would be far too much overhead.

I'd opt for the overhead. We have seen that the hardware/firmware doesn't behave as expected, so I'd rather see a clean approach in software.

Quoted 6 lines

=20

Quoted 2 lines

This doesn't use timers so a message might in theory be stuck in the queue indefinitely.

=20
Well you wouldn't need timers actually, if you have a list of packets waiting to be acked you can expect the frames to be acked in the orde=

r

Quoted 1 line

of which they were send (when using the same queue).

Agreed.

Mattias

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 2 lines · Mattias Nissler

[ I've added Johannes to the CC, I hope he can provide us with some more informed comments regarding mac80211 architecture ]

I'd actually written half a reply but then decided to give up on it for now, what do you want to know?

we currently use status reporting for three things:
* hostapd needs to know whether some frames were acked
* the rate control algorithms use it
* we only report sent frames on monitor interfaces when we get a status report and incorporate information from the status report

Quoted 5 lines

I've also spent some time thinking about this. IMHO, he difficult part is to come up with an interface between mac80211 and the driver which is convenient to use for driver writers and integrates well with mac80211. The following ideas came to my mind:

Quoted 8 lines

1. Add another callback to struct ieee80211_ops that would be used for TX frame housekeeping. The standard implementation would just pass the frame on the regular tx handler, but we could provide an alternate implementation that keeps track of the packets we are expecting ACKs for before handing the packet to the hardware. Similarly, the RX path would provide new functions in addition to the existing ieee80211_rx[_irqsafe] handlers that would do the matching ACK matching and pass the packet on to ieee80211_rx() afterwards.

That seems way too much overhead, but we definitely want to use the IEEE80211_TX_CTL_REQ_TX_STATUS less in the future (we currently always set it). I suppose by "expect ACKs for" you mean "expect status information for"?

Quoted 6 lines

2. Make the ACK queue approach generic and wrap it in some library functions that become part of mac80211 and are called from the driver's tx and rx handlers, respectively. This has the advantage that it is less invasive than 1. It is essentially what Ivo has described above. Driver writers would be free to use this framework, but are not required to do so.

I think this is what we want.

Quoted 9 lines

3. Make mac80211 unconditionally keep track about the packets it has passed down to the driver and do TX status matching on all ACKs that are received in the mac80211 rx path. (Note that this has the tendency of duplicating the ring buffers that most drivers probably already have for their TX queues. Maybe introduce a generic ring buffer framework and allow the drivers to store private data in data and that?) The advantage of this approach is that mac80211 has information about all packets that are still in processing (don't know if that actually helps) and it's more convenient for driver writers.

I think this punishes hardware that can provide all information needlessly imho. Also, with drivers that do provide the information we don't need to process control packets at all which is good (if not necessary) for drivers on slow busses.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

This doesn't use timers so a message might in theory be stuck in the queue indefinitely.

Well you wouldn't need timers actually, if you have a list of packets waiting to be acked you can expect the frames to be acked in the order of which they were send (when using the same queue).

Yes, hence you have to keep track of things per queue.

johannes

#4 lore raw
Quoted 8 lines · Johannes Berg
Quoted 6 lines

2. Make the ACK queue approach generic and wrap it in some library functions that become part of mac80211 and are called from the driver's tx and rx handlers, respectively. This has the advantage that it is less invasive than 1. It is essentially what Ivo has described above. Driver writers would be free to use this framework, but are not required to do so.

I think this is what we want.

Ok. If we take this path I think we do not need to add more flags to mac80211 and the drivers that enable special processing w.r.t. the device packet filters (as suggested by Ivo previously). Instead, the driver itself should take whatever action is necessary to tell the hardware to deliver ACK frames. Johannes, could you recap for me whether the driver should report these additional ACKs to mac80211 or keep quiet if they weren't requested?

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

This doesn't use timers so a message might in theory be stuck in the queue indefinitely.

Well you wouldn't need timers actually, if you have a list of packets waiting to be acked you can expect the frames to be acked in the order of which they were send (when using the same queue).

Yes, hence you have to keep track of things per queue.

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

Mikko: I could hack this up, but since your initial patch is not far from what's been discussed, I rather wait for a comment on whether you want to do it.

Mattias

#5 lore raw
Quoted 5 lines · Mattias Nissler

Ok. If we take this path I think we do not need to add more flags to mac80211 and the drivers that enable special processing w.r.t. the device packet filters (as suggested by Ivo previously). Instead, the driver itself should take whatever action is necessary to tell the hardware to deliver ACK frames.

Yes, but we could also make the ack queue processing part of mac80211, i.e. we stick the packet on the queue before ->tx() and add a few new flags to the status callback which can then process the queue.

Quoted 3 lines

Johannes, could you recap for me
whether the driver should report these additional ACKs to mac80211 or keep quiet if they weren't requested?

This is largely theoretical right now as mac80211 is _always_ requesting status reports via IEEE80211_TX_CTL_REQ_TX_STATUS. This is something I can't talk much about, you helped designed the rate control algorithm and I think you're in a much better position to evaluate how this should work with respect to rate control.

Then again, I think I'm misunderstanding you, are you thinking whether it should hand those frames to mac80211? It doesn't matter to mac80211, to be honest.

Quoted 5 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

can we stop talking about "ACK queue"? It really is a "unknown status queue" or something like that.

johannes

#6 lore raw
Quoted 11 lines · Johannes Berg
Quoted 5 lines · Mattias Nissler

Ok. If we take this path I think we do not need to add more flags to mac80211 and the drivers that enable special processing w.r.t. the device packet filters (as suggested by Ivo previously). Instead, the driver itself should take whatever action is necessary to tell the hardware to deliver ACK frames.

Yes, but we could also make the ack queue processing part of mac80211, i.e. we stick the packet on the queue before ->tx() and add a few new flags to the status callback which can then process the queue.

Just to get this straight: By queue you mean the to-be-introduced unknown status queue?

Of course you can do it that way, but then you'll have all the flags and data structures built into mac80211 unconditionally instead of letting the driver developer decide.

Quoted 11 lines
Quoted 4 lines

Johannes, could you recap for me
whether the driver should report these additional ACKs to mac80211 or keep quiet if they weren't requested?

This is largely theoretical right now as mac80211 is _always_ requesting status reports via IEEE80211_TX_CTL_REQ_TX_STATUS. This is something I can't talk much about, you helped designed the rate control algorithm and I think you're in a much better position to evaluate how this should work with respect to rate control.

Quoted 3 lines

Then again, I think I'm misunderstanding you, are you thinking whether it should hand those frames to mac80211? It doesn't matter to mac80211, to be honest.

Ok, that's what I meant.

Quoted 9 lines
Quoted 6 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

can we stop talking about "ACK queue"? It really is a "unknown status queue" or something like that.

Ok, I don't really care how it's called as long as the one writing that stuff chooses an appropriate name in the code :-)

Mattias

#7 lore raw
Quoted 6 lines · Mattias Nissler
Quoted 3 lines

Yes, but we could also make the ack queue processing part of mac80211, i.e. we stick the packet on the queue before ->tx() and add a few new flags to the status callback which can then process the queue.

Just to get this straight: By queue you mean the to-be-introduced unknown status queue?

Yes.

Quoted 3 lines

Of course you can do it that way, but then you'll have all the flags and data structures built into mac80211 unconditionally instead of letting the driver developer decide.

Oh, I'm fine with building them in there as long as the code paths aren't actually used for drivers that don't need them. This isn't a big thing.

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

can we stop talking about "ACK queue"? It really is a "unknown status queue" or something like that.

Ok, I don't really care how it's called as long as the one writing that stuff chooses an appropriate name in the code :-)

:)
But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

johannes

#8 lore raw
Quoted 11 lines · Johannes Berg
Quoted 6 lines · Mattias Nissler
Quoted 3 lines

Yes, but we could also make the ack queue processing part of mac80211, i.e. we stick the packet on the queue before ->tx() and add a few new flags to the status callback which can then process the queue.

Just to get this straight: By queue you mean the to-be-introduced unknown status queue?

Yes.

Quoted 7 lines
Quoted 3 lines

Of course you can do it that way, but then you'll have all the flags and data structures built into mac80211 unconditionally instead of letting the driver developer decide.

Oh, I'm fine with building them in there as long as the code paths aren't actually used for drivers that don't need them. This isn't a big thing.

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 6 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

can we stop talking about "ACK queue"? It really is a "unknown status queue" or something like that.

Quoted 6 lines
Quoted 2 lines

Ok, I don't really care how it's called as long as the one writing that stuff chooses an appropriate name in the code :-)

:)
But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Retries in the hw? I don't understand? You mean that as a name?

Mattias

#9 lore raw
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

Quoted 4 lines
Quoted 2 lines

But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Retries in the hw? I don't understand? You mean that as a name?

Well, with all this we won't know how many times the hardware attempted to send a frame before it got an ACK, if it got one at all. We'd like to know this too, I guess, for the rate control algorithm.

johannes

#10 lore raw
Quoted 11 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Retries in the hw? I don't understand? You mean that as a name?

Well, with all this we won't know how many times the hardware attempted to send a frame before it got an ACK, if it got one at all. We'd like to know this too, I guess, for the rate control algorithm.

That's right, the rate control algorithm might want to know. However, the PID algorithm doesn't care too much about the number of retries, it just classifies frames into the categories: successfull, single retry, multiple retries (IIRC, that is).

Btw. lately I've been thinking about a new RC algo that simply calculates the throughput achievable by a specific rate (based on the estimated frame transmission failure ratio and transmission times) and then selects the one that provides the best throughput. It's still a very vague idea, but I think it might be interesting to try.

Mattias

#11 lore raw
Quoted 5 lines · Mattias Nissler

Btw. lately I've been thinking about a new RC algo that simply calculates the throughput achievable by a specific rate (based on the estimated frame transmission failure ratio and transmission times) and then selects the one that provides the best throughput. It's still a very vague idea, but I think it might be interesting to try.

This sounds like a reasonable approach. Isn't this more-or-less what Minstrel does?

John

Signature · 2 lines
John W. Linville		Linux should be at the core
[email protected]			of your literate lifestyle.
#12 lore raw
Quoted 10 lines · John W. Linville
Quoted 5 lines · Mattias Nissler

Btw. lately I've been thinking about a new RC algo that simply calculates the throughput achievable by a specific rate (based on the estimated frame transmission failure ratio and transmission times) and then selects the one that provides the best throughput. It's still a very vague idea, but I think it might be interesting to try.

This sounds like a reasonable approach. Isn't this more-or-less what Minstrel does?

I just checked Minstrel out. Seems quite like what I had in mind :-) Are there any efforts to port minstrel to mac80211?

Mattias

#13 lore raw
Quoted 9 lines · Mattias Nissler
Quoted 8 lines · John W. Linville
Quoted 5 lines · Mattias Nissler

Btw. lately I've been thinking about a new RC algo that simply calculates the throughput achievable by a specific rate (based on the estimated frame transmission failure ratio and transmission times) and then selects the one that provides the best throughput. It's still a very vague idea, but I think it might be interesting to try.

Quoted 5 lines
Quoted 2 lines

This sounds like a reasonable approach. Isn't this more-or-less what Minstrel does?

I just checked Minstrel out. Seems quite like what I had in mind :-) Are there any efforts to port minstrel to mac80211?

nbd has been promising for ages, but has not had time so far. The full minstrel will also require API changes between drivers/mac80211/RC.

johannes

#14 lore raw
In reply to Johannes Berg
Quoted 9 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

I think the ACK handling could become quite complex, and although it would be nice to modularize it a bit, however I am not really sure about what the best approach would be for the implementation other then that the driver should do as little as possible. ;)

Perhaps Mikko or the zd1211rw developers will have better ideas on this subject. :)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Retries in the hw? I don't understand? You mean that as a name?

Well, with all this we won't know how many times the hardware attempted to send a frame before it got an ACK, if it got one at all. We'd like to know this too, I guess, for the rate control algorithm.

Well this information would definately get lost with this ACK handling, but at least we get *some* information about the TX status. ;)

Ivo

#15 lore raw
Quoted 8 lines · Ivo van Doorn
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Quoted 7 lines
Quoted 2 lines

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

I think the ACK handling could become quite complex, and although it would be nice to modularize it a bit, however I am not really sure about what the best approach would be for the implementation other then that the driver should do as little as possible. ;)

Huh? I think a single function call for the matching in the rx path is enough. You call it in the rx handler for every received frame. It returns true if it found a match and reported the tx status (in which case you stop processing) or false and you can go on doing with the frame whatever you want. Am I missing something?

Quoted 6 lines

Perhaps Mikko or the zd1211rw developers will have better ideas on this subject. :)

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Retries in the hw? I don't understand? You mean that as a name?

Well, with all this we won't know how many times the hardware attempted to send a frame before it got an ACK, if it got one at all. We'd like to know this too, I guess, for the rate control algorithm.

Well this information would definately get lost with this ACK handling, but at least we get *some* information about the TX status. ;)

The (not) failed decision is definitely enough to get the PID algo doing something useful.

Mattias

#16 lore raw
Quoted 17 lines · Mattias Nissler
Quoted 8 lines · Ivo van Doorn
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Quoted 7 lines
Quoted 2 lines

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

I think the ACK handling could become quite complex, and although it would be nice to modularize it a bit, however I am not really sure about what the best approach would be for the implementation other then that the driver should do as little as possible. ;)

Quoted 5 lines

Huh? I think a single function call for the matching in the rx path is enough. You call it in the rx handler for every received frame. It returns true if it found a match and reported the tx status (in which case you stop processing) or false and you can go on doing with the frame whatever you want. Am I missing something?

Although this isn't much overhead for a driver, but if it comes down to a single function call anyway, why not handle it in mac80211 completely?

Ivo

#17 lore raw
Quoted 18 lines · Ivo van Doorn
Quoted 17 lines · Mattias Nissler
Quoted 15 lines · Ivo van Doorn
Quoted 9 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

I think the ACK handling could become quite complex, and although it would be nice to modularize it a bit, however I am not really sure about what the best approach would be for the implementation other then that the driver should do as little as possible. ;)

Quoted 8 lines
Quoted 5 lines

Huh? I think a single function call for the matching in the rx path is enough. You call it in the rx handler for every received frame. It returns true if it found a match and reported the tx status (in which case you stop processing) or false and you can go on doing with the frame whatever you want. Am I missing something?

Although this isn't much overhead for a driver, but if it comes down to a single function call anyway, why not handle it in mac80211 completely?

Simply because most drivers don't need it and it adds another item to mac80211's bag of complex stuff to understand ;-)

Mattias

#18 lore raw
In reply to Johannes Berg
Quoted 14 lines · Johannes Berg
Quoted 4 lines · Mattias Nissler

Well, I'm a big fan of modularizing everything in a clean way. This whole mac80211 thingy is complex enough... But I don't really care as long as everybody here is happy with it. Let's wait what Mikko says, it's his code so far.

Sure. If you manage to split it out entirely, maybe by some struct that drivers embed in their private vif struct, that'd be great too.

Quoted 3 lines
Quoted 2 lines

But ACK is getting confusing, we're just reporting status based on reception (or non-reception!) of ACKs :) How about retries in the hw?

Quoted 7 lines
Quoted 1 line

Retries in the hw? I don't understand? You mean that as a name?

Well, with all this we won't know how many times the hardware attempted to send a frame before it got an ACK, if it got one at all. We'd like to know this too, I guess, for the rate control algorithm.

johannes

My suggestion would be something along the lines of awaiting_status_queue because the packets are waiting for status info about their transmission.

To get the AP mode working (my main interest) hostapd needs to know that the other party has received the packet so that it can advance in its state machine without losing sync.

The rate control algorithms on the other hand are probably interested in getting a lot more details. Currently drivers seem to keep internal statistics in addition to the external ones. Maybe some way of exporting additional statistics is needed and tackling that should perhaps not be tied to the status reporting? Rate control algorithms will probably also want to modify re-transmission intervals, contention time settings etc. Is there already some unified way of doing this?

Mikko

#19 lore raw
In reply to Mattias Nissler
Quoted 9 lines · Mattias Nissler
Quoted 8 lines · Johannes Berg
Quoted 6 lines

2. Make the ACK queue approach generic and wrap it in some library functions that become part of mac80211 and are called from the driver's tx and rx handlers, respectively. This has the advantage that it is less invasive than 1. It is essentially what Ivo has described above. Driver writers would be free to use this framework, but are not required to do so.

I think this is what we want.

I also like this approach. It gives us the flexibility to add driver specific code to the driver while keeping the mac80211 part clean even if some driver needs additional packet handling hacks.

Quoted 23 lines

Ok. If we take this path I think we do not need to add more flags to mac80211 and the drivers that enable special processing w.r.t. the device packet filters (as suggested by Ivo previously). Instead, the driver itself should take whatever action is necessary to tell the hardware to deliver ACK frames. Johannes, could you recap for me whether the driver should report these additional ACKs to mac80211 or keep quiet if they weren't requested?

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

This doesn't use timers so a message might in theory be stuck in the queue indefinitely.

Well you wouldn't need timers actually, if you have a list of packets waiting to be acked you can expect the frames to be acked in the order of which they were send (when using the same queue).

Yes, hence you have to keep track of things per queue.

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

Quoted 6 lines

Mikko: I could hack this up, but since your initial patch is not far from what's been discussed, I rather wait for a comment on whether you want to do it.

Mattias

Feel free to hack up a patch. The functions rt2x00lib_get_match_from_ack_queue and rt2x00lib_push_to_ack_queue are already generic handlers for the queue.

Quoted 1 line

From the messages on this list it seems people want to also add the part

of sending the packet to the mac80211 layer to these two functions. This is certainly possible but it needs to be done in such a way that the driver can keep its internal statistics up to date. Since I'm not at all familiar with what information a driver might want to extract, I opted to leave the packet forwarding out of the generic functions.

Mikko

#20 lore raw
Quoted 10 lines
Quoted 10 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

Mikko: I could hack this up, but since your initial patch is not far from what's been discussed, I rather wait for a comment on whether you want to do it.

Quoted 6 lines
Quoted 2 lines

Mattias

Feel free to hack up a patch. The functions rt2x00lib_get_match_from_ack_queue and rt2x00lib_push_to_ack_queue are already generic handlers for the queue.

Mattias, please note my comments on Mikko's patch if you are going to copy them. :)

Ivo

#21 lore raw
Quoted 10 lines · Ivo van Doorn
Quoted 10 lines
Quoted 10 lines

Good point :-) So I suggest we have one function that adds new packets to the ACK queue (which is represented by a struct an instance of which a driver can keep in its queue information) and another one that matches a received ACK with the queue, reports the status to mac80211 and purges the queue entries up to the match (reporting them as failed).

Mikko: I could hack this up, but since your initial patch is not far from what's been discussed, I rather wait for a comment on whether you want to do it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Mattias

Feel free to hack up a patch. The functions rt2x00lib_get_match_from_ack_queue and rt2x00lib_push_to_ack_queue are already generic handlers for the queue.

Mattias, please note my comments on Mikko's patch if you are going to copy them. :)

Ok, I'm picking this thingy up. I've got some time tomorrow, but I'll be away for the weekend, so expect something at the beginning of next week.

Mattias

#22 lore raw

ACK matching [was: TX status reporting with help of an ack queue]

[I've added the zd1211rw maintainers to the CC, I hope they can shed some light on the question whether the ack queue mechanism that driver has is actually correct]

I've had a closer look at the idea of deciding whether a frame has been transmitted succesfully by monitoring incoming ACK frames and I've hit a fundamental problem: How do you correlate incoming ACK frames to the frames that were actually transmitted? The ACK frame only carries the address of the station that transmitted the frame being acked, no further information. Now this means if you have the hardware TX two frames and receive one ACK frame in the RX path, you cannot know which TX frame the ACK belongs to, because they will be identical, right?

The hardware, however, knows, because the ACKs are required to be transmitted directly after the corresponding frame is received, but we don't know in the driver about this timing information, at least not for rt2x00.

I wonder whether the ack queue idea Mikko found in the zd1211rw driver is actually working correctly for that driver? I've only had a short look, but found that incoming ACKs are only matched against transmitted frames by means of the address carried within the ACK. So I'd think in the situation I outlined above, the zd1211rw driver will also be unable to match the ACK to the correct frame. Any comments on this?

Mattiass

#23 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 20 lines · Mattias Nissler

[I've added the zd1211rw maintainers to the CC, I hope they can shed some light on the question whether the ack queue mechanism that driver has is actually correct]

I've had a closer look at the idea of deciding whether a frame has been
transmitted succesfully by monitoring incoming ACK frames and I've hit a
fundamental problem: How do you correlate incoming ACK frames to the frames that were actually transmitted? The ACK frame only carries the address of the station that transmitted the frame being acked, no further information. Now this means if you have the hardware TX two frames and receive one ACK frame in the RX path, you cannot know which TX frame the ACK belongs to, because they will be identical, right?

The hardware, however, knows, because the ACKs are required to be transmitted directly after the corresponding frame is received, but we don't know in the driver about this timing information, at least not for rt2x00.

Quoted 9 lines

I wonder whether the ack queue idea Mikko found in the zd1211rw driver is actually working correctly for that driver? I've only had a short look, but found that incoming ACKs are only matched against transmitted frames by means of the address carried within the ACK. So I'd think in the situation I outlined above, the zd1211rw driver will also be unable to match the ACK to the correct frame. Any comments on this?

Mattiass

AFAIK your analysis is correct and I think this is somewhat of a known problem with the implementation in zd1211rw driver. I haven't come across a way of getting around the problem. I read some suggestions about stopping all transmission to a certain address until we get a status update for the previous packet sent to that address, but iirc this was deemed impractical. On the other hand the current implementation in zd1211rw (and hopefully soon in rt2x00) doesn't really break anything that works without it and on rt2x00 it gets AP-mode in a somewhat more usable state.

- Mikko

#24 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 2 lines · On Fri, 2008-09-19 at 12:08 +0300, Mikko Virkkil=E4 wrote:
Quoted 1 line · Mattias Nissler

[I've added the zd1211rw maintainers to the CC, I hope they can she=

d

Quoted 1 line
Quoted 1 line

some light on the question whether the ack queue mechanism that dri=

ver

Quoted 5 lines
Quoted 5 lines

has is actually correct]
=20
I've had a closer look at the idea of deciding whether a frame has been
transmitted succesfully by monitoring incoming ACK frames and I've =

hit

Quoted 2 lines
Quoted 2 lines

a
fundamental problem: How do you correlate incoming ACK frames to th=

e

Quoted 1 line
Quoted 1 line

frames that were actually transmitted? The ACK frame only carries t=

he

Quoted 3 lines
Quoted 3 lines

address of the station that transmitted the frame being acked, no further information. Now this means if you have the hardware TX two frames and receive one ACK frame in the RX path, you cannot know wh=

ich

Quoted 4 lines
Quoted 4 lines

TX frame the ACK belongs to, because they will be identical, right? =20
The hardware, however, knows, because the ACKs are required to be transmitted directly after the corresponding frame is received, but=

we

Quoted 1 line
Quoted 1 line

don't know in the driver about this timing information, at least no=

t for

Quoted 3 lines
Quoted 3 lines

rt2x00.
=20
I wonder whether the ack queue idea Mikko found in the zd1211rw dri=

ver

Quoted 1 line
Quoted 1 line

is actually working correctly for that driver? I've only had a shor=

t

Quoted 1 line
Quoted 1 line

look, but found that incoming ACKs are only matched against transmi=

tted

Quoted 1 line
Quoted 1 line

frames by means of the address carried within the ACK. So I'd think=

in

Quoted 1 line
Quoted 1 line

the situation I outlined above, the zd1211rw driver will also be un=

able

Quoted 6 lines
Quoted 4 lines

to match the ACK to the correct frame. Any comments on this? =20
Mattiass
=20

=20
AFAIK your analysis is correct and I think this is somewhat of a know=

n

Quoted 6 lines

problem with the implementation in zd1211rw driver. I haven't come across a way of getting around the problem. I read some suggestions about stopping all transmission to a certain address until we get a status update for the previous packet sent to that address, but iirc this was deemed impractical. On the other hand the current implementation in zd1211rw (and hopefully soon in rt2x00) doesn't rea=

lly

Quoted 1 line

break anything that works without it and on rt2x00 it gets AP-mode in=

a

Quoted 1 line

somewhat more usable state.=20

Well, as long as nothing vitally depends on the transmissions status (i.e. MAC layer acknowledgements in 802.11 lingo), you are right that i= t
won't break anything. Nevertheless, it is code that is known to be working incorrectly and non-fixable, so I'd vote against it (I'd rather live with the approach of always reporting successful tx status as you have proposed earlier if I had to choose from the two of them). Maybe w= e
just have to accept that there is hardware that cannot report MAC layer acknowledgements back to the driver. Unless somebody comes up with a feasible idea how to do it. Ivo, do we have a contact at Ralink to ask about this?

This brings up the question whether we can do without tx status reporting. Does anyone know why hostapd requires the tx status? As far as I understand, mac80211 only uses the tx status reporting only for th= e
tx rate control. Rate control algos that don't use tx status are definitely feasible (and in fact we'll need one for rt73).

I'll look into hostapd to figure out whether the tx status reporting is really required when I find some time. However, I've just received rt2800 hardware, so getting the rt2800 driver going is my top priority for the next weeks.

Mattias

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#25 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 5 lines · Mattias Nissler

This brings up the question whether we can do without tx status reporting. Does anyone know why hostapd requires the tx status? As far as I understand, mac80211 only uses the tx status reporting only for the tx rate control. Rate control algos that don't use tx status are definitely feasible (and in fact we'll need one for rt73).

mac80211 also uses it for reporting the sent frame to userspace on monitor interfaces.

Quoted 2 lines

I'll look into hostapd to figure out whether the tx status reporting is really required when I find some time.

hostapd requires this because it needs to know whether a station acknowledged a frame or not to proceed its state machine, it's just how it has to work. If the hardware can't deal with that I guess you can't implement AP mode properly.

johannes

#26 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 10 lines · Johannes Berg
Quoted 5 lines · Mattias Nissler

This brings up the question whether we can do without tx status reporting. Does anyone know why hostapd requires the tx status? As far as I understand, mac80211 only uses the tx status reporting only for the tx rate control. Rate control algos that don't use tx status are definitely feasible (and in fact we'll need one for rt73).

mac80211 also uses it for reporting the sent frame to userspace on monitor interfaces.

Yeah, that's what hostapd relies on. But mac80211 really does not care to much how userspace uses the information.

Quoted 8 lines
Quoted 3 lines

I'll look into hostapd to figure out whether the tx status reporting is really required when I find some time.

hostapd requires this because it needs to know whether a station acknowledged a frame or not to proceed its state machine, it's just how it has to work. If the hardware can't deal with that I guess you can't implement AP mode properly.

Well, maybe we can work around this requirement? I still need to learn about the details, but what happens for example if the STA sends the ACK and then resets due to a crash? I guess the AP is able to cope with that, no? So maybe we can relax the rules a bit (unless we become really incompliant with the standard of course).

Mattias

#27 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 5 lines · Mattias Nissler

Well, maybe we can work around this requirement? I still need to learn about the details, but what happens for example if the STA sends the ACK and then resets due to a crash? I guess the AP is able to cope with that, no? So maybe we can relax the rules a bit (unless we become really incompliant with the standard of course).

I don't really see how to. We can't just assume the station got the frame properly and advance our state machine. The case you're citing is quite different, we'll advance the state machine but it won't work because the STA crashed; if we advance but the station simply hasn't gotten the frame we'll get out of sync and stuff will fail for no real reason.

But you can do workarounds all you want in hostapd, I don't care. However, I do think that if the hardware just isn't up to the job you should probably buy new hardware, after all, it's dirt cheap. :)

johannes

#28 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 8 lines · Johannes Berg
Quoted 5 lines · Mattias Nissler

Well, maybe we can work around this requirement? I still need to learn about the details, but what happens for example if the STA sends the ACK and then resets due to a crash? I guess the AP is able to cope with that, no? So maybe we can relax the rules a bit (unless we become really incompliant with the standard of course).

Quoted 6 lines

I don't really see how to. We can't just assume the station got the frame properly and advance our state machine. The case you're citing is quite different, we'll advance the state machine but it won't work because the STA crashed; if we advance but the station simply hasn't gotten the frame we'll get out of sync and stuff will fail for no real reason.

Well, I understand that we need synchronization of the state machines, maybe we can advance optimistically and detect in the next state that the STA didn't receive the last message? Just some random thoughts, I see it'll at least be tricky, I just wanted your opinion on whether you see a chance :-) As I said, I'll look into it when I find some time.

Quoted 2 lines

But you can do workarounds all you want in hostapd, I don't care.

:-)

Quoted 2 lines

However, I do think that if the hardware just isn't up to the job you should probably buy new hardware, after all, it's dirt cheap. :)

I totally agree with you. I'm just curious to see whether there is a chance to help our users. I'm perfectly fine if it turns out there is no chance to do it properly, and I'll rather accept that fact instead of trying to introduce workarounds that are known to be incorrect. The sad thing is that if we controlled the firmware, we could probably arrange to have the necessary information passed to the driver.

Mattias

#29 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 5 lines · Mattias Nissler

Well, I understand that we need synchronization of the state machines, maybe we can advance optimistically and detect in the next state that the STA didn't receive the last message? Just some random thoughts, I see it'll at least be tricky, I just wanted your opinion on whether you see a chance :-) As I said, I'll look into it when I find some time.

To be honest, I'm not familiar enough with it to be able to answer that question. I know it's currently needed and I vaguely remember seeing and discussing that it's pretty important (and the stuff I already wrote), but that's about it.

Quoted 9 lines
Quoted 2 lines

However, I do think that if the hardware just isn't up to the job you should probably buy new hardware, after all, it's dirt cheap. :)

I totally agree with you. I'm just curious to see whether there is a chance to help our users. I'm perfectly fine if it turns out there is no chance to do it properly, and I'll rather accept that fact instead of trying to introduce workarounds that are known to be incorrect. The sad thing is that if we controlled the firmware, we could probably arrange to have the necessary information passed to the driver.

Indeed; at least for those cards where there is firmware. But I guess you always only get as much out of the hardware as the vendor wants you to, rt61pci for example doesn't report frame timestamps so it's fairly useless for monitoring.

johannes

#30 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

In reply to Mattias Nissler
Quoted 16 lines · Mattias Nissler
Quoted 8 lines · Johannes Berg
Quoted 5 lines · Mattias Nissler

Well, maybe we can work around this requirement? I still need to learn about the details, but what happens for example if the STA sends the ACK and then resets due to a crash? I guess the AP is able to cope with that, no? So maybe we can relax the rules a bit (unless we become really incompliant with the standard of course).

Quoted 6 lines

I don't really see how to. We can't just assume the station got the frame properly and advance our state machine. The case you're citing is quite different, we'll advance the state machine but it won't work because the STA crashed; if we advance but the station simply hasn't gotten the frame we'll get out of sync and stuff will fail for no real reason.

Quoted 6 lines

Well, I understand that we need synchronization of the state machines, maybe we can advance optimistically and detect in the next state that the STA didn't receive the last message? Just some random thoughts, I see it'll at least be tricky, I just wanted your opinion on whether you see a chance :-) As I said, I'll look into it when I find some time.

Just as a side note: it's the mac80211 stack which converts a missing TX_ACK flag to be a IEEE80211_RADIOTAP_F_TX_FAIL flag. The hostapd sees that TX_FAIL and assumes TX failed.

Quoted 8 lines
Quoted 2 lines

But you can do workarounds all you want in hostapd, I don't care.

:-)

Quoted 2 lines

However, I do think that if the hardware just isn't up to the job you should probably buy new hardware, after all, it's dirt cheap. :)

Quoted 9 lines

I totally agree with you. I'm just curious to see whether there is a chance to help our users. I'm perfectly fine if it turns out there is no chance to do it properly, and I'll rather accept that fact instead of trying to introduce workarounds that are known to be incorrect. The sad thing is that if we controlled the firmware, we could probably arrange to have the necessary information passed to the driver.

Mattias

I'd really love for some workaround that would allow AP mode to work.

It would be great if it could be deemed that the protocol doesn't really require CTS protection/status information, and can be made reliable and standards compliant without support for it from the driver. Unfortunately I don't have high hopes for that, but I wonder what's Mr. Malinen's opinion?

- Mikko

#31 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 3 lines · Mikko Virkkil=E4 wrote:
Quoted 2 lines · Mattias Nissler
Quoted 1 line · Johannes Berg

But you can do workarounds all you want in hostapd, I don't care.

But I do care.. ;-) As such, I would change that to "you can do workarounds in your copy of hostapd". And yes, this would likely be the best location for the workaround.

Quoted 1 line
Quoted 1 line
Quoted 1 line

However, I do think that if the hardware just isn't up to the job y=

ou

Quoted 1 line
Quoted 1 line
Quoted 1 line

should probably buy new hardware, after all, it's dirt cheap. :)

I have never seen wlan design that does not report frame ACK status properly for transmitted unicast frames. Is it absolutely clear that that is indeed the case here or could we should be missing some documentation explaining how this should be done?

Quoted 1 line

I'd really love for some workaround that would allow AP mode to work.=

=20

The workaround would be to make hostapd generate bogus TX callback internally with claim for a successfully received ACK when sending (re)association response. I'm not very keen on including such functionality and certainly do not consider dropping the correct behavior because of a broken hw design.

If someone can come up with a clean patch that allows this to be configured in hostapd.conf without affecting the default behavior, I could consider applying the changes. However, please keep in mind that I'm interested in using TX status reporting to improve reliability of connection setup, so its use is more likely to increase in the future.

Quoted 1 line

It would be great if it could be deemed that the protocol doesn't rea=

lly

Quoted 1 line

require CTS protection/status information, and can be made reliable a=

nd

Quoted 2 lines

standards compliant without support for it from the driver. Unfortunately I don't have high hopes for that, but I wonder what's M=

r.

Quoted 1 line

Malinen's opinion?

IEEE 802.11 association state in the AP is changed when receiving an AC= K
from the STA for a (re)association response frame with success status (see IEEE Std 802.11-2007, 11.3.2.2). In order to be able to implement this correctly, AP mode operation require the TX status callback to provide information for the ACK status of (re)association response frames.

I would also like to see this status used to speed up recovery from=20 dropped EAPOL frames during IEEE 802.1X EAP authentication, 4-way handshake and group handshake. In certain environments, this could improve stability of connection establishment greatly.

- Jouni

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#32 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 7 lines · Jouni Malinen
Quoted 3 lines · Mikko Virkkil=C3=A4 wrote:
Quoted 2 lines · Mattias Nissler
Quoted 1 line · Johannes Berg

But you can do workarounds all you want in hostapd, I don't care.

=20
But I do care.. ;-) As such, I would change that to "you can do workarounds in your copy of hostapd". And yes, this would likely be t=

he

Quoted 3 lines

best location for the workaround.
=20

Quoted 1 line
Quoted 1 line
Quoted 1 line

However, I do think that if the hardware just isn't up to the job=

you

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

should probably buy new hardware, after all, it's dirt cheap. :)

=20
I have never seen wlan design that does not report frame ACK status properly for transmitted unicast frames. Is it absolutely clear that that is indeed the case here or could we should be missing some documentation explaining how this should be done?
=20

Quoted 1 line

I'd really love for some workaround that would allow AP mode to wor=

k.=20

Quoted 10 lines

=20
The workaround would be to make hostapd generate bogus TX callback internally with claim for a successfully received ACK when sending (re)association response. I'm not very keen on including such functionality and certainly do not consider dropping the correct behavior because of a broken hw design.
=20
If someone can come up with a clean patch that allows this to be configured in hostapd.conf without affecting the default behavior, I could consider applying the changes. However, please keep in mind tha=

t

Quoted 2 lines

I'm interested in using TX status reporting to improve reliability of connection setup, so its use is more likely to increase in the future=

=2E

Quoted 2 lines

=20

Quoted 1 line

It would be great if it could be deemed that the protocol doesn't r=

eally

Quoted 1 line
Quoted 1 line

require CTS protection/status information, and can be made reliable=

and

Quoted 2 lines
Quoted 2 lines

standards compliant without support for it from the driver. Unfortunately I don't have high hopes for that, but I wonder what's=

Mr.

Quoted 3 lines
Quoted 1 line

Malinen's opinion?

=20
IEEE 802.11 association state in the AP is changed when receiving an =

ACK

Quoted 2 lines

from the STA for a (re)association response frame with success status (see IEEE Std 802.11-2007, 11.3.2.2). In order to be able to implemen=

t

Quoted 10 lines

this correctly, AP mode operation require the TX status callback to provide information for the ACK status of (re)association response frames.
=20
I would also like to see this status used to speed up recovery from=20 dropped EAPOL frames during IEEE 802.1X EAP authentication, 4-way handshake and group handshake. In certain environments, this could improve stability of connection establishment greatly.
=20
- Jouni

Well, sounds like there are good reasons to keep investigating the possibility of fixing this a bit more properly in the driver.=20

If we turn off the AUTO_TX_SEQ and/or TXD_W1_HW_SEQUENCE (what'as the difference?) and assigning sequence numbers manually, could we then match the ack-frame's sequence number to the ones we have sent?

- Mikko

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#33 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

Quoted 5 lines · On Tue, 2008-09-23 at 09:09 +0300, Mikko Virkkil=E4 wrote:
Quoted 4 lines · Jouni Malinen
Quoted 3 lines · Mikko Virkkil=E4 wrote:
Quoted 2 lines · Mattias Nissler
Quoted 1 line · Johannes Berg

But you can do workarounds all you want in hostapd, I don't car=

e.

Quoted 3 lines
Quoted 3 lines

=20
But I do care.. ;-) As such, I would change that to "you can do workarounds in your copy of hostapd". And yes, this would likely be=

the

Quoted 3 lines
Quoted 3 lines

best location for the workaround.
=20

Quoted 1 line
Quoted 1 line
Quoted 1 line

However, I do think that if the hardware just isn't up to the j=

ob you

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

should probably buy new hardware, after all, it's dirt cheap. :=

)

Quoted 3 lines
Quoted 3 lines

=20
I have never seen wlan design that does not report frame ACK status properly for transmitted unicast frames. Is it absolutely clear tha=

t

Quoted 4 lines
Quoted 4 lines

that is indeed the case here or could we should be missing some documentation explaining how this should be done?
=20

Quoted 1 line

I'd really love for some workaround that would allow AP mode to w=

ork.=20

Quoted 9 lines
Quoted 9 lines

=20
The workaround would be to make hostapd generate bogus TX callback internally with claim for a successfully received ACK when sending (re)association response. I'm not very keen on including such functionality and certainly do not consider dropping the correct behavior because of a broken hw design.
=20
If someone can come up with a clean patch that allows this to be configured in hostapd.conf without affecting the default behavior, =

I

Quoted 1 line
Quoted 1 line

could consider applying the changes. However, please keep in mind t=

hat

Quoted 1 line
Quoted 1 line

I'm interested in using TX status reporting to improve reliability =

of

Quoted 1 line
Quoted 1 line

connection setup, so its use is more likely to increase in the futu=

re.

Quoted 2 lines
Quoted 2 lines

=20

Quoted 1 line

It would be great if it could be deemed that the protocol doesn't=

really

Quoted 1 line
Quoted 1 line
Quoted 1 line

require CTS protection/status information, and can be made reliab=

le and

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

standards compliant without support for it from the driver. Unfortunately I don't have high hopes for that, but I wonder what=

's Mr.

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Malinen's opinion?

=20
IEEE 802.11 association state in the AP is changed when receiving a=

n ACK

Quoted 1 line
Quoted 1 line

from the STA for a (re)association response frame with success stat=

us

Quoted 1 line
Quoted 1 line

(see IEEE Std 802.11-2007, 11.3.2.2). In order to be able to implem=

ent

Quoted 5 lines
Quoted 5 lines

this correctly, AP mode operation require the TX status callback to provide information for the ACK status of (re)association response frames.
=20
I would also like to see this status used to speed up recovery from=

=20

Quoted 5 lines
Quoted 5 lines

dropped EAPOL frames during IEEE 802.1X EAP authentication, 4-way handshake and group handshake. In certain environments, this could improve stability of connection establishment greatly. =20
- Jouni

Quoted 7 lines

=20
Well, sounds like there are good reasons to keep investigating the possibility of fixing this a bit more properly in the driver.=20 =20
If we turn off the AUTO_TX_SEQ and/or TXD_W1_HW_SEQUENCE (what'as the difference?) and assigning sequence numbers manually, could we then match the ack-frame's sequence number to the ones we have sent?

Unfortunately, ACK frames do not carry sequence numbers. Only managemen= t
and control frames have them.

Mattias

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#34 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

In reply to Mattias Nissler
Quoted 3 lines · Mattias Nissler
Quoted 2 lines · On Fri, 2008-09-19 at 12:08 +0300, Mikko Virkkil=E4 wrote:
Quoted 1 line · Mattias Nissler

[I've added the zd1211rw maintainers to the CC, I hope they can s=

hed

Quoted 1 line
Quoted 1 line
Quoted 1 line

some light on the question whether the ack queue mechanism that d=

river

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

has is actually correct]
=20
I've had a closer look at the idea of deciding whether a frame ha=

s

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

been
transmitted succesfully by monitoring incoming ACK frames and I'v=

e hit

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

a
fundamental problem: How do you correlate incoming ACK frames to =

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

frames that were actually transmitted? The ACK frame only carries=

the

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

address of the station that transmitted the frame being acked, no further information. Now this means if you have the hardware TX t=

wo

Quoted 1 line
Quoted 1 line
Quoted 1 line

frames and receive one ACK frame in the RX path, you cannot know =

which

Quoted 1 line
Quoted 1 line
Quoted 1 line

TX frame the ACK belongs to, because they will be identical, righ=

t?

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

=20
The hardware, however, knows, because the ACKs are required to be transmitted directly after the corresponding frame is received, b=

ut we

Quoted 1 line
Quoted 1 line
Quoted 1 line

don't know in the driver about this timing information, at least =

not for

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

rt2x00.
=20
I wonder whether the ack queue idea Mikko found in the zd1211rw d=

river

Quoted 1 line
Quoted 1 line
Quoted 1 line

is actually working correctly for that driver? I've only had a sh=

ort

Quoted 1 line
Quoted 1 line
Quoted 1 line

look, but found that incoming ACKs are only matched against trans=

mitted

Quoted 1 line
Quoted 1 line
Quoted 1 line

frames by means of the address carried within the ACK. So I'd thi=

nk in

Quoted 1 line
Quoted 1 line
Quoted 1 line

the situation I outlined above, the zd1211rw driver will also be =

unable

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

to match the ACK to the correct frame. Any comments on this? =20
Mattiass
=20

=20
AFAIK your analysis is correct and I think this is somewhat of a kn=

own

Quoted 4 lines
Quoted 4 lines

problem with the implementation in zd1211rw driver. I haven't come across a way of getting around the problem. I read some suggestions about stopping all transmission to a certain address until we get a status update for the previous packet sent to that address, but iir=

c

Quoted 2 lines
Quoted 2 lines

this was deemed impractical. On the other hand the current implementation in zd1211rw (and hopefully soon in rt2x00) doesn't r=

eally

Quoted 1 line
Quoted 1 line

break anything that works without it and on rt2x00 it gets AP-mode =

in a

Quoted 4 lines
Quoted 1 line

somewhat more usable state.=20

=20
Well, as long as nothing vitally depends on the transmissions status (i.e. MAC layer acknowledgements in 802.11 lingo), you are right that=

it

Quoted 2 lines

won't break anything. Nevertheless, it is code that is known to be working incorrectly and non-fixable, so I'd vote against it (I'd rath=

er

Quoted 1 line

live with the approach of always reporting successful tx status as yo=

u

Quoted 1 line

have proposed earlier if I had to choose from the two of them). Maybe=

we

Quoted 1 line

just have to accept that there is hardware that cannot report MAC lay=

er

Quoted 2 lines

acknowledgements back to the driver. Unless somebody comes up with a feasible idea how to do it. Ivo, do we have a contact at Ralink to as=

k

Quoted 1 line

about this?

The Legacy USB drivers don't care about the TX status, if it wants to k= now
the TX statistics it reads the register which contains the ACK/RTS coun= ters
and determine with those values if the link is good or not.

Seeing that the PCI drivers also don't really care about the TX status = (other
then setting some statistics) I think we can assume the TX status isn't=
important
for the Ralink people.

But I'll send a mail to Ralink to see if they actually do have some ide= as about it.

Quoted 2 lines

This brings up the question whether we can do without tx status reporting. Does anyone know why hostapd requires the tx status? As fa=

r

Quoted 1 line

as I understand, mac80211 only uses the tx status reporting only for =

the

Quoted 4 lines

tx rate control. Rate control algos that don't use tx status are definitely feasible (and in fact we'll need one for rt73). =20
I'll look into hostapd to figure out whether the tx status reporting =

is

Quoted 2 lines

really required when I find some time. However, I've just received rt2800 hardware, so getting the rt2800 driver going is my top priorit=

y

Quoted 1 line

for the next weeks.

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#35 lore raw

Re: ACK matching [was: TX status reporting with help of an ack queue]

In reply to Mattias Nissler
Quoted 6 lines · Mattias Nissler

I wonder whether the ack queue idea Mikko found in the zd1211rw driver is actually working correctly for that driver? I've only had a short look, but found that incoming ACKs are only matched against transmitted frames by means of the address carried within the ACK. So I'd think in the situation I outlined above, the zd1211rw driver will also be unable to match the ACK to the correct frame. Any comments on this?

It is known not-quite-correct and an area of the code that I personally dislike. However, without it, rate control does not work at all, so it is better than not having it. (my personal preference would be for a RC algo which does not require input of successful TX frames, but I have not stepped up to design or do the work...) The code that also keeps the USB TX queue to reasonable size also relies on it, and in that case the inaccuracies are also not important.

Daniel