[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0835B3720019904CB8F7AA43166CEEB2F18D4837@RTITMBSVM03.realtek.com.tw>
Date: Fri, 16 Aug 2019 10:04:58 +0000
From: Hayes Wang <hayeswang@...ltek.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: nic_swsd <nic_swsd@...ltek.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] r8152: divide the tx and rx bottom functions
Eric Dumazet [mailto:eric.dumazet@...il.com]
> Sent: Friday, August 16, 2019 5:27 PM
[...]
> Maybe you would avoid messing with a tasklet (we really try to get rid
> of tasklets in general) using two NAPI, one for TX, one for RX.
>
> Some drivers already use two NAPI, it is fine.
>
> This might avoid the ugly dance in r8152_poll(),
> calling napi_schedule(napi) after napi_complete_done() !
The reason is that the USB device couldn't control
the interrupt of USB controller. That is, I couldn't
disable the interrupt before napi_schedule and
enable it after napi_complete_done. If the callback
function occurs during the following timing, it is
possible no one would schedule the napi again.
static int r8152_poll(struct napi_struct *napi, int budget)
{
struct r8152 *tp = container_of(napi, struct r8152, napi);
int work_done;
work_done = rx_bottom(tp, budget);
bottom_half(tp);
--> callback occurs here and try to call napi_schedule
napi_complete_done(napi, work_done)
That is, no tx or rx could be handled unless
something trigger napi_schedule.
Best Regards,
Hayes
Powered by blists - more mailing lists