Skip to content

Commit 7121205

Browse files
RajuRangojuPaolo Abeni
authored andcommitted
amd-xgbe: handle the corner-case during tx completion
The existing implementation uses software logic to accumulate tx completions until the specified time (1ms) is met and then poll them. However, there exists a tiny gap which leads to a race between resetting and checking the tx_activate flag. Due to this the tx completions are not reported to upper layer and tx queue timeout kicks-in restarting the device. To address this, introduce a tx cleanup mechanism as part of the periodic maintenance process. Fixes: c5aa9e3 ("amd-xgbe: Initial AMD 10GbE platform driver") Acked-by: Shyam Sundar S K <[email protected]> Signed-off-by: Raju Rangoju <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 676ec53 commit 7121205

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-drv.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,10 +682,24 @@ static void xgbe_service(struct work_struct *work)
682682
static void xgbe_service_timer(struct timer_list *t)
683683
{
684684
struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer);
685+
struct xgbe_channel *channel;
686+
unsigned int i;
685687

686688
queue_work(pdata->dev_workqueue, &pdata->service_work);
687689

688690
mod_timer(&pdata->service_timer, jiffies + HZ);
691+
692+
if (!pdata->tx_usecs)
693+
return;
694+
695+
for (i = 0; i < pdata->channel_count; i++) {
696+
channel = pdata->channel[i];
697+
if (!channel->tx_ring || channel->tx_timer_active)
698+
break;
699+
channel->tx_timer_active = 1;
700+
mod_timer(&channel->tx_timer,
701+
jiffies + usecs_to_jiffies(pdata->tx_usecs));
702+
}
689703
}
690704

691705
static void xgbe_init_timers(struct xgbe_prv_data *pdata)

0 commit comments

Comments
 (0)