public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] ecos with lwip and 2 interfaces
@ 2009-09-21 14:05 Mandeep Sandhu
  2009-09-22  7:28 ` Simon Kallweit
  0 siblings, 1 reply; 9+ messages in thread
From: Mandeep Sandhu @ 2009-09-21 14:05 UTC (permalink / raw)
  To: ecos-discuss

Hi All,

I've been running my application with Simon's recent port of lwIP
(1.3.1) with ecos with the linux synthetic target.

Things have been running fine with the app only using 1 net i/f, i.e
et0. et0 maps to my linux tap device.

synth_device ethernet {
   eth0 ethertap tap0
}

Now I need to use a second interface. So 'et1' will map to the real
eth0 on my PC. For this I modified my tdf file as such:

synth_device ethernet {
   eth0 ethertap tap0
   eth1 real eth0
}

In the lwIP config, I've enabled "eth1".

However, in the app a call to cyg_lwip_sequential_init() only
initializes et0 and I don't see any init for et1. I've tried using
both, a static as well as DHCP IP addr for it. But that does not help.

Has anybody used to 2 interfaces with the recent port of lwIP? Is
there anything else that I need to do, either in configuration or in
my app?

Thanks,
-mandeep

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-21 14:05 [ECOS] ecos with lwip and 2 interfaces Mandeep Sandhu
@ 2009-09-22  7:28 ` Simon Kallweit
  2009-09-23 11:12   ` Mandeep Sandhu
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Kallweit @ 2009-09-22  7:28 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Mandeep Sandhu wrote:
> Hi All,
> 
> I've been running my application with Simon's recent port of lwIP
> (1.3.1) with ecos with the linux synthetic target.
> 
> Things have been running fine with the app only using 1 net i/f, i.e
> et0. et0 maps to my linux tap device.
> 
> synth_device ethernet {
>    eth0 ethertap tap0
> }
> 
> Now I need to use a second interface. So 'et1' will map to the real
> eth0 on my PC. For this I modified my tdf file as such:
> 
> synth_device ethernet {
>    eth0 ethertap tap0
>    eth1 real eth0
> }
> 
> In the lwIP config, I've enabled "eth1".
> 
> However, in the app a call to cyg_lwip_sequential_init() only
> initializes et0 and I don't see any init for et1. I've tried using
> both, a static as well as DHCP IP addr for it. But that does not help.
> 
> Has anybody used to 2 interfaces with the recent port of lwIP? Is
> there anything else that I need to do, either in configuration or in
> my app?

I have not really tested with multiple interfaces myself. But it seems 
to me that you did not enable the second synth eth device 
(CYGVAR_DEVS_ETH_ECOSYNTH_ETH1) in your configuration. Please make sure 
that you have two synth eth devices configured and report back if it 
still does not work.

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-22  7:28 ` Simon Kallweit
@ 2009-09-23 11:12   ` Mandeep Sandhu
  2009-09-23 12:48     ` Simon Kallweit
  0 siblings, 1 reply; 9+ messages in thread
From: Mandeep Sandhu @ 2009-09-23 11:12 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-discuss

On Tue, Sep 22, 2009 at 12:58 PM, Simon Kallweit
<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>
>> Hi All,
>>
>> I've been running my application with Simon's recent port of lwIP
>> (1.3.1) with ecos with the linux synthetic target.
>>
>> Things have been running fine with the app only using 1 net i/f, i.e
>> et0. et0 maps to my linux tap device.
>>
>> synth_device ethernet {
>>   eth0 ethertap tap0
>> }
>>
>> Now I need to use a second interface. So 'et1' will map to the real
>> eth0 on my PC. For this I modified my tdf file as such:
>>
>> synth_device ethernet {
>>   eth0 ethertap tap0
>>   eth1 real eth0
>> }
>>
>> In the lwIP config, I've enabled "eth1".
>>
>> However, in the app a call to cyg_lwip_sequential_init() only
>> initializes et0 and I don't see any init for et1. I've tried using
>> both, a static as well as DHCP IP addr for it. But that does not help.
>>
>> Has anybody used to 2 interfaces with the recent port of lwIP? Is
>> there anything else that I need to do, either in configuration or in
>> my app?
>
> I have not really tested with multiple interfaces myself. But it seems to me
> that you did not enable the second synth eth device
> (CYGVAR_DEVS_ETH_ECOSYNTH_ETH1) in your configuration. Please make sure that
> you have two synth eth devices configured and report back if it still does
> not work.

You're right Simon. Enabling the second interface there made things
work (to some extent).

However, I'm facing a new problem now.

Previously I was using only a single interface (the Linux tap0
device). I have implemented a DHCP server which was working fine until
I enabled the SECOND INTERFACE.

Now, my socket writes on the first interface (the tap0 interface) have
started failing! That is, without changing _any_ code! :( The return
value of sendto is coming as '-1' and the error string is set to 'No
error'. Actually this problem starts even if I don't enable support
for eth1 in the lwIP config. Just enabling the second interface under
"Common ethernet support -> Synthetic target ethernet driver" causes
this problem to surface.

Any clues as to what could be going wrong?

I've tried using the second interface with static IP as well as DHCP.
There's no issues here. DHCP client also works fine and configures
this interface with the right IP addr.

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 11:12   ` Mandeep Sandhu
@ 2009-09-23 12:48     ` Simon Kallweit
  2009-09-23 13:04       ` Mandeep Sandhu
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Kallweit @ 2009-09-23 12:48 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Mandeep Sandhu wrote:
> You're right Simon. Enabling the second interface there made things
> work (to some extent).
> 
> However, I'm facing a new problem now.
> 
> Previously I was using only a single interface (the Linux tap0
> device). I have implemented a DHCP server which was working fine until
> I enabled the SECOND INTERFACE.
> 
> Now, my socket writes on the first interface (the tap0 interface) have
> started failing! That is, without changing _any_ code! :( The return
> value of sendto is coming as '-1' and the error string is set to 'No
> error'. Actually this problem starts even if I don't enable support
> for eth1 in the lwIP config. Just enabling the second interface under
> "Common ethernet support -> Synthetic target ethernet driver" causes
> this problem to surface.
> 
> Any clues as to what could be going wrong?

Well, this could be a problem because the default netif was set 
incorrectly. Only one netif can be the default netif. Currently the last 
initialized ethernet device would be set as default (incorrectly). I 
have changed that in the new version, also added 'Default netif' for 
loopif and slipif devices and also expanded configurability of ethernet 
netifs to 4 devices (previously 2). Now, only the selected netif should 
be the default netif. Please test with the new version and see if that 
helps:

http://download.westlicht.ch/lwip-20090923.tar.gz

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 12:48     ` Simon Kallweit
@ 2009-09-23 13:04       ` Mandeep Sandhu
  2009-09-23 13:10         ` Simon Kallweit
  0 siblings, 1 reply; 9+ messages in thread
From: Mandeep Sandhu @ 2009-09-23 13:04 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-discuss

On Wed, Sep 23, 2009 at 6:18 PM, Simon Kallweit
<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>
>> You're right Simon. Enabling the second interface there made things
>> work (to some extent).
>>
>> However, I'm facing a new problem now.
>>
>> Previously I was using only a single interface (the Linux tap0
>> device). I have implemented a DHCP server which was working fine until
>> I enabled the SECOND INTERFACE.
>>
>> Now, my socket writes on the first interface (the tap0 interface) have
>> started failing! That is, without changing _any_ code! :( The return
>> value of sendto is coming as '-1' and the error string is set to 'No
>> error'. Actually this problem starts even if I don't enable support
>> for eth1 in the lwIP config. Just enabling the second interface under
>> "Common ethernet support -> Synthetic target ethernet driver" causes
>> this problem to surface.
>>
>> Any clues as to what could be going wrong?
>
> Well, this could be a problem because the default netif was set incorrectly.
> Only one netif can be the default netif. Currently the last initialized
> ethernet device would be set as default (incorrectly). I have changed that
> in the new version, also added 'Default netif' for loopif and slipif devices
> and also expanded configurability of ethernet netifs to 4 devices
> (previously 2). Now, only the selected netif should be the default netif.
> Please test with the new version and see if that helps:

Exactly my conclusion too!

In eth_drv_init() we are setting the netif as default without checking
conf->def!

I observed another thing while debugging this issue. Even though my
Default interface is set to eth0, the option CYGDAT_LWIP_ETH0_DEFAULT
in the .ecc file is still not set! I'm using "configtool" to change my
config. Is this a GUI tool issue?

I'll test out the new release and let you know.

Thanks as always.

Regards,
-mandeep

>
> http://download.westlicht.ch/lwip-20090923.tar.gz
>
> 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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 13:04       ` Mandeep Sandhu
@ 2009-09-23 13:10         ` Simon Kallweit
  2009-09-23 13:21           ` Mandeep Sandhu
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Kallweit @ 2009-09-23 13:10 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Mandeep Sandhu wrote:
> I observed another thing while debugging this issue. Even though my
> Default interface is set to eth0, the option CYGDAT_LWIP_ETH0_DEFAULT
> in the .ecc file is still not set! I'm using "configtool" to change my
> config. Is this a GUI tool issue?

Well, it is not set, but the default value for eth0 is '1' so it does 
not need to be overwritten by a user value. When creating the tree you 
will notice the proper #define in include/pkgconf/net_lwip.h:

#define CYGPKG_LWIP_ETH0_CONF 1

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 13:10         ` Simon Kallweit
@ 2009-09-23 13:21           ` Mandeep Sandhu
  2009-09-23 13:29             ` Simon Kallweit
  0 siblings, 1 reply; 9+ messages in thread
From: Mandeep Sandhu @ 2009-09-23 13:21 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-discuss

On Wed, Sep 23, 2009 at 6:40 PM, Simon Kallweit
<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>
>> I observed another thing while debugging this issue. Even though my
>> Default interface is set to eth0, the option CYGDAT_LWIP_ETH0_DEFAULT
>> in the .ecc file is still not set! I'm using "configtool" to change my
>> config. Is this a GUI tool issue?
>
> Well, it is not set, but the default value for eth0 is '1' so it does not
> need to be overwritten by a user value. When creating the tree you will
> notice the proper #define in include/pkgconf/net_lwip.h:
>
> #define CYGPKG_LWIP_ETH0_CONF 1

Oh! ok thanks.

One small thing. I think the check you added in eth_drv_init() should be

if (conf && conf->def)
        netif_set_default(netif);

Because the value of "conf->def" is set to 1 if it is the default interface.

HTH,
-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
>
>

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 13:21           ` Mandeep Sandhu
@ 2009-09-23 13:29             ` Simon Kallweit
  2009-09-23 13:50               ` Mandeep Sandhu
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Kallweit @ 2009-09-23 13:29 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Mandeep Sandhu wrote:
> On Wed, Sep 23, 2009 at 6:40 PM, Simon Kallweit
> <simon.kallweit@intefo.ch> wrote:
>> Mandeep Sandhu wrote:
>>> I observed another thing while debugging this issue. Even though my
>>> Default interface is set to eth0, the option CYGDAT_LWIP_ETH0_DEFAULT
>>> in the .ecc file is still not set! I'm using "configtool" to change my
>>> config. Is this a GUI tool issue?
>> Well, it is not set, but the default value for eth0 is '1' so it does not
>> need to be overwritten by a user value. When creating the tree you will
>> notice the proper #define in include/pkgconf/net_lwip.h:
>>
>> #define CYGPKG_LWIP_ETH0_CONF 1
> 
> Oh! ok thanks.
> 
> One small thing. I think the check you added in eth_drv_init() should be
> 
> if (conf && conf->def)
>         netif_set_default(netif);

Absolutely. Dumb copy'paste mistake. I'll fix it in and redo the 
download archive.

Any success with the new version?

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

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

* Re: [ECOS] ecos with lwip and 2 interfaces
  2009-09-23 13:29             ` Simon Kallweit
@ 2009-09-23 13:50               ` Mandeep Sandhu
  0 siblings, 0 replies; 9+ messages in thread
From: Mandeep Sandhu @ 2009-09-23 13:50 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-discuss

On Wed, Sep 23, 2009 at 6:59 PM, Simon Kallweit
<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>
>> On Wed, Sep 23, 2009 at 6:40 PM, Simon Kallweit
>> <simon.kallweit@intefo.ch> wrote:
>>>
>>> Mandeep Sandhu wrote:
>>>>
>>>> I observed another thing while debugging this issue. Even though my
>>>> Default interface is set to eth0, the option CYGDAT_LWIP_ETH0_DEFAULT
>>>> in the .ecc file is still not set! I'm using "configtool" to change my
>>>> config. Is this a GUI tool issue?
>>>
>>> Well, it is not set, but the default value for eth0 is '1' so it does not
>>> need to be overwritten by a user value. When creating the tree you will
>>> notice the proper #define in include/pkgconf/net_lwip.h:
>>>
>>> #define CYGPKG_LWIP_ETH0_CONF 1
>>
>> Oh! ok thanks.
>>
>> One small thing. I think the check you added in eth_drv_init() should be
>>
>> if (conf && conf->def)
>>        netif_set_default(netif);
>
> Absolutely. Dumb copy'paste mistake. I'll fix it in and redo the download
> archive.
>
> Any success with the new version?

Yup! Working fine till now. Still running more tests. Will post back
if I see anything out of the ordinary!

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

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

end of thread, other threads:[~2009-09-23 13:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 14:05 [ECOS] ecos with lwip and 2 interfaces Mandeep Sandhu
2009-09-22  7:28 ` Simon Kallweit
2009-09-23 11:12   ` Mandeep Sandhu
2009-09-23 12:48     ` Simon Kallweit
2009-09-23 13:04       ` Mandeep Sandhu
2009-09-23 13:10         ` Simon Kallweit
2009-09-23 13:21           ` Mandeep Sandhu
2009-09-23 13:29             ` Simon Kallweit
2009-09-23 13:50               ` Mandeep Sandhu

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).