public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
To: Simon Kallweit <simon.kallweit@intefo.ch>
Cc: ecos-discuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] ecos + lwip
Date: Thu, 03 Sep 2009 07:45:00 -0000	[thread overview]
Message-ID: <b18c5f790909030044k5c26b458le96767786fe6154c@mail.gmail.com> (raw)
In-Reply-To: <4A9E9147.6070609@intefo.ch>

>>> <snip>
>>>
>>> cyg_lwip_sequential_init();
>>>
>>> cyg_lwip_thread_new( "My thread", m_main, (void *)"My thread",
>>> my_stack, 0x1000, 5 );
>>> ...
>>> ...
>>> <snip>
>>>
>>> I'll enable more debugs to see where it's getting stuck.
>>
>> After changing it to 2, it's able to find the interface (et0) with all
>> the right settings.
>
> Well, that does not really make sense. cyg_lwip_sequential_init() will not
> return until the lwip stack is initialized, and initializing ethernet device
> drivers is part of that. This *must* work even when the TCPIP thread has
> lower priority, as long as you start your application thread *after* the
> execution of cyg_lwip_sequential_init(). By starting *after* I mean that you
> also have to make sure that cyg_lwip_sequential_init() and starting your
> applications thread is done in the same thread!
>
> I hope I didn't miss the obvious here, but that's how it should work.

Well, I checked the code again. The netif init is done as part of
tcpip_init_done().
This I see is being called in tcpip_thread(). This function is being
executed in the
tcpip thread's context.

I guess this is why the priority of the threads matters.

Would do you think?

>
>> Now another problem has cropped up! :) Sorry.
>>
>> My app's actually a DHCP server. So it receives DHCP packets with 0.0.0.0
>> as the src IP. However, the stack is dropping them with the following
>> message:
>>
>> ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x101010b (0xffffff,
>> 0x1010b, 0xff000000)
>> ip_input: packet accepted on interface et
>> ip_input: packet source is not valid.
>>
>> I've enabled the following in my config:
>>
>> * Support broadcast filter
>> * Receive support
>>
>> Is anything else needed?
>
> May I ask you to forward this question to the lwip mailing list, I have no
> experience on that subject myself.

Ok. I'll do that.

>
>> Just one more thing:
>>
>> While tracing the path from  cyg_lwip_sequential_init() to see what
>> all happens, I saw that
>> we end up calling lwip_init() twice!
>>
>> Once in cyg_lwip_sequential_init() and then again in tcpip_init().
>>
>> Why do we do it twice? The only function called between these 2 calls is
>> cyg_semaphore_init().
>>
>> I think we can remove one of these. Or am I missing something?
>
> Well, that's a bug. Thanks for spotting. I wrapped a new release you can
> download from:
>
> http://download.westlicht.ch/lwip-20090902.tar.gz

Thanks!

-mandeep

>
> Simon
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2009-09-03  7:45 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 11:01 Mandeep Sandhu
2009-08-26 11:16 ` Simon Kallweit
2009-08-27 10:49   ` Mandeep Sandhu
2009-08-27 11:17     ` Simon Kallweit
2009-08-27 12:42       ` Mandeep Sandhu
2009-08-27 13:20         ` Mandeep Sandhu
2009-08-27 13:42           ` Simon Kallweit
2009-08-27 13:51             ` Mandeep Sandhu
2009-08-27 14:02               ` Mandeep Sandhu
2009-08-27 14:06                 ` Simon Kallweit
2009-08-27 14:47                   ` Sergei Gavrikov
2009-08-27 15:03                     ` Sergei Gavrikov
2009-09-01 12:04                   ` Mandeep Sandhu
2009-09-01 12:17                     ` Simon Kallweit
2009-09-01 12:32                       ` Mandeep Sandhu
2009-09-01 12:38                         ` Simon Kallweit
2009-09-01 12:49                           ` Mandeep Sandhu
2009-09-01 12:57                             ` Simon Kallweit
2009-09-01 13:25                               ` Mandeep Sandhu
2009-09-01 13:34                                 ` Simon Kallweit
2009-09-01 15:20                                   ` Mandeep Sandhu
2009-09-01 15:32                                     ` Simon Kallweit
2009-09-01 15:46                                       ` Mandeep Sandhu
2009-09-01 15:49                                         ` Simon Kallweit
2009-09-02  6:15                                           ` Mandeep Sandhu
2009-09-02 13:19                                             ` Mandeep Sandhu
2009-09-02 15:32                                               ` Simon Kallweit
2009-09-03  7:45                                                 ` Mandeep Sandhu [this message]
2009-09-03  8:36                                                   ` Simon Kallweit
2009-09-03  8:46                                                     ` Mandeep Sandhu
2009-09-03  8:48                                                       ` Simon Kallweit
2009-09-03  8:55                                                         ` Mandeep Sandhu
2009-09-03  9:04                                                           ` Simon Kallweit
2009-09-03 10:23                                                             ` Mandeep Sandhu
2009-09-03 10:46                                                               ` Sergei Gavrikov
2009-08-27 13:52             ` Sergei Gavrikov
2009-08-27 14:05               ` Simon Kallweit
2009-08-27 14:42             ` Bart Veer
2009-08-27 14:54               ` Sergei Gavrikov
2009-08-27 13:45           ` Sergei Gavrikov
2009-08-27 13:49             ` Mandeep Sandhu
2009-08-27 14:04             ` Simon Kallweit
  -- strict thread matches above, loose matches on Subject: below --
2009-08-27 14:20 agfa prayoga s
     [not found] <144735.17263.qm@web65404.mail.ac4.yahoo.com>
2009-08-27 14:11 ` Simon Kallweit
2009-07-30 13:10 Mandeep Sandhu
2009-07-30 13:51 ` Sergei Gavrikov
2009-07-31  5:44   ` Mandeep Sandhu
2009-07-31 18:56     ` Sergei Gavrikov
2009-08-02 17:24       ` Mandeep Sandhu

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=b18c5f790909030044k5c26b458le96767786fe6154c@mail.gmail.com \
    --to=mandeepsandhu.chd@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=simon.kallweit@intefo.ch \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).