On Wednesday 08 April 2015 09:48:14, David Gwynne wrote: > >> + continue; > >> + } > > > > > > > > Other drivers don't dequeue mbufs in out of mem situations. I > > think you should just set IFF_OACTIVE and break out of the for > > loop (not shown in the diff). The old code just does the break, > > but I think setting IFF_OACTIVE would be correct here. > > OACTIVE means the tx ring is full. it (generally) gets cleared by a > driver when the tx ring is emptied. > > if the tx ring is empty but we set it when the system runs out of > resources (ie, memory shortages, dma mappings, iommu slot > exhaustion, solar flares, etc), then there's no event to clear > OACTIVE with. if we cant map the mbuf we should drop it and move > on.
Sounds reasonable but many drivers (e.g. em, ix, bge) don't do that but set OACTIVE in this case. Is there a reason for that? From a casual glance at the source it is not clear to me that they have some other way to recover. Some have a watchdog that will reset the device after some time.
