Add xmit alloc retry

This commit is contained in:
kimocoder 2020-02-01 07:06:42 +01:00
parent 4a6960b2ad
commit 2d29bdded9

View File

@ -4415,6 +4415,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
u8 dummybuf[32]; u8 dummybuf[32];
int len = skb->len, rtap_len, consume; int len = skb->len, rtap_len, consume;
int alloc_tries, alloc_delay;
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize); rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
@ -4442,11 +4443,16 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
} }
#endif #endif
pmgntframe = alloc_mgtxmitframe(pxmitpriv); alloc_delay = 100;
if (pmgntframe == NULL) { for (alloc_tries=3; alloc_tries > 0; alloc_tries--) {
rtw_udelay_os(500); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
goto fail; if (pmgntframe != NULL)
break;
rtw_udelay_os(alloc_delay);
alloc_delay += alloc_delay/2;
} }
if (pmgntframe == NULL)
goto fail;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;