Skip to content

Commit

Permalink
drivers/net/ethernet/via/via-velocity.c: update napi implementation
Browse files Browse the repository at this point in the history
Drivers supporting NAPI should use a NAPI-specific function for receiving
packets.  Hence netif_rx is changed to netif_receive_skb.

Furthermore netif_napi_del should be used in the probe and remove function
to clean up the NAPI resource information.

Thanks to Francois Romieu, David Shwatrz and Rami Rosen for their help on
this patch.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julia Lawall authored and David S. Miller committed Aug 15, 2013
1 parent 728e2cc commit 2fdac01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/via/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)

__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
}
netif_rx(skb);
netif_receive_skb(skb);

stats->rx_bytes += pkt_len;
stats->rx_packets++;
Expand Down Expand Up @@ -2884,6 +2884,7 @@ static int velocity_probe(struct device *dev, int irq,
return ret;

err_iounmap:
netif_napi_del(&vptr->napi);
iounmap(regs);
err_free_dev:
free_netdev(netdev);
Expand All @@ -2904,6 +2905,7 @@ static int velocity_remove(struct device *dev)
struct velocity_info *vptr = netdev_priv(netdev);

unregister_netdev(netdev);
netif_napi_del(&vptr->napi);
iounmap(vptr->mac_regs);
free_netdev(netdev);
velocity_nics--;
Expand Down

0 comments on commit 2fdac01

Please sign in to comment.