Re: [PATCH 3/5] skge: use dev_alloc_skb

2006-08-29 Thread Stephen Hemminger
On Tue, 29 Aug 2006 12:23:36 +0100
Christoph Hellwig <[EMAIL PROTECTED]> wrote:

> On Mon, Aug 28, 2006 at 04:19:37PM -0700, Stephen Hemminger wrote:
> > To avoid problems with buggy protocols that assume extra header space,
> > use dev_alloc_skb() when allocating receive buffers.
> > 
> > Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
> > 
> > --- skge-2.6.orig/drivers/net/skge.c
> > +++ skge-2.6/drivers/net/skge.c
> > @@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port
> > do {
> > struct sk_buff *skb;
> >  
> > -   skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL);
> > +   skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
> > + GFP_KERNEL);
> 
> While you're at it please use netdev_alloc_skb.
> 

Okay, that will be in the next clump.

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/5] skge: use dev_alloc_skb

2006-08-29 Thread Christoph Hellwig
On Mon, Aug 28, 2006 at 04:19:37PM -0700, Stephen Hemminger wrote:
> To avoid problems with buggy protocols that assume extra header space,
> use dev_alloc_skb() when allocating receive buffers.
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
> 
> --- skge-2.6.orig/drivers/net/skge.c
> +++ skge-2.6/drivers/net/skge.c
> @@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port
>   do {
>   struct sk_buff *skb;
>  
> - skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL);
> + skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
> +   GFP_KERNEL);

While you're at it please use netdev_alloc_skb.

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] skge: use dev_alloc_skb

2006-08-28 Thread Stephen Hemminger
To avoid problems with buggy protocols that assume extra header space,
use dev_alloc_skb() when allocating receive buffers.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

--- skge-2.6.orig/drivers/net/skge.c
+++ skge-2.6/drivers/net/skge.c
@@ -827,7 +827,8 @@ static int skge_rx_fill(struct skge_port
do {
struct sk_buff *skb;
 
-   skb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_KERNEL);
+   skb = __dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN,
+ GFP_KERNEL);
if (!skb)
return -ENOMEM;
 
@@ -2609,7 +2610,7 @@ static inline struct sk_buff *skge_rx_ge
goto error;
 
if (len < RX_COPY_THRESHOLD) {
-   skb = alloc_skb(len + 2, GFP_ATOMIC);
+   skb = dev_alloc_skb(len + 2);
if (!skb)
goto resubmit;
 
@@ -2624,7 +2625,7 @@ static inline struct sk_buff *skge_rx_ge
skge_rx_reuse(e, skge->rx_buf_size);
} else {
struct sk_buff *nskb;
-   nskb = alloc_skb(skge->rx_buf_size + NET_IP_ALIGN, GFP_ATOMIC);
+   nskb = dev_alloc_skb(skge->rx_buf_size + NET_IP_ALIGN);
if (!nskb)
goto resubmit;
 

--
Stephen Hemminger <[EMAIL PROTECTED]>

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html