driver - device drivers
In preparation for #15300, there are a number of improvements that should happen with the vmxnet3 driver:
- On RX, it always loans out the DMA mapped buffers, regardless of size. As with most other NIC drivers, it would be useful to copy inbound packets when they are below a certain size (as well as if we are running low on DMA mapped buffers). Like other NIC drivers, this threshold should be controllable via private
- On TX, it always binds the outbound mblk_t. As with RX, it should be able to copy smaller segments into pre-bound buffers. Additionally, the current driver uses a single
ddi_dma_handle_tto bind multiple mblk_ts at a time (e.g. it can potentially call
ddi_dma_addr_bind_handle(9F)multiple times without interim calls to
ddi_dma_unbind_handle(9F). As far as I can tell, this is 100% wrong, but works by mostly by accident.
- Pre allocated DMA buffers should be capped at
PAGESIZE(e.g. 4k) to prevent potentially extreme blocking during
ddi_dma_mem_alloc(9F)when allocating RX buffers (we've seen calls block on the order of minutes) with jumbo frames (due to kernel memory fragmentation).
- The vmxnet3 'hardware' supports LRO. It's fairly trivial to wire up support, so we should go ahead and do it (controllable via dladm).
- Structure the code to make it simpler to add the multi-ring support as mentioned in #15300 .