mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nalin Gupta <nalin@impulsesoft.com>
To: "v.nagasrinivas" <cheluvi@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Do and Don'ts for socket programming from kernel  module/kernel-thread
Date: Thu, 20 Mar 2003 13:39:39 +0530	[thread overview]
Message-ID: <5.2.0.9.0.20030320132850.00b01af8@mail.impulsesoft.com> (raw)
In-Reply-To: <3E797086.A686E25@yahoo.com>

Dear Srinivas,

If you refer the oops msg I posted.

http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.2/0437.html

Probably, I am at mistake, as I am calling "sock_sendmsg" for UDP socket.
from my netdevice::hard_start_xmit (micdev_xmit)  function.

What is my mistake is not clear to me ?

Further, as we know netdevice::hard_start_xmit function is called through
Net Tx Tasklet function net_tx_action through do_softirq.

I am just taking care masking __GFP_WAIT for sock->sk->allocation.
I also tried by merely assigned GFP_ATOMIC.

And also set MSG_DONTWAIT flag for "msg" parameter to sock_sendmsg.

Do I need to disable interrupts too.
I was assuming that "local_irq_save"  in skb_head_from_pool will take care.

I recompiled kernel with quite a few printk, but it seems only my 
invocation to sock_sendmsg cause this panic.


thanks,
regards,
- nalin

At 01:10 PM 3/20/2003 +0530, v.nagasrinivas wrote:
>Hi Nalin,
>
>                    I am just putting my idea , like inline function you
>are mentioning
>from the header file, could you copy and make it as a macro in that
>header file
>and the original inline function  you put like commenting for the time
>being..
>and in the macro just
>
>
>---------------------------------------------------------
>extern __inline__ struct sk_buff *__skb_dequeue(struct sk_buff_head
>*list)
>{
>         struct sk_buff *next, *prev, *result;
>
>         prev = (struct sk_buff *) list;
>         next = prev->next;
>         result = NULL;
>         if (next != prev) {
>                 result = next;
>                 next = next->next;
>                 list->qlen--;
>                 next->prev = prev;
>                 prev->next = next;
>                 result->next = NULL;
>                 result->prev = NULL;
>                 result->list = NULL;
>         }
>         return result;
>}
>
>extern   struct sk_buff *__skb_dequeue(struct sk_buff_head *list)\
>{\
>         struct sk_buff *next, *prev, *result;\
>
>         prev = (struct sk_buff *) list;\
>         printk("%d%s", __LINE__ ,  __FILE__);  <----like this some more
>also.......
>         next = prev->next;\
>         result = NULL;\
>         if (next != prev) {\
>                 result = next;\
>                 next = next->next;\
>                 list->qlen--;\
>                 next->prev = prev;\
>                 prev->next = next;\
>                 result->next = NULL;\
>                 result->prev = NULL;\
>                 result->list = NULL;\
>         }\
>         return result;\
>}\
>
>will give actually at what line and which file is causing causing the
>problem..
>So can debug the problem easily..
>
>
>I am waiting to hear if this works out....to solve the problem.....
>
>
>regards,
>srinivas.
>
>
>
>Path: uni-berlin.de!fu-berlin.de!bofh.it!robomod
>From: <nalin@impulsesoft.com>
>Newsgroups: linux.kernel
>Subject: Do and Don'ts for socket programming from kernel module/kernel-thread
>Date: Thu, 20 Mar 2003 07:10:06 +0100
>Message-ID: <20030320061006$37ac@gated-at.bofh.it>
>X-Mailer: TWIG 2.7.4
>X-Client-IP: 202.9.179.70
>Sender: robomod@news.nic.it
>X-Mailing-List: linux-kernel@vger.kernel.org
>Approved: robomod@news.nic.it
>Organization: linux.* mail to news gateway
>X-Original-Date: Thu, 20 Mar 2003 06:04:02 -0000
>X-Original-Message-ID: <20030320055305Z261391-25575+33069@vger.kernel.org>
>X-Original-Sender: linux-kernel-owner@vger.kernel.org
>X-Original-To: <linux-kernel@vger.kernel.org>
>Xref: uni-berlin.de linux.kernel:120670
>
>Friends,
>
>Where could I find some tips and tricks for correctly doing socket programming
>from a kernel module and a kernel thread.
>
>I am totally stuck and not able to proceed.
>
>I am invariably getting kernel panic from __skb_dequeue inline function called
>from alloc_skb.
>
>In detail I posted following mail, but unfortunately it could not attract
>anyones attention.
>
>Sub : alloc_skb panic oops / virtual network interface
>URL:  http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.2/0437.html
>
>
>Hope to get some response and much need guidance from linux gurus.
>
>thanks in advance,
>
>regards
>- nalin
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/


       reply	other threads:[~2003-03-20  7:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3E797086.A686E25@yahoo.com>
2003-03-20  8:09 ` Nalin Gupta [this message]
2003-03-20  6:04 nalin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.2.0.9.0.20030320132850.00b01af8@mail.impulsesoft.com \
    --to=nalin@impulsesoft.com \
    --cc=cheluvi@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®