public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* small patch - 2.4.21-pre7 net/core/bk
@ 2003-04-21 18:46 Grzegorz Jaskiewicz
  2003-04-21 18:57 ` Grzegorz Jaskiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Grzegorz Jaskiewicz @ 2003-04-21 18:46 UTC (permalink / raw)
  To: lkml

Maybe i just don't understeand this part of code, but i think we should
not give calling driver five chances :)

---------------------------------------------------------------
--- net/core/skbuff.c   2003-04-21 19:43:10.000000000 +0100
+++ net/core/skbuff.c.org       2003-04-21 19:42:35.000000000 +0100
@@ -167,9 +167,13 @@
        u8 *data;
 
        if (in_interrupt() && (gfp_mask & __GFP_WAIT)) {
-               printk(KERN_ERR "alloc_skb called nonatomically "
-                      "from interrupt %p\n", NET_CALLER(size));
-               BUG();
+               static int count = 0;
+               if (++count < 5) {
+                       printk(KERN_ERR "alloc_skb called nonatomically
"
+                              "from interrupt %p\n", NET_CALLER(size));
+                       BUG();
+               }
+               gfp_mask &= ~__GFP_WAIT;
        }
 
        /* Get the HEAD */
---------------------------------------------------------------

Also, i am bit confused with this part :
     /* Get the DATA. Size must match skb_add_mtu(). */
        size = SKB_DATA_ALIGN(size);
        data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask);
        if (data == NULL)
                goto nodata;

        /* XXX: does not include slab overhead */ 
        skb->truesize = size + sizeof(struct sk_buff);

can anybody explain me please why skb->truesize gets size+sizeof(struct
sk_buff) (acording to XXX above it, it is incorrect).


-- 
Grzegorz Jaskiewicz aka Kain/K4
K4 labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: small patch - 2.4.21-pre7 net/core/bk
  2003-04-21 18:46 small patch - 2.4.21-pre7 net/core/bk Grzegorz Jaskiewicz
@ 2003-04-21 18:57 ` Grzegorz Jaskiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Grzegorz Jaskiewicz @ 2003-04-21 18:57 UTC (permalink / raw)
  To: lkml

On Mon, 2003-04-21 at 19:46, Grzegorz Jaskiewicz wrote:
> Maybe i just don't understeand this part of code, but i think we
should
> not give calling driver five chances :)
> 
of course it should be:
-----------------------------------------------------------------
--- net/core/skbuff.c.org       2003-04-21 19:42:35.000000000 +0100
+++ net/core/skbuff.c   2003-04-21 19:43:10.000000000 +0100
@@ -167,13 +167,9 @@
        u8 *data;
 
        if (in_interrupt() && (gfp_mask & __GFP_WAIT)) {
-               static int count = 0;
-               if (++count < 5) {
-                       printk(KERN_ERR "alloc_skb called nonatomically
"
-                              "from interrupt %p\n", NET_CALLER(size));
-                       BUG();
-               }
-               gfp_mask &= ~__GFP_WAIT;
+               printk(KERN_ERR "alloc_skb called nonatomically "
+                      "from interrupt %p\n", NET_CALLER(size));
+               BUG();
        }
 
        /* Get the HEAD */

-----------------------------------------------------------------

> Also, i am bit confused with this part :
>      /* Get the DATA. Size must match skb_add_mtu(). */
>         size = SKB_DATA_ALIGN(size);
>         data = kmalloc(size + sizeof(struct skb_shared_info),
gfp_mask);
>         if (data == NULL)
>                 goto nodata;
> 
>         /* XXX: does not include slab overhead */ 
>         skb->truesize = size + sizeof(struct sk_buff);
> 
> can anybody explain me please why skb->truesize gets
size+sizeof(struct
> sk_buff) (acording to XXX above it, it is incorrect).

--
Grzegorz Jaskiewicz aka Kain/K4
K4 labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-21 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-21 18:46 small patch - 2.4.21-pre7 net/core/bk Grzegorz Jaskiewicz
2003-04-21 18:57 ` Grzegorz Jaskiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox