Re: [lwip-users] upgrade from 1.4.1 to 2.0.3

2018-03-08 Thread Sylvain Rochet
Hi Mattia,

On Thu, Mar 08, 2018 at 04:39:03PM +0100, Mattia Settin wrote:
> Hi
> Thanks
> Buh how is possible that: with an operative system sys_timeouts_mbox_fetch 
> call
> sys_check_timeouts() which is the handle timeouts for NO_SYS==1.
> Is the comment of sys_check_timeouts()  wrong ?

Well, I agree the comment could be improved for clarity. When we fixed 
timers for NO_SYS==0 systems sys_check_timeouts was actually set 
static[1] so it wasn't possible to mistakenly call this function. Looks 
like it was changed when mbox handling moved to another file, therefore 
clearing the static modifier.

Sylvain


[1] 
http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/timers.c?id=6adeb706a699da10f2841eea3671546407ec413a#n293


signature.asc
Description: Digital signature
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] upgrade from 1.4.1 to 2.0.3

2018-03-08 Thread Mattia Settin
Hi
Thanks
Buh how is possible that: with an operative system sys_timeouts_mbox_fetch call
sys_check_timeouts() which is the handle timeouts for NO_SYS==1.
Is the comment of sys_check_timeouts()  wrong ?



On Thu, Mar 8, 2018 at 4:24 PM, Sylvain Rochet 
wrote:

> Hi Mattia,
>
> On Thu, Mar 08, 2018 at 09:14:33AM +0100, Mattia Settin wrote:
> > Yes, but sys_now is required even for timeouts for NO_SYS==0
> (LWIP_TIMERS =
> > 1). It this correct ?
>
> This is correct, sys_now() is now necessary for all systems, furthermore
> it should be bound, at best, to a monotonic clock source.
>
> Sylvain
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Mattia Settin
Software and System Engineer
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] upgrade from 1.4.1 to 2.0.3

2018-03-08 Thread Sylvain Rochet
Hi Mattia,

On Thu, Mar 08, 2018 at 09:14:33AM +0100, Mattia Settin wrote:
> Yes, but sys_now is required even for timeouts for NO_SYS==0 (LWIP_TIMERS =
> 1). It this correct ?

This is correct, sys_now() is now necessary for all systems, furthermore 
it should be bound, at best, to a monotonic clock source.

Sylvain


signature.asc
Description: Digital signature
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Support of two Ethernet connections

2018-03-08 Thread Simon Goldschmidt
simeon.trifo...@amk-drives.bg wrote:
> Now I need to understand how the LWIP is designed to be used in case
> of two (or more) Ethernet adapters. It is clear that I need to use
> two separated netif structure for each adapter. What I’m wandering
> now is how to connect to it the initialized udp_pcb and tcp_pcb (they
> are different for both interfaces). How I can connect the pcbs to the
> netif-structures?

That depends on the network configuration. In a standard setup, the
two netifs are connected to different subnets and by binding the pcb
to the netif's IP address, you talk to the correct subnet.

However, you can also bind to device (SO_BINDTODEVICE for socket API
or udp_bind_netif/tcp_bind_netif for callback API). But that needs
a git master version newer than 2.0.3.

Simon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Support of two Ethernet connections

2018-03-08 Thread Yacob Hassidim
Hello Simeon,

 

Thanks for your fast response.

 

Yacob Hassidim

 

From: lwip-users  On 
Behalf Of simeon.trifo...@amk-drives.bg
Sent: Thursday, March 8, 2018 2:35 PM
To: 'Mailing list for lwIP users' 
Subject: Re: [lwip-users] Support of two Ethernet connections

 

Hi Yacob,

 

I mean two MACs and two Phys. Actually one Phy is an Ethernet and the second is 
an Ethernet over VARAN (but for the stack it must look like a normal Ethernet 
Phy). 

 

Simeon

 

From: lwip-users  > On 
Behalf Of Yacob Hassidim
Sent: Thursday, March 08, 2018 2:30 PM
To: 'Mailing list for lwIP users'  >
Subject: Re: [lwip-users] Support of two Ethernet connections

 

Hello Simeon,

 

I am not going to answer but ask a question about your system.

 

By Ethernet adaptor what do you mean?

a.  Two MAC and two Phys or
b.  One MAC and two Phys

 

Sincerely,

 

Yacob Hassidim.

 

From: lwip-users  > On Behalf Of 
simeon.trifo...@amk-drives.bg  
Sent: Thursday, March 8, 2018 2:01 PM
To: lwip-users@nongnu.org  
Subject: [lwip-users] Support of two Ethernet connections

 

Hi,

In my application I’m going to support two Ethernet adapters. I already have an 
implementation with only one, so I already have an experience with LWIP stack. 
Now I need to understand how the LWIP is designed to be used in case of two (or 
more) Ethernet adapters. It is clear that I need to use two separated netif 
structure for each adapter. What I’m wandering now is how to connect to it the 
initialized udp_pcb and tcp_pcb (they are different for both interfaces). How I 
can connect the pcbs to the netif-structures? If I cannot access the pcbs from 
netif-structure, then I need to add them like additional parameters to some 
functions… Sorry for this question, but I by reading in Internet I couldn’t 
find a good explanation how LWIP must be used in such case. So please, give me 
some hints…

 

Best regards!

 

Simeon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Support of two Ethernet connections

2018-03-08 Thread simeon.trifonov
Hi Yacob,

 

I mean two MACs and two Phys. Actually one Phy is an Ethernet and the second is 
an Ethernet over VARAN (but for the stack it must look like a normal Ethernet 
Phy). 

 

Simeon

 

From: lwip-users  
On Behalf Of Yacob Hassidim
Sent: Thursday, March 08, 2018 2:30 PM
To: 'Mailing list for lwIP users' 
Subject: Re: [lwip-users] Support of two Ethernet connections

 

Hello Simeon,

 

I am not going to answer but ask a question about your system.

 

By Ethernet adaptor what do you mean?

a.  Two MAC and two Phys or
b.  One MAC and two Phys

 

Sincerely,

 

Yacob Hassidim.

 

From: lwip-users  > On Behalf Of 
simeon.trifo...@amk-drives.bg  
Sent: Thursday, March 8, 2018 2:01 PM
To: lwip-users@nongnu.org  
Subject: [lwip-users] Support of two Ethernet connections

 

Hi,

In my application I’m going to support two Ethernet adapters. I already have an 
implementation with only one, so I already have an experience with LWIP stack. 
Now I need to understand how the LWIP is designed to be used in case of two (or 
more) Ethernet adapters. It is clear that I need to use two separated netif 
structure for each adapter. What I’m wandering now is how to connect to it the 
initialized udp_pcb and tcp_pcb (they are different for both interfaces). How I 
can connect the pcbs to the netif-structures? If I cannot access the pcbs from 
netif-structure, then I need to add them like additional parameters to some 
functions… Sorry for this question, but I by reading in Internet I couldn’t 
find a good explanation how LWIP must be used in such case. So please, give me 
some hints…

 

Best regards!

 

Simeon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] Support of two Ethernet connections

2018-03-08 Thread Yacob Hassidim
Hello Simeon,

 

I am not going to answer but ask a question about your system.

 

By Ethernet adaptor what do you mean?

a.  Two MAC and two Phys or
b.  One MAC and two Phys

 

Sincerely,

 

Yacob Hassidim.

 

From: lwip-users  On 
Behalf Of simeon.trifo...@amk-drives.bg
Sent: Thursday, March 8, 2018 2:01 PM
To: lwip-users@nongnu.org
Subject: [lwip-users] Support of two Ethernet connections

 

Hi,

In my application I’m going to support two Ethernet adapters. I already have an 
implementation with only one, so I already have an experience with LWIP stack. 
Now I need to understand how the LWIP is designed to be used in case of two (or 
more) Ethernet adapters. It is clear that I need to use two separated netif 
structure for each adapter. What I’m wandering now is how to connect to it the 
initialized udp_pcb and tcp_pcb (they are different for both interfaces). How I 
can connect the pcbs to the netif-structures? If I cannot access the pcbs from 
netif-structure, then I need to add them like additional parameters to some 
functions… Sorry for this question, but I by reading in Internet I couldn’t 
find a good explanation how LWIP must be used in such case. So please, give me 
some hints…

 

Best regards!

 

Simeon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] Support of two Ethernet connections

2018-03-08 Thread simeon.trifonov
Hi,

In my application I’m going to support two Ethernet adapters. I already have an 
implementation with only one, so I already have an experience with LWIP stack. 
Now I need to understand how the LWIP is designed to be used in case of two (or 
more) Ethernet adapters. It is clear that I need to use two separated netif 
structure for each adapter. What I’m wandering now is how to connect to it the 
initialized udp_pcb and tcp_pcb (they are different for both interfaces). How I 
can connect the pcbs to the netif-structures? If I cannot access the pcbs from 
netif-structure, then I need to add them like additional parameters to some 
functions… Sorry for this question, but I by reading in Internet I couldn’t 
find a good explanation how LWIP must be used in such case. So please, give me 
some hints…

 

Best regards!

 

Simeon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] upgrade from 1.4.1 to 2.0.3

2018-03-08 Thread Mattia Settin
In addition I don't really get why
with NO_SYS = 0 (with FreeRTOS) sys_timeouts_mbox_fetch call
sys_check_timeouts() which is the handle timeouts for NO_SYS==1 (without OS)
Probably I have an too old port file for FreeRTOS.
Regards
m

On Thu, Mar 8, 2018 at 9:14 AM, Mattia Settin 
wrote:

> Yes, but sys_now is required even for timeouts for NO_SYS==0 (LWIP_TIMERS
> = 1). It this correct ?
>
> On Wed, Mar 7, 2018 at 8:02 PM, goldsi...@gmx.de  wrote:
>
>> On 07.03.2018 17:40, Mattia Settin wrote:
>>
>>> [..]
>>> The question is:
>>> It is now mandatory define/use sys_now() ?
>>>
>>
>> You can do without, but a number of features new to 2.0.x (or improved
>> there) require it. Right now, the list is:
>> - timeouts for NO_SYS==1
>> - LWIP_SO_SNDTIMEO
>> - LWIP_SO_LINGER
>> - lwiperf app
>> - LWIP_TCP_TIMESTAMPS
>> - PPPoS
>>
>> This list can grow longer in the future. As such, we can't ifdef out the
>> prototype for these configs and it's always there. You can try without and
>> you'll get a linker error once you enable code which actually uses it.
>>
>> Simon
>>
>> ___
>> lwip-users mailing list
>> lwip-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>
>
>
> --
> Mattia Settin
> Software and System Engineer
>
>
>


-- 
Mattia Settin
Software and System Engineer
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] upgrade from 1.4.1 to 2.0.3

2018-03-08 Thread Mattia Settin
Yes, but sys_now is required even for timeouts for NO_SYS==0 (LWIP_TIMERS =
1). It this correct ?

On Wed, Mar 7, 2018 at 8:02 PM, goldsi...@gmx.de  wrote:

> On 07.03.2018 17:40, Mattia Settin wrote:
>
>> [..]
>> The question is:
>> It is now mandatory define/use sys_now() ?
>>
>
> You can do without, but a number of features new to 2.0.x (or improved
> there) require it. Right now, the list is:
> - timeouts for NO_SYS==1
> - LWIP_SO_SNDTIMEO
> - LWIP_SO_LINGER
> - lwiperf app
> - LWIP_TCP_TIMESTAMPS
> - PPPoS
>
> This list can grow longer in the future. As such, we can't ifdef out the
> prototype for these configs and it's always there. You can try without and
> you'll get a linker error once you enable code which actually uses it.
>
> Simon
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
Mattia Settin
Software and System Engineer
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users