[PATCH] skge: dont use dev_alloc_skb for rx buffs
authorStephen Hemminger <shemminger@osdl.org>
Thu, 23 Mar 2006 19:07:24 +0000 (11:07 -0800)
committerJeff Garzik <jeff@garzik.org>
Thu, 23 Mar 2006 22:13:54 +0000 (17:13 -0500)
The skge driver was using dev_alloc_skb which reserves space for the
Ethernet header. This unnecessary and it should just use alloc_skb,
also by using GFP_KERNEL during startup it won't run into problems when
a user asks for a huge ring size or mtu and potentially drains the
reserved atomic pool.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/skge.c

index 89a6252ac7cc16aab6feba45ac0cb9a2e1515425..b0aa150bbd8a6b49e989252be17659d151715789 100644 (file)
@@ -829,7 +829,7 @@ static int skge_rx_fill(struct skge_port *skge)
        do {
                struct sk_buff *skb;
 
-               skb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
+               skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL);
                if (!skb)
                        return -ENOMEM;
 
@@ -2592,7 +2592,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
                goto error;
 
        if (len < RX_COPY_THRESHOLD) {
-               skb = dev_alloc_skb(len + 2);
+               skb = alloc_skb(len + 2, GFP_ATOMIC);
                if (!skb)
                        goto resubmit;
 
@@ -2607,7 +2607,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
                skge_rx_reuse(e, skge->rx_buf_size);
        } else {
                struct sk_buff *nskb;
-               nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
+               nskb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_ATOMIC);
                if (!nskb)
                        goto resubmit;