cannot establish connection if vj.c is optimized with -O2 option

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

cannot establish connection if vj.c is optimized with -O2 option

Artem Moroz
Hi, all!

I have a problem with lwip 2.0.3. I am switching on optimization of whole
project to gcc -O2 option and I am getting into connection problem (cannot
establish socket connection over PPPoS). When I turn off the optimization
for vj.c only (use -Og) or when I disable VJ (#define VJ_SUPPORT 0), the
problem disappears.

What may be the problem?

Artem



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

wilkxt
Hi
Propably you have some delay time in connection function, when you
turn on optimization, this run faster

śr., 11 gru 2019 o 17:36 mav <[hidden email]> napisał(a):

>
> Hi, all!
>
> I have a problem with lwip 2.0.3. I am switching on optimization of whole
> project to gcc -O2 option and I am getting into connection problem (cannot
> establish socket connection over PPPoS). When I turn off the optimization
> for vj.c only (use -Og) or when I disable VJ (#define VJ_SUPPORT 0), the
> problem disappears.
>
> What may be the problem?
>
> Artem
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/lwip-users



--
pozdrawiam
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Johan Borkhuis
Something you could try is to pinpoint what is causing the problem by
disabling optimizations per function in this file. This would give you a
better view of what might be causing the issue, and where you might have
to add some extra delay.

Regards,
Johan

On 2019-12-12 07:51, tomek wilkxt wrote:

> Hi
> Propably you have some delay time in connection function, when you
> turn on optimization, this run faster
>
> śr., 11 gru 2019 o 17:36 mav <[hidden email]> napisał(a):
>>
>> Hi, all!
>>
>> I have a problem with lwip 2.0.3. I am switching on optimization of
>> whole
>> project to gcc -O2 option and I am getting into connection problem
>> (cannot
>> establish socket connection over PPPoS). When I turn off the
>> optimization
>> for vj.c only (use -Og) or when I disable VJ (#define VJ_SUPPORT 0),
>> the
>> problem disappears.
>>
>> What may be the problem?
>>
>> Artem
>>
>>
>>
>> --
>> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>>
>> _______________________________________________
>> lwip-users mailing list
>> [hidden email]
>> https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Sylvain Rochet
In reply to this post by wilkxt
Hi Artem,

śr., 11 gru 2019 o 17:36 mav <[hidden email]> napisał(a):
>  Hi, all!
>
>  I have a problem with lwip 2.0.3. I am switching on optimization of
>  whole project to gcc -O2 option and I am getting into connection
>  problem (cannot establish socket connection over PPPoS). When I turn
>  off the optimization for vj.c only (use -Og) or when I disable VJ
>  (#define VJ_SUPPORT 0), the problem disappears.
>
>  What may be the problem?

I know it does not work with -O2, the VJ code is crap.

Why do you need VJ for ? It is useless with cellular modems, it is
useless in PPPoE and PPPoL2TP, AFAIK the last user was dial-up modems,
are they still used in the wild ?

I was mostly planning at disabling it by default and setting it broken
instead of trying to fix it. It actually never really worked, I fixed
some issues to make it works a little a couple of years ago but there
are still issues.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Artem Moroz
Hi, everybody. Maybe this is some type conversion issue, because vj.c throws
many type conversion warnings, if latter enabled. As Sylvain recommends I
would disable VJ for my project for good! Thank you for your answers.



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Sylvain Rochet
Hi,

On Thu, Dec 12, 2019 at 10:04:19AM -0700, mav wrote:
> Hi, everybody. Maybe this is some type conversion issue, because vj.c throws
> many type conversion warnings, if latter enabled. As Sylvain recommends I
> would disable VJ for my project for good! Thank you for your answers.

I also asked why do you need VJ in order to decide whether I should bury
it in non-working features or to try to fix it once for all. So, I'm
asking it again:

Why do you need VJ for ? It is useless with cellular modems, it is
useless in PPPoE and PPPoL2TP, AFAIK the last user was dial-up modems,
are they still used in the wild ?

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Artem Moroz
Hi!

I am using lwip for communicating with 4G modem and with custom terminal
device. The device is rather slow and I thought using VJ will increase
communicating speed, but seems it does not give any advantage. I found
another way to achieve decent response speed with the device (no TCP
delay). Everything is working perfectly without VJ now!

Artem



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

Zachar Papkov
Increase heap size DMA for DMARxDscrTab and DMATxDscrTab

On Sun, Dec 15, 2019, 19:27 mav <[hidden email]> wrote:
Hi!

I am using lwip for communicating with 4G modem and with custom terminal
device. The device is rather slow and I thought using VJ will increase
communicating speed, but seems it does not give any advantage. I found
another way to achieve decent response speed with the device (no TCP
delay). Everything is working perfectly without VJ now!

Artem



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: cannot establish connection if vj.c is optimized with -O2 option

David Brown-4
In reply to this post by Sylvain Rochet
On 13/12/2019 22:39, Sylvain Rochet wrote:

> Hi,
>
> On Thu, Dec 12, 2019 at 10:04:19AM -0700, mav wrote:
>> Hi, everybody. Maybe this is some type conversion issue, because vj.c throws
>> many type conversion warnings, if latter enabled. As Sylvain recommends I
>> would disable VJ for my project for good! Thank you for your answers.
>
> I also asked why do you need VJ in order to decide whether I should bury
> it in non-working features or to try to fix it once for all. So, I'm
> asking it again:
>
> Why do you need VJ for ? It is useless with cellular modems, it is
> useless in PPPoE and PPPoL2TP, AFAIK the last user was dial-up modems,
> are they still used in the wild ?
>

If you suspect type aliasing problems, then you might add this quick and
dirty workaround to the top of the relevant C files:

#ifdef __GNUC__
#pragma GCC optimize "-fno-strict-aliasing"
#endif


Obviously the ideal answer is to fix the code, but that might not be
practical or worth the effort.  This kind of forced compiler option is a
reasonable compromise, because it makes the code safe regardless of the
compiler options picked by the programmer and the build system
(assuming, of course, you have #ifdef's covering the relevant compilers).

You can even do:

#ifdef __GNUC__
#pragma GCC optimize "-O1"
#endif

to avoid -O2 optimisations.


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users