Skip to content

Commit 7dd43d3

Browse files
signal11davem330
authored andcommitted
mac802154: Do not try to resend failed packets
When ops->xmit() fails, drop the packet. Devices which support hardware ack and retry (which include all devices currently supported by mainline), will automatically retry sending the packet (in the hardware) up to 3 times, per the 802.15.4 spec. There is no need, and it is incorrect to try to do it in mac802154. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 524fba6 commit 7dd43d3

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

‎net/mac802154/mac802154.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ struct mac802154_sub_if_data {
8888

8989
#define mac802154_to_priv(_hw) container_of(_hw, struct mac802154_priv, hw)
9090

91-
#define MAC802154_MAX_XMIT_ATTEMPTS 3
92-
9391
#define MAC802154_CHAN_NONE (~(u8)0) /* No channel is assigned */
9492

9593
extern struct ieee802154_reduced_mlme_ops mac802154_mlme_reduced;

‎net/mac802154/tx.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ struct xmit_work {
3939
struct mac802154_priv *priv;
4040
u8 chan;
4141
u8 page;
42-
u8 xmit_attempts;
4342
};
4443

4544
static void mac802154_xmit_worker(struct work_struct *work)
@@ -60,18 +59,12 @@ static void mac802154_xmit_worker(struct work_struct *work)
6059
}
6160

6261
res = xw->priv->ops->xmit(&xw->priv->hw, xw->skb);
62+
if (res)
63+
pr_debug("transmission failed\n");
6364

6465
out:
6566
mutex_unlock(&xw->priv->phy->pib_lock);
6667

67-
if (res) {
68-
if (xw->xmit_attempts++ < MAC802154_MAX_XMIT_ATTEMPTS) {
69-
queue_work(xw->priv->dev_workqueue, &xw->work);
70-
return;
71-
} else
72-
pr_debug("transmission failed for %d times",
73-
MAC802154_MAX_XMIT_ATTEMPTS);
74-
}
7568

7669
dev_kfree_skb(xw->skb);
7770

@@ -114,7 +107,6 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
114107
work->priv = priv;
115108
work->page = page;
116109
work->chan = chan;
117-
work->xmit_attempts = 0;
118110

119111
queue_work(priv->dev_workqueue, &work->work);
120112

0 commit comments

Comments
 (0)