mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-03 21:53:45 +01:00
realtek: eth: simplify napi handler
rteth_hw_receive() already has a loop that checks how much work may be done. No need to repeat that in the caller too. While we are here adapt the function prefix. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/22156 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
0eac896cc7
commit
370c99b4ec
1 changed files with 4 additions and 12 deletions
|
|
@ -1085,21 +1085,13 @@ static int rteth_hw_receive(struct net_device *dev, int ring, int budget)
|
|||
return work_done;
|
||||
}
|
||||
|
||||
static int rtl838x_poll_rx(struct napi_struct *napi, int budget)
|
||||
static int rteth_poll_rx(struct napi_struct *napi, int budget)
|
||||
{
|
||||
struct rtl838x_rx_q *rx_q = container_of(napi, struct rtl838x_rx_q, napi);
|
||||
struct rteth_ctrl *ctrl = rx_q->ctrl;
|
||||
int ring = rx_q->id;
|
||||
int work_done = 0;
|
||||
|
||||
while (work_done < budget) {
|
||||
int work = rteth_hw_receive(ctrl->netdev, ring, budget - work_done);
|
||||
|
||||
if (!work)
|
||||
break;
|
||||
work_done += work;
|
||||
}
|
||||
int work_done, ring = rx_q->id;
|
||||
|
||||
work_done = rteth_hw_receive(ctrl->netdev, ring, budget);
|
||||
if (work_done < budget && napi_complete_done(napi, work_done))
|
||||
rteth_reenable_irq(ctrl, ring);
|
||||
|
||||
|
|
@ -1707,7 +1699,7 @@ static int rtl838x_eth_probe(struct platform_device *pdev)
|
|||
for (int i = 0; i < RTETH_RX_RINGS; i++) {
|
||||
ctrl->rx_qs[i].id = i;
|
||||
ctrl->rx_qs[i].ctrl = ctrl;
|
||||
netif_napi_add(dev, &ctrl->rx_qs[i].napi, rtl838x_poll_rx);
|
||||
netif_napi_add(dev, &ctrl->rx_qs[i].napi, rteth_poll_rx);
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue