Sys_timeouts

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

Sys_timeouts

Bilahari Akkiraju-3

Hello all, thank you for answers to my queries. I still don't get the complete idea of sys_timeouts. The documentation says it's a linked list of structures per thread that is used by lwip timeout scheduler. Where and with what should I populate this linked list.

     One more thing I don't understand is why is sys_arch_mbox_fetch there but not sys_arch_mbox_post ?.

I am  running on a bare platform and I have my own working OS services ( scheduler, semaphores, message queues) and I feel that I should have my own sys.c, ie my own API layer so that I need not worry about timeouts. Is sys.c the api layer you were talking about when you said "if you have your own API layer, you can ignore timeouts". ?

Thanks
Bilahari

-----Original Message-----
From: lwip-users-bounces+bilahaak=[hidden email] [mailto:lwip-users-bounces+bilahaak=[hidden email]] On Behalf Of [hidden email]
Sent: Wednesday, May 23, 2007 2:33 AM
To: [hidden email]
Subject: lwip-users Digest, Vol 45, Issue 26

Send lwip-users mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.nongnu.org/mailman/listinfo/lwip-users
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific than "Re: Contents of lwip-users digest..."


Today's Topics:

   1. RE: Example port for a beginner (Goldschmidt Simon)
   2. RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
      (Kieran Mansley)
   3. RE: Example port for a beginner (Goldschmidt Simon)
   4. RE : [lwip-users] Example port for a beginner (Fr?d?ric BERNON)
   5. RE: RE : [lwip-users] Example port for a beginner
      (Goldschmidt Simon)
   6. RE: RE : [lwip-users] Example port for a beginner (Kieran Mansley)
   7. RE : tcp ack problem (Fr?d?ric BERNON)


----------------------------------------------------------------------

Message: 1
Date: Wed, 23 May 2007 09:48:55 +0200
From: "Goldschmidt Simon" <[hidden email]>
Subject: RE: [lwip-users] Example port for a beginner
To: "Mailing list for lwIP users" <[hidden email]>
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

> 2. Can I port lwip stack without implementing sys_arch.c at all. I
mean without impelementing semaphore and mailbox funcs.

For that you have to set NO_SYS to 1 in lwipopts.h but you can only use the callback API then (no sockets, no netconn API). You also don't need the sys_arch.h and sys_arch.c file (if you take other ports as an example).

> 3 . Should I change or add some stuff in sys.c like in sys_arch.c.

You should not need to change sys.c! sys_arch.c is dependent on your OS.


Simon




------------------------------

Message: 2
Date: Wed, 23 May 2007 09:04:39 +0100
From: Kieran Mansley <[hidden email]>
Subject: RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
To: Mailing list for lwIP users <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain

On Wed, 2007-05-23 at 08:19 +0200, Matthias Weisser wrote:

> >>>> that there is room at the front for the necessary headers.  I
> >>>> suppose if your ethernet driver was being very efficient and had
> >>>> stripped off the ethernet header before creating the pbuf, this
> >>>> might not be the case.  Can you show how you're
> >>>
> >>> Yes, that's what I am doing.
> >>>
> >> In that case it's technically the fault of lwIP and we should
> >> perhaps change our ICMP to not do this (or at least check the pbuf
> >> to see if it's OK before it does).  If you'd rather not work around
> >> it, please file a bug so that it will eventually get fixed.
> >
> > Yes, please file a bug report!
>
> About what? That ip_input fails if the IP header is not 4 byte
> aligned? Or that etharp_output fails if there is no room at the
> beginning of a p_buf to store the ethernet header?

That ICMP assumes the pbuf you give it has space for a ethernet header at the front.

Kieran





------------------------------

Message: 3
Date: Wed, 23 May 2007 10:46:45 +0200
From: "Goldschmidt Simon" <[hidden email]>
Subject: RE: [lwip-users] Example port for a beginner
To: "Mailing list for lwIP users" <[hidden email]>
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="us-ascii"

> 4    Yes sys_timeouts  is pretty confusing but if you implement your
own api layer then you can ignore it all together

That's not exactly true: if NO_SYS=0, you
a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a pointer to a list of timeouts that is unique for the current thread
B) have to make sure the value returned by sys_arch_mbox_wait() (and
sys_arch_sem_wait()) is correct (the number of miliseconds waited for a message)!

If you want to know more about timeouts: it is a linked list including function pointers and values of miliseconds to wait before calling the function. When waiting for a message in an mbox, the time waited is substracted from the first timeout, and if that time is 0, the timeout function is called and the first item is popped off the list.
This mechanism only works if NO_SYS=0 since otherwise, you don't have mboxes. But if you have mboxes, you kind of get the timeout functionality for free.
The downside of this approach is that the timing is pretty inaccurate.
If you have many messages in the mbox and you will not have to wait on any message, sys_arch_mbox_wait() will always return 0 since it didn't have to wait for the message. That way timeouts will not be called.
Another bad example are some ports that always return 1 when waiting for a message and 0 if a message was available right away. That of course leads to totally inaccurate timeouts.


Simon




------------------------------

Message: 4
Date: Wed, 23 May 2007 10:56:05 +0200
From: Fr?d?ric BERNON <[hidden email]>
Subject: RE : [lwip-users] Example port for a beginner
To: "Mailing list for lwIP users" <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

>That's not exactly true...
I suppose that Mumtaz talk to a "full" api layer, even without api_msg.c & tcpip.c, so, I think in this case, it''s right

>If you want to know more about timeouts:  
It's a good explain, I think it will be good to copy/paste it in sys_arch.txt and sys.c...
 
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : [hidden email]
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : lwip-users-bounces+frederic.bernon=[hidden email] [mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part de Goldschmidt Simon Envoyé : mercredi 23 mai 2007 10:47 À : Mailing list for lwIP users Objet : RE: [lwip-users] Example port for a beginner


> 4    Yes sys_timeouts  is pretty confusing but if you implement your
own api layer then you can ignore it all together

That's not exactly true: if NO_SYS=0, you
a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a pointer to a list of timeouts that is unique for the current thread
B) have to make sure the value returned by sys_arch_mbox_wait() (and
sys_arch_sem_wait()) is correct (the number of miliseconds waited for a message)!

If you want to know more about timeouts: it is a linked list including function pointers and values of miliseconds to wait before calling the function. When waiting for a message in an mbox, the time waited is substracted from the first timeout, and if that time is 0, the timeout function is called and the first item is popped off the list. This mechanism only works if NO_SYS=0 since otherwise, you don't have mboxes. But if you have mboxes, you kind of get the timeout functionality for free. The downside of this approach is that the timing is pretty inaccurate. If you have many messages in the mbox and you will not have to wait on any message, sys_arch_mbox_wait() will always return 0 since it didn't have to wait for the message. That way timeouts will not be called. Another bad example are some ports that always return 1 when waiting for a message and 0 if a message was available right away. That of course leads to totally inaccurate timeouts.


Simon


_______________________________________________
lwip-users mailing list
[hidden email] http://lists.nongnu.org/mailman/listinfo/lwip-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
Type: text/x-vcard
Size: 589 bytes
Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
Url : http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/0dd0299d/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

------------------------------

Message: 5
Date: Wed, 23 May 2007 11:12:58 +0200
From: "Goldschmidt Simon" <[hidden email]>
Subject: RE: RE : [lwip-users] Example port for a beginner
To: "Mailing list for lwIP users" <[hidden email]>
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="us-ascii"


> >That's not exactly true...
> I suppose that Mumtaz talk to a "full" api layer, even without
> api_msg.c & tcpip.c, so, I think in this case, it''s right

That's what I meant with "if NO_SYS=0". But you're right, maybe for a beginner, that's not as clear as I wanted it to be...

>
> >If you want to know more about timeouts:  
> It's a good explain, I think it will be good to copy/paste it in
> sys_arch.txt and sys.c...

In that way, we finally get some documentation done ;-)




------------------------------

Message: 6
Date: Wed, 23 May 2007 10:27:09 +0100
From: Kieran Mansley <[hidden email]>
Subject: RE: RE : [lwip-users] Example port for a beginner
To: Mailing list for lwIP users <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain

On Wed, 2007-05-23 at 11:12 +0200, Goldschmidt Simon wrote:
> > >If you want to know more about timeouts:  
> > It's a good explain, I think it will be good to copy/paste it in
> > sys_arch.txt and sys.c...
>
> In that way, we finally get some documentation done ;-)

Yes please - there have been a number of good explanations recently (particularly from Simon) that I've thought would make good beginnings of documentation.  I suggest that for now we create something in CVS (if there's no relevant place already) so that you can easily copy and past these things in when writing such stuff to the mailing list.  This will be much easier than trying to find them later when writing docs!

Kieran





------------------------------

Message: 7
Date: Wed, 23 May 2007 11:32:27 +0200
From: Fr?d?ric BERNON <[hidden email]>
Subject: [lwip-users] RE : tcp ack problem
To: "cui_hengbin98" <[hidden email]>, "Mailing list for lwIP
        users" <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="iso-8859-1"

Skipped content of type multipart/related-------------- next part -------------- A non-text attachment was scrubbed...
Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
Type: text/x-vcard
Size: 589 bytes
Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
Url : http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/c82c0e43/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

------------------------------

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

End of lwip-users Digest, Vol 45, Issue 26
******************************************


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

Re: Sys_timeouts

Mumtaz Ahmad
Hi
lwIP provides two Application Program's Interfaces (APIs) the sequential API
(BSD style) and the raw TCP/IP interface.
If you are trying to use the sequential API then you need to implement the
OS abstraction layer which is more or less sys_arch.c
However one can implement his own Sequential API using raw TCP/IP interface
.Using raw TCP/IP interface is very simple
http://www.sics.se/~adam/lwip/doc/rawapi.txt

Though it takes time to make your own Sequential API layer but it gives you
choice to make a robust interface depending on your needs and requirements.
I dont know but its my feeling that current sequential interface is a bit
slow ,i may be wrong . By implementing my own layer i have achieved more
than 40Mbps full duplex communication with windows and linux servers on a
100 Mbps Lan . I dont know whats the best figures with sequential API.
Using just the lwip core and implementing my own infrastructure around it is
helping me to play around with the stack quite comfortably.

Best Regards
Mumtaz Ahmad



----- Original Message -----
From: "Bilahari Akkiraju" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, May 24, 2007 6:57 AM
Subject: [lwip-users] Sys_timeouts


>
> Hello all, thank you for answers to my queries. I still don't get the
complete idea of sys_timeouts. The documentation says it's a linked list of
structures per thread that is used by lwip timeout scheduler. Where and with
what should I populate this linked list.
>
>      One more thing I don't understand is why is sys_arch_mbox_fetch there
but not sys_arch_mbox_post ?.
>
> I am  running on a bare platform and I have my own working OS services (
scheduler, semaphores, message queues) and I feel that I should have my own
sys.c, ie my own API layer so that I need not worry about timeouts. Is sys.c
the api layer you were talking about when you said "if you have your own API
layer, you can ignore timeouts". ?
>
> Thanks
> Bilahari
>
> -----Original Message-----
> From: lwip-users-bounces+bilahaak=[hidden email]
[mailto:lwip-users-bounces+bilahaak=[hidden email]] On Behalf Of
[hidden email]

> Sent: Wednesday, May 23, 2007 2:33 AM
> To: [hidden email]
> Subject: lwip-users Digest, Vol 45, Issue 26
>
> Send lwip-users mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.nongnu.org/mailman/listinfo/lwip-users
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific than
"Re: Contents of lwip-users digest..."

>
>
> Today's Topics:
>
>    1. RE: Example port for a beginner (Goldschmidt Simon)
>    2. RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
>       (Kieran Mansley)
>    3. RE: Example port for a beginner (Goldschmidt Simon)
>    4. RE : [lwip-users] Example port for a beginner (Fr?d?ric BERNON)
>    5. RE: RE : [lwip-users] Example port for a beginner
>       (Goldschmidt Simon)
>    6. RE: RE : [lwip-users] Example port for a beginner (Kieran Mansley)
>    7. RE : tcp ack problem (Fr?d?ric BERNON)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 May 2007 09:48:55 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 2. Can I port lwip stack without implementing sys_arch.c at all. I
> mean without impelementing semaphore and mailbox funcs.
>
> For that you have to set NO_SYS to 1 in lwipopts.h but you can only use
the callback API then (no sockets, no netconn API). You also don't need the
sys_arch.h and sys_arch.c file (if you take other ports as an example).

>
> > 3 . Should I change or add some stuff in sys.c like in sys_arch.c.
>
> You should not need to change sys.c! sys_arch.c is dependent on your OS.
>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 23 May 2007 09:04:39 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 08:19 +0200, Matthias Weisser wrote:
> > >>>> that there is room at the front for the necessary headers.  I
> > >>>> suppose if your ethernet driver was being very efficient and had
> > >>>> stripped off the ethernet header before creating the pbuf, this
> > >>>> might not be the case.  Can you show how you're
> > >>>
> > >>> Yes, that's what I am doing.
> > >>>
> > >> In that case it's technically the fault of lwIP and we should
> > >> perhaps change our ICMP to not do this (or at least check the pbuf
> > >> to see if it's OK before it does).  If you'd rather not work around
> > >> it, please file a bug so that it will eventually get fixed.
> > >
> > > Yes, please file a bug report!
> >
> > About what? That ip_input fails if the IP header is not 4 byte
> > aligned? Or that etharp_output fails if there is no room at the
> > beginning of a p_buf to store the ethernet header?
>
> That ICMP assumes the pbuf you give it has space for a ethernet header at
the front.

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 23 May 2007 10:46:45 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the
function. When waiting for a message in an mbox, the time waited is
substracted from the first timeout, and if that time is 0, the timeout
function is called and the first item is popped off the list.
> This mechanism only works if NO_SYS=0 since otherwise, you don't have
mboxes. But if you have mboxes, you kind of get the timeout functionality
for free.
> The downside of this approach is that the timing is pretty inaccurate.
> If you have many messages in the mbox and you will not have to wait on any
message, sys_arch_mbox_wait() will always return 0 since it didn't have to
wait for the message. That way timeouts will not be called.
> Another bad example are some ports that always return 1 when waiting for a
message and 0 if a message was available right away. That of course leads to
totally inaccurate timeouts.

>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 23 May 2007 10:56:05 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> >That's not exactly true...
> I suppose that Mumtaz talk to a "full" api layer, even without api_msg.c &
tcpip.c, so, I think in this case, it''s right
>
> >If you want to know more about timeouts:
> It's a good explain, I think it will be good to copy/paste it in
sys_arch.txt and sys.c...

>
> ====================================
> Frédéric BERNON
> HYMATOM SA
> Chef de projet informatique
> Microsoft Certified Professional
> Tél. : +33 (0)4-67-87-61-10
> Fax. : +33 (0)4-67-70-85-44
> Email : [hidden email]
> Web Site : http://www.hymatom.fr
> ====================================
> P Avant d'imprimer, penser à l'environnement
>
>
>
> -----Message d'origine-----
> De : lwip-users-bounces+frederic.bernon=[hidden email]
[mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part
de Goldschmidt Simon Envoyé : mercredi 23 mai 2007 10:47 À : Mailing list
for lwIP users Objet : RE: [lwip-users] Example port for a beginner
>
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the
function. When waiting for a message in an mbox, the time waited is
substracted from the first timeout, and if that time is 0, the timeout
function is called and the first item is popped off the list. This mechanism
only works if NO_SYS=0 since otherwise, you don't have mboxes. But if you
have mboxes, you kind of get the timeout functionality for free. The
downside of this approach is that the timing is pretty inaccurate. If you
have many messages in the mbox and you will not have to wait on any message,
sys_arch_mbox_wait() will always return 0 since it didn't have to wait for
the message. That way timeouts will not be called. Another bad example are
some ports that always return 1 when waiting for a message and 0 if a
message was available right away. That of course leads to totally inaccurate
timeouts.

>
>
> Simon
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email] http://lists.nongnu.org/mailman/listinfo/lwip-users
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/0dd0299d/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> Message: 5
> Date: Wed, 23 May 2007 11:12:58 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
>
> > >That's not exactly true...
> > I suppose that Mumtaz talk to a "full" api layer, even without
> > api_msg.c & tcpip.c, so, I think in this case, it''s right
>
> That's what I meant with "if NO_SYS=0". But you're right, maybe for a
beginner, that's not as clear as I wanted it to be...

>
> >
> > >If you want to know more about timeouts:
> > It's a good explain, I think it will be good to copy/paste it in
> > sys_arch.txt and sys.c...
>
> In that way, we finally get some documentation done ;-)
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Wed, 23 May 2007 10:27:09 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 11:12 +0200, Goldschmidt Simon wrote:
> > > >If you want to know more about timeouts:
> > > It's a good explain, I think it will be good to copy/paste it in
> > > sys_arch.txt and sys.c...
> >
> > In that way, we finally get some documentation done ;-)
>
> Yes please - there have been a number of good explanations recently
(particularly from Simon) that I've thought would make good beginnings of
documentation.  I suggest that for now we create something in CVS (if
there's no relevant place already) so that you can easily copy and past
these things in when writing such stuff to the mailing list.  This will be
much easier than trying to find them later when writing docs!

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 23 May 2007 11:32:27 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: [lwip-users] RE : tcp ack problem
> To: "cui_hengbin98" <[hidden email]>, "Mailing list for lwIP
> users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/related-------------- next
part -------------- A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/c82c0e43/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
> End of lwip-users Digest, Vol 45, Issue 26
> ******************************************
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users



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

RE: Sys_timeouts

Goldschmidt Simon

> Though it takes time to make your own Sequential API layer
> but it gives you choice to make a robust interface depending
> on your needs and requirements.
> I dont know but its my feeling that current sequential
> interface is a bit slow ,i may be wrong . By implementing my
> own layer i have achieved more than 40Mbps full duplex
> communication with windows and linux servers on a 100 Mbps

Hm, that's interesting! What kind of API did you implement?
A socket-like API? And do you have any idea how fast your
platform is with the lwip-socket API?


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

RE: Sys_timeouts

Goldschmidt Simon
In reply to this post by Bilahari Akkiraju-3

> Hello all, thank you for answers to my queries. I still don't
> get the complete idea of sys_timeouts. The documentation says
> it's a linked list of structures per thread that is used by
> lwip timeout scheduler. Where and with what should I populate
> this linked list.

If you use lwIP's socket API you don't have to (in fact, you
mustn't) populate the list! The lwip core thread (tcpip_thread)
uses sys_timeout() to populate the list and eventually, it will
get emptied while waiting for a message from an mbox (in the
tcpip_thread() loop).

>
>      One more thing I don't understand is why is
> sys_arch_mbox_fetch there but not sys_arch_mbox_post ?.

The names are a little confusing: sys_arch_mbox_fetch is the
correspnding function to sys_mbox_post. But since sys_mbox_fetch
processes the timeout list (and calls sys_arch_mbox_fetch),
you can also directly call sys_arch_mbox_fetch if you don't want
to use timeouts.

>
> I am  running on a bare platform and I have my own working OS
> services ( scheduler, semaphores, message queues) and I feel
> that I should have my own sys.c, ie my own API layer so that
> I need not worry about timeouts. Is sys.c the api layer you

3 cases:
- you only want raw (callback) API which is very fast, then
you don't need an API layer
- you can use the api layer provided with lwip (e.g. the files
under api/*) then you need to implement the sys_arch.c file
(see msvc6 port for a reference)
- the api provided with lwip is not 'good enough' for you, then
you have to implement your own api. You don't have to touch sys.c
for that!

> were talking about when you said "if you have your own API
> layer, you can ignore timeouts". ?

I think no, but I can't talk for Mumtaz.

Simon


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

RE : Sys_timeouts

Frédéric BERNON
In reply to this post by Bilahari Akkiraju-3
Hi Mumtaz,

It's interesting for me. Can you tell me if your measures are on a NXP platform? Pnx1500, pnx1700? Other thing?

You talk about "Mbps full duplex communication". What kind of protocols do you use? Something on TCP, UDP (some RTP/UDP?)
 
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : [hidden email]
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : lwip-users-bounces+frederic.bernon=[hidden email] [mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part de Mumtaz Ahmad
Envoyé : jeudi 24 mai 2007 06:37
À : Mailing list for lwIP users
Objet : Re: [lwip-users] Sys_timeouts


Hi
lwIP provides two Application Program's Interfaces (APIs) the sequential API (BSD style) and the raw TCP/IP interface. If you are trying to use the sequential API then you need to implement the OS abstraction layer which is more or less sys_arch.c However one can implement his own Sequential API using raw TCP/IP interface .Using raw TCP/IP interface is very simple http://www.sics.se/~adam/lwip/doc/rawapi.txt

Though it takes time to make your own Sequential API layer but it gives you choice to make a robust interface depending on your needs and requirements. I dont know but its my feeling that current sequential interface is a bit slow ,i may be wrong . By implementing my own layer i have achieved more than 40Mbps full duplex communication with windows and linux servers on a 100 Mbps Lan . I dont know whats the best figures with sequential API. Using just the lwip core and implementing my own infrastructure around it is helping me to play around with the stack quite comfortably.

Best Regards
Mumtaz Ahmad



----- Original Message -----
From: "Bilahari Akkiraju" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, May 24, 2007 6:57 AM
Subject: [lwip-users] Sys_timeouts


>
> Hello all, thank you for answers to my queries. I still don't get the
complete idea of sys_timeouts. The documentation says it's a linked list of structures per thread that is used by lwip timeout scheduler. Where and with what should I populate this linked list.
>
>      One more thing I don't understand is why is sys_arch_mbox_fetch
> there
but not sys_arch_mbox_post ?.
>
> I am  running on a bare platform and I have my own working OS services
> (
scheduler, semaphores, message queues) and I feel that I should have my own sys.c, ie my own API layer so that I need not worry about timeouts. Is sys.c the api layer you were talking about when you said "if you have your own API layer, you can ignore timeouts". ?
>
> Thanks
> Bilahari
>
> -----Original Message-----
> From: lwip-users-bounces+bilahaak=[hidden email]
[mailto:lwip-users-bounces+bilahaak=[hidden email]] On Behalf Of [hidden email]

> Sent: Wednesday, May 23, 2007 2:33 AM
> To: [hidden email]
> Subject: lwip-users Digest, Vol 45, Issue 26
>
> Send lwip-users mailing list submissions to [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.nongnu.org/mailman/listinfo/lwip-users
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than
"Re: Contents of lwip-users digest..."

>
>
> Today's Topics:
>
>    1. RE: Example port for a beginner (Goldschmidt Simon)
>    2. RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
>       (Kieran Mansley)
>    3. RE: Example port for a beginner (Goldschmidt Simon)
>    4. RE : [lwip-users] Example port for a beginner (Fr?d?ric BERNON)
>    5. RE: RE : [lwip-users] Example port for a beginner
>       (Goldschmidt Simon)
>    6. RE: RE : [lwip-users] Example port for a beginner (Kieran Mansley)
>    7. RE : tcp ack problem (Fr?d?ric BERNON)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 May 2007 09:48:55 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 2. Can I port lwip stack without implementing sys_arch.c at all. I
> mean without impelementing semaphore and mailbox funcs.
>
> For that you have to set NO_SYS to 1 in lwipopts.h but you can only
> use
the callback API then (no sockets, no netconn API). You also don't need the sys_arch.h and sys_arch.c file (if you take other ports as an example).

>
> > 3 . Should I change or add some stuff in sys.c like in sys_arch.c.
>
> You should not need to change sys.c! sys_arch.c is dependent on your
> OS.
>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 23 May 2007 09:04:39 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 08:19 +0200, Matthias Weisser wrote:
> > >>>> that there is room at the front for the necessary headers.  I
> > >>>> suppose if your ethernet driver was being very efficient and
> > >>>> had stripped off the ethernet header before creating the pbuf,
> > >>>> this might not be the case.  Can you show how you're
> > >>>
> > >>> Yes, that's what I am doing.
> > >>>
> > >> In that case it's technically the fault of lwIP and we should
> > >> perhaps change our ICMP to not do this (or at least check the
> > >> pbuf to see if it's OK before it does).  If you'd rather not work
> > >> around it, please file a bug so that it will eventually get
> > >> fixed.
> > >
> > > Yes, please file a bug report!
> >
> > About what? That ip_input fails if the IP header is not 4 byte
> > aligned? Or that etharp_output fails if there is no room at the
> > beginning of a p_buf to store the ethernet header?
>
> That ICMP assumes the pbuf you give it has space for a ethernet header
> at
the front.

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 23 May 2007 10:46:45 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns
> a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for
> a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the function. When waiting for a message in an mbox, the time waited is substracted from the first timeout, and if that time is 0, the timeout function is called and the first item is popped off the list.
> This mechanism only works if NO_SYS=0 since otherwise, you don't have
mboxes. But if you have mboxes, you kind of get the timeout functionality for free.
> The downside of this approach is that the timing is pretty inaccurate.
> If you have many messages in the mbox and you will not have to wait on
> any
message, sys_arch_mbox_wait() will always return 0 since it didn't have to wait for the message. That way timeouts will not be called.
> Another bad example are some ports that always return 1 when waiting
> for a
message and 0 if a message was available right away. That of course leads to totally inaccurate timeouts.

>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 23 May 2007 10:56:05 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> >That's not exactly true...
> I suppose that Mumtaz talk to a "full" api layer, even without
> api_msg.c &
tcpip.c, so, I think in this case, it''s right
>
> >If you want to know more about timeouts:
> It's a good explain, I think it will be good to copy/paste it in
sys_arch.txt and sys.c...

>
> ====================================
> Frédéric BERNON
> HYMATOM SA
> Chef de projet informatique
> Microsoft Certified Professional
> Tél. : +33 (0)4-67-87-61-10
> Fax. : +33 (0)4-67-70-85-44
> Email : [hidden email]
> Web Site : http://www.hymatom.fr ====================================
> P Avant d'imprimer, penser à l'environnement
>
>
>
> -----Message d'origine-----
> De : lwip-users-bounces+frederic.bernon=[hidden email]
[mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part
de Goldschmidt Simon Envoyé : mercredi 23 mai 2007 10:47 À : Mailing list
for lwIP users Objet : RE: [lwip-users] Example port for a beginner
>
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the
function. When waiting for a message in an mbox, the time waited is
substracted from the first timeout, and if that time is 0, the timeout
function is called and the first item is popped off the list. This mechanism
only works if NO_SYS=0 since otherwise, you don't have mboxes. But if you
have mboxes, you kind of get the timeout functionality for free. The
downside of this approach is that the timing is pretty inaccurate. If you
have many messages in the mbox and you will not have to wait on any message,
sys_arch_mbox_wait() will always return 0 since it didn't have to wait for
the message. That way timeouts will not be called. Another bad example are
some ports that always return 1 when waiting for a message and 0 if a
message was available right away. That of course leads to totally inaccurate
timeouts.

>
>
> Simon
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email] http://lists.nongnu.org/mailman/listinfo/lwip-users
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/0dd0299d/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> Message: 5
> Date: Wed, 23 May 2007 11:12:58 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
>
> > >That's not exactly true...
> > I suppose that Mumtaz talk to a "full" api layer, even without
> > api_msg.c & tcpip.c, so, I think in this case, it''s right
>
> That's what I meant with "if NO_SYS=0". But you're right, maybe for a
beginner, that's not as clear as I wanted it to be...

>
> >
> > >If you want to know more about timeouts:
> > It's a good explain, I think it will be good to copy/paste it in
> > sys_arch.txt and sys.c...
>
> In that way, we finally get some documentation done ;-)
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Wed, 23 May 2007 10:27:09 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 11:12 +0200, Goldschmidt Simon wrote:
> > > >If you want to know more about timeouts:
> > > It's a good explain, I think it will be good to copy/paste it in
> > > sys_arch.txt and sys.c...
> >
> > In that way, we finally get some documentation done ;-)
>
> Yes please - there have been a number of good explanations recently
(particularly from Simon) that I've thought would make good beginnings of
documentation.  I suggest that for now we create something in CVS (if
there's no relevant place already) so that you can easily copy and past
these things in when writing such stuff to the mailing list.  This will be
much easier than trying to find them later when writing docs!

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 23 May 2007 11:32:27 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: [lwip-users] RE : tcp ack problem
> To: "cui_hengbin98" <[hidden email]>, "Mailing list for lwIP
> users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/related-------------- next
part -------------- A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/c82c0e43/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
> End of lwip-users Digest, Vol 45, Issue 26
> ******************************************
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users


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

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

=?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?= (810 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sys_timeouts

Mumtaz Ahmad
In reply to this post by Goldschmidt Simon
Its bsd style socket api .Instead of comparing the current implementation
with mine in terms of speed i would like them to be compared interms of
simplicity.
I think the current lwip bsd api layer is complex. But thats my thinking and
i may be wrong . The crux is that by implementing my own layer i have got
more control and faith in lwip core .

----- Original Message -----
From: "Goldschmidt Simon" <[hidden email]>
To: "Mailing list for lwIP users" <[hidden email]>
Sent: Thursday, May 24, 2007 11:40 AM
Subject: RE: [lwip-users] Sys_timeouts


>
> > Though it takes time to make your own Sequential API layer
> > but it gives you choice to make a robust interface depending
> > on your needs and requirements.
> > I dont know but its my feeling that current sequential
> > interface is a bit slow ,i may be wrong . By implementing my
> > own layer i have achieved more than 40Mbps full duplex
> > communication with windows and linux servers on a 100 Mbps
>
> Hm, that's interesting! What kind of API did you implement?
> A socket-like API? And do you have any idea how fast your
> platform is with the lwip-socket API?
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users



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

Re: Sys_timeouts

Mumtaz Ahmad
In reply to this post by Frédéric BERNON
Yes its on Pnx1500 as well as on Pnx1700 . These figures of 40 Mbps are
related with my file transfer tests .But yes i have done simultaneous mpeg
recording and playback at around 8 Mbps on TCP sockets

----- Original Message -----
From: "Frédéric BERNON" <[hidden email]>
To: "Mailing list for lwIP users" <[hidden email]>
Sent: Thursday, May 24, 2007 11:50 AM
Subject: RE : [lwip-users] Sys_timeouts


Hi Mumtaz,

It's interesting for me. Can you tell me if your measures are on a NXP
platform? Pnx1500, pnx1700? Other thing?

You talk about "Mbps full duplex communication". What kind of protocols do
you use? Something on TCP, UDP (some RTP/UDP?)

====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : [hidden email]
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement



-----Message d'origine-----
De : lwip-users-bounces+frederic.bernon=[hidden email]
[mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part
de Mumtaz Ahmad
Envoyé : jeudi 24 mai 2007 06:37
À : Mailing list for lwIP users
Objet : Re: [lwip-users] Sys_timeouts


Hi
lwIP provides two Application Program's Interfaces (APIs) the sequential API
(BSD style) and the raw TCP/IP interface. If you are trying to use the
sequential API then you need to implement the OS abstraction layer which is
more or less sys_arch.c However one can implement his own Sequential API
using raw TCP/IP interface .Using raw TCP/IP interface is very simple
http://www.sics.se/~adam/lwip/doc/rawapi.txt

Though it takes time to make your own Sequential API layer but it gives you
choice to make a robust interface depending on your needs and requirements.
I dont know but its my feeling that current sequential interface is a bit
slow ,i may be wrong . By implementing my own layer i have achieved more
than 40Mbps full duplex communication with windows and linux servers on a
100 Mbps Lan . I dont know whats the best figures with sequential API. Using
just the lwip core and implementing my own infrastructure around it is
helping me to play around with the stack quite comfortably.

Best Regards
Mumtaz Ahmad



----- Original Message -----
From: "Bilahari Akkiraju" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, May 24, 2007 6:57 AM
Subject: [lwip-users] Sys_timeouts


>
> Hello all, thank you for answers to my queries. I still don't get the
complete idea of sys_timeouts. The documentation says it's a linked list of
structures per thread that is used by lwip timeout scheduler. Where and with
what should I populate this linked list.
>
>      One more thing I don't understand is why is sys_arch_mbox_fetch
> there
but not sys_arch_mbox_post ?.
>
> I am  running on a bare platform and I have my own working OS services
> (
scheduler, semaphores, message queues) and I feel that I should have my own
sys.c, ie my own API layer so that I need not worry about timeouts. Is sys.c
the api layer you were talking about when you said "if you have your own API
layer, you can ignore timeouts". ?
>
> Thanks
> Bilahari
>
> -----Original Message-----
> From: lwip-users-bounces+bilahaak=[hidden email]
[mailto:lwip-users-bounces+bilahaak=[hidden email]] On Behalf Of
[hidden email]

> Sent: Wednesday, May 23, 2007 2:33 AM
> To: [hidden email]
> Subject: lwip-users Digest, Vol 45, Issue 26
>
> Send lwip-users mailing list submissions to [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.nongnu.org/mailman/listinfo/lwip-users
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than
"Re: Contents of lwip-users digest..."

>
>
> Today's Topics:
>
>    1. RE: Example port for a beginner (Goldschmidt Simon)
>    2. RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
>       (Kieran Mansley)
>    3. RE: Example port for a beginner (Goldschmidt Simon)
>    4. RE : [lwip-users] Example port for a beginner (Fr?d?ric BERNON)
>    5. RE: RE : [lwip-users] Example port for a beginner
>       (Goldschmidt Simon)
>    6. RE: RE : [lwip-users] Example port for a beginner (Kieran Mansley)
>    7. RE : tcp ack problem (Fr?d?ric BERNON)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 May 2007 09:48:55 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 2. Can I port lwip stack without implementing sys_arch.c at all. I
> mean without impelementing semaphore and mailbox funcs.
>
> For that you have to set NO_SYS to 1 in lwipopts.h but you can only
> use
the callback API then (no sockets, no netconn API). You also don't need the
sys_arch.h and sys_arch.c file (if you take other ports as an example).

>
> > 3 . Should I change or add some stuff in sys.c like in sys_arch.c.
>
> You should not need to change sys.c! sys_arch.c is dependent on your
> OS.
>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 23 May 2007 09:04:39 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: Antw: RE: [lwip-users] pbuf_header fails in etharp_output
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 08:19 +0200, Matthias Weisser wrote:
> > >>>> that there is room at the front for the necessary headers.  I
> > >>>> suppose if your ethernet driver was being very efficient and
> > >>>> had stripped off the ethernet header before creating the pbuf,
> > >>>> this might not be the case.  Can you show how you're
> > >>>
> > >>> Yes, that's what I am doing.
> > >>>
> > >> In that case it's technically the fault of lwIP and we should
> > >> perhaps change our ICMP to not do this (or at least check the
> > >> pbuf to see if it's OK before it does).  If you'd rather not work
> > >> around it, please file a bug so that it will eventually get
> > >> fixed.
> > >
> > > Yes, please file a bug report!
> >
> > About what? That ip_input fails if the IP header is not 4 byte
> > aligned? Or that etharp_output fails if there is no room at the
> > beginning of a p_buf to store the ethernet header?
>
> That ICMP assumes the pbuf you give it has space for a ethernet header
> at
the front.

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 23 May 2007 10:46:45 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns
> a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for
> a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the
function. When waiting for a message in an mbox, the time waited is
substracted from the first timeout, and if that time is 0, the timeout
function is called and the first item is popped off the list.
> This mechanism only works if NO_SYS=0 since otherwise, you don't have
mboxes. But if you have mboxes, you kind of get the timeout functionality
for free.
> The downside of this approach is that the timing is pretty inaccurate.
> If you have many messages in the mbox and you will not have to wait on
> any
message, sys_arch_mbox_wait() will always return 0 since it didn't have to
wait for the message. That way timeouts will not be called.
> Another bad example are some ports that always return 1 when waiting
> for a
message and 0 if a message was available right away. That of course leads to
totally inaccurate timeouts.

>
>
> Simon
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 23 May 2007 10:56:05 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> >That's not exactly true...
> I suppose that Mumtaz talk to a "full" api layer, even without
> api_msg.c &
tcpip.c, so, I think in this case, it''s right
>
> >If you want to know more about timeouts:
> It's a good explain, I think it will be good to copy/paste it in
sys_arch.txt and sys.c...

>
> ====================================
> Frédéric BERNON
> HYMATOM SA
> Chef de projet informatique
> Microsoft Certified Professional
> Tél. : +33 (0)4-67-87-61-10
> Fax. : +33 (0)4-67-70-85-44
> Email : [hidden email]
> Web Site : http://www.hymatom.fr ====================================
> P Avant d'imprimer, penser à l'environnement
>
>
>
> -----Message d'origine-----
> De : lwip-users-bounces+frederic.bernon=[hidden email]
[mailto:lwip-users-bounces+frederic.bernon=[hidden email]] De la part
de Goldschmidt Simon Envoyé : mercredi 23 mai 2007 10:47 À : Mailing list
for lwIP users Objet : RE: [lwip-users] Example port for a beginner
>
>
> > 4    Yes sys_timeouts  is pretty confusing but if you implement your
> own api layer then you can ignore it all together
>
> That's not exactly true: if NO_SYS=0, you
> a) have to supply a function in sys_arch.c (if NO_SYS=0) that returns a
pointer to a list of timeouts that is unique for the current thread
> B) have to make sure the value returned by sys_arch_mbox_wait() (and
> sys_arch_sem_wait()) is correct (the number of miliseconds waited for a
message)!
>
> If you want to know more about timeouts: it is a linked list including
function pointers and values of miliseconds to wait before calling the
function. When waiting for a message in an mbox, the time waited is
substracted from the first timeout, and if that time is 0, the timeout
function is called and the first item is popped off the list. This mechanism
only works if NO_SYS=0 since otherwise, you don't have mboxes. But if you
have mboxes, you kind of get the timeout functionality for free. The
downside of this approach is that the timing is pretty inaccurate. If you
have many messages in the mbox and you will not have to wait on any message,
sys_arch_mbox_wait() will always return 0 since it didn't have to wait for
the message. That way timeouts will not be called. Another bad example are
some ports that always return 1 when waiting for a message and 0 if a
message was available right away. That of course leads to totally inaccurate
timeouts.

>
>
> Simon
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email] http://lists.nongnu.org/mailman/listinfo/lwip-users
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/0dd0299d/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> Message: 5
> Date: Wed, 23 May 2007 11:12:58 +0200
> From: "Goldschmidt Simon" <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: "Mailing list for lwIP users" <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="us-ascii"
>
>
> > >That's not exactly true...
> > I suppose that Mumtaz talk to a "full" api layer, even without
> > api_msg.c & tcpip.c, so, I think in this case, it''s right
>
> That's what I meant with "if NO_SYS=0". But you're right, maybe for a
beginner, that's not as clear as I wanted it to be...

>
> >
> > >If you want to know more about timeouts:
> > It's a good explain, I think it will be good to copy/paste it in
> > sys_arch.txt and sys.c...
>
> In that way, we finally get some documentation done ;-)
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Wed, 23 May 2007 10:27:09 +0100
> From: Kieran Mansley <[hidden email]>
> Subject: RE: RE : [lwip-users] Example port for a beginner
> To: Mailing list for lwIP users <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain
>
> On Wed, 2007-05-23 at 11:12 +0200, Goldschmidt Simon wrote:
> > > >If you want to know more about timeouts:
> > > It's a good explain, I think it will be good to copy/paste it in
> > > sys_arch.txt and sys.c...
> >
> > In that way, we finally get some documentation done ;-)
>
> Yes please - there have been a number of good explanations recently
(particularly from Simon) that I've thought would make good beginnings of
documentation.  I suggest that for now we create something in CVS (if
there's no relevant place already) so that you can easily copy and past
these things in when writing such stuff to the mailing list.  This will be
much easier than trying to find them later when writing docs!

>
> Kieran
>
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 23 May 2007 11:32:27 +0200
> From: Fr?d?ric BERNON <[hidden email]>
> Subject: [lwip-users] RE : tcp ack problem
> To: "cui_hengbin98" <[hidden email]>, "Mailing list for lwIP
> users" <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/related-------------- next
part -------------- A non-text attachment was scrubbed...
> Name: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Type: text/x-vcard
> Size: 589 bytes
> Desc: =?iso-8859-1?Q?Fr=E9d=E9ric_BERNON=2Evcf?=
> Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070523/c82c0e43/iso-8859-1QFrE9dE9ric_BERNON2Evcf.vcf

>
> ------------------------------
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
> End of lwip-users Digest, Vol 45, Issue 26
> ******************************************
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users



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



----------------------------------------------------------------------------
----


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



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

RE: Sys_timeouts

Goldschmidt Simon
In reply to this post by Mumtaz Ahmad

> Its bsd style socket api .Instead of comparing the current
> implementation with mine in terms of speed i would like them
> to be compared interms of simplicity.
> I think the current lwip bsd api layer is complex. But thats

Me too!

> my thinking and i may be wrong . The crux is that by
> implementing my own layer i have got more control and faith
> in lwip core .

As I said before, I'd like to have a new socket layer, too. One
eliminating the use of the netconn API and maybe protecting the
core to be accesses from multiple threads, too.

Do you have protected the core somehow or do you have a core
thread and message-passing configuration like the tcpip.c API
in lwIP?
Can you share that code or is it closed source?


Simon


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

Re: Sys_timeouts

Mumtaz Ahmad
Well yes i have protected the core just by using mutex and no message
passing .
Since i am porting it in Pnx1500/1700  so i think its closed source .
I would see if i can provide a windows port to the community ,if its of some
use. But for that i need to have well defines OS interfaces as well as
documentation ,till then i dont see it would be helpful .

Best Regards


----- Original Message -----
From: "Goldschmidt Simon" <[hidden email]>
To: "Mailing list for lwIP users" <[hidden email]>
Sent: Thursday, May 24, 2007 12:16 PM
Subject: RE: [lwip-users] Sys_timeouts


>
> > Its bsd style socket api .Instead of comparing the current
> > implementation with mine in terms of speed i would like them
> > to be compared interms of simplicity.
> > I think the current lwip bsd api layer is complex. But thats
>
> Me too!
>
> > my thinking and i may be wrong . The crux is that by
> > implementing my own layer i have got more control and faith
> > in lwip core .
>
> As I said before, I'd like to have a new socket layer, too. One
> eliminating the use of the netconn API and maybe protecting the
> core to be accesses from multiple threads, too.
>
> Do you have protected the core somehow or do you have a core
> thread and message-passing configuration like the tcpip.c API
> in lwIP?
> Can you share that code or is it closed source?
>
>
> Simon
>
>
> _______________________________________________
> lwip-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/lwip-users



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