Skip to content

Commit

Permalink
sky2: keep track of receive alloc failures
Browse files Browse the repository at this point in the history
When driver can't allocate receive buffer it drops incoming
packet. Keep a counter.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed May 18, 2007
1 parent 53419c6 commit 3225b91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2141,8 +2141,10 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
switch (le->opcode & ~HW_OWNER) {
case OP_RXSTAT:
skb = sky2_receive(dev, length, status);
if (!skb)
if (unlikely(!skb)) {
sky2->net_stats.rx_dropped++;
goto force_update;
}

skb->protocol = eth_type_trans(skb, dev);
sky2->net_stats.rx_packets++;
Expand Down

0 comments on commit 3225b91

Please sign in to comment.