mlx4_en: Handle page allocation failure during receive

If we failed to allocate new fragments for receive buffer,
the packet should be dropped and packets should be reused.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Yevgeny Petrilin 2009-04-26 20:42:57 +00:00 committed by David S. Miller
parent a4233304bb
commit 785a0982ea

View File

@ -610,6 +610,10 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags, used_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags,
skb_shinfo(skb)->frags, skb_shinfo(skb)->frags,
page_alloc, length); page_alloc, length);
if (unlikely(!used_frags)) {
kfree_skb(skb);
return NULL;
}
skb_shinfo(skb)->nr_frags = used_frags; skb_shinfo(skb)->nr_frags = used_frags;
/* Copy headers into the skb linear buffer */ /* Copy headers into the skb linear buffer */