This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ETH - fix problem with scatter-gather list


On Wed, 2002-08-14 at 01:41, Andrew Lunn wrote:
> > @@ -782,10 +789,13 @@ eth_drv_recv(struct eth_drv_sc *sc, int 
> >      struct ifnet *ifp = &sc->sc_arpcom.ac_if;
> >      struct ether_header _eh, *eh=&_eh;
> >      struct mbuf *top, **mp, *m;
> >      int mlen;
> >      unsigned char *data;
> > +#if MAX_ETH_DRV_SG > 64
> > +    static  // Avoid large stack requirements
> > +#endif
> >      struct eth_drv_sg sg_list[MAX_ETH_DRV_SG];
> >      int sg_len;
> >  
> >      if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING) {
> >          return;  // Interface not up, ignore this request
> 
> Hi Gary.
> 
> I sore this and imeadiately thought "Is this multi-thread safe?"
> 
> The best answer i can think of it no/yes. No the code is not
> multi-thread safe, but all the ethernet driver code is executed from
> only one thread, so does not have to be multi-thread safe.
> 
> Do i have this right?

A reasonable inquiry!  I'm pretty sure that it's safe as there
are locks/serializations within the network stack itself.

I only added this because I wanted to at least label the possibility
of large stack requirements.  I don't think anything larger than 32
(the new default) would ever be needed.  My tests yesterday showed
a max size of 21, this on matched 100Mb interfaces.

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]