最近又遇到一个难题,ATHEROS 无线发包受堵导致用户上网业务慢或卡.
代码走到:
ath_tx_draintxq(struct ath_softc* sc , struct ath_txq *txq,HAL_BOOL retry_tx)
{
struct ath_buf* bf, * lastbf;
ath_bufhead bf_head;
/*
* NB: this assumes output has been stopped and we do not need to block ath_tx_tasklet
* 也就是说,走到这里,假设无线发送已停止. 至于为什么会停,如何判断其停,要向上查.
* /
for(;;)
{
ATH_TXQ_LOCK(txq)
bf = TAILQ_FIRST(&txq->axq_fifo[txq->axqtailindex]);
//得到了当前TXQ队列的首报文bf
lastbf = bf->bf_lastbf;
//得到尾报文
if(!retry_tx)
lastbf->bf-isswaborted = 1;
/* remove ath_buf’s of the same mpdu from txq*/
//删除TXQ中同一个MPDU聚合帧中的所有报文
if((txq == sc->sc_cabq) || (txq==sc->sc_uapsdq))
{
ATH_EDMA_MCASTQ_MOVE_HEAD_UNTIL(txq,&bf_head,lastbf,bf_list);//从多播队列中删除
}
else
{
ATH_EDMA_TXQ_MOVE_HEAD_UNTIL(txq,&bf_head,lastbf,bf_list);//从其他队列中删除
}
if(bf->bf_isaggr){
txq_axq_aggr_depth–;
__11nstats(sc,tx_comperror); //在athstats结果中记录统计信息
}
ATH_TXQ_UNLOCK(txq);
…
}