-
Notifications
You must be signed in to change notification settings - Fork 2k
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
netdev/ieee802154_submac: add retransmission reporting #15208
Conversation
4871b00
to
2fc600d
Compare
netdev_ieee802154_submac_t *netdev_submac = container_of(submac, | ||
netdev_ieee802154_submac_t, | ||
submac); | ||
netdev_t *netdev = (netdev_t *)netdev_submac; | ||
|
||
netdev_submac->retrans = info->retrans; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, indeed this works. But maybe we should handle the case where there are HW retrans but no tx_info in the SubMAC. That way, the SubMAC always gives this information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, we can return an error when NETOPT_TX_RETRIES_NEEDED
is called in such case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I wasn't sure if info
could be NULL
.
if (info) { | ||
netdev_submac->retrans = info->retrans; | ||
} else { | ||
netdev_submac->retrans = -1; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are there, could you add this patch?
diff --git a/sys/net/link_layer/ieee802154/submac.c b/sys/net/link_layer/ieee802154/submac.c
index 0584ba95a3..392714b995 100644
--- a/sys/net/link_layer/ieee802154/submac.c
+++ b/sys/net/link_layer/ieee802154/submac.c
@@ -194,6 +194,9 @@ static void _handle_tx_success(ieee802154_submac_t *submac,
if (ieee802154_radio_has_frame_retrans(dev) ||
ieee802154_radio_has_irq_ack_timeout(dev) || !submac->wait_for_ack) {
+ if (!ieee802154_radio_has_frame_retrans_info()) {
+ info->retrans = -1;
+ }
_tx_end(submac, info->status, info);
}
else {
And change these lines to:
if (info) { | |
netdev_submac->retrans = info->retrans; | |
} else { | |
netdev_submac->retrans = -1; | |
} | |
if (info) { | |
netdev_submac->retrans = info->retrans; | |
} |
?
That way the SubMAC will always give its best effort to report the retransmissions. And if there's no info (TX_MEDIUM_BUSY or TX_NO_ACK), then netdev_submac->retrans
doesn't get updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think turning the _get_cap()
function into a bitfield would be a good optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we could!
Looks good to me. Please squash. |
189d55b
to
914be5b
Compare
If we do software retransmissions, we already keep a count. Allow to query it with `NETOPT_TX_RETRIES_NEEDED`.
914be5b
to
87151db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Contribution description
If we do software retransmissions, we already keep a count.
Allow to query it with
NETOPT_TX_RETRIES_NEEDED
.Testing procedure
Issues/PRs references
#14448