CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2018/01/05 20:11:04
Modified files: sys/dev/pci : if_msk.c if_mskvar.h Log message: rework the transmit and receive paths to address reliability issues. phessler@ has been having trouble with msk on overdrive 1000s. some of the issues relate to the driver not coping with exhaustion of mbufs for the rx ring, the other issues are corruption of the mcl9k pool that msk uses. this diff adds a timeout that the rx refill code uses when the rx ring is empty and cannot be filled. it'll periodically retry the ring refill until it can get some mbufs in the air again. the current code made hunting for the mcl9k issue too hard, so this rewrites it to be simpler and more like other drivers. there's now just arrays of mbuf pointers and dmamaps to shadow the hardware ring entries, and producer and consumer indexes. what was there before had linkes lists of something to hold mbuf pointers and dmamaps, and some way to go from the ring to go back to that. i think, it was hard to tell what was happening. this also copies the ADDR64 handling on the tx ring to the rx ring. this potentially makes more rx descriptors available, but that can happen later. in hindsight the mcl9k problem could have been from letting if_rxr allocate the entier ring. if every descriptor was filled, the chip may have run around the ring when it shouldnt have. giving rxr one less descriptor than there is on the ring may have fixed the problem too. this work also makes it easier to make msk mpsafe. tested by an ok phessler@ ok kettenis@ deraadt@