- Use jumbo buffers only when MTU > 1518 bytes.
o In sk_dma_alloc(), allocate additional DMA stuffs for normal mbuf cluster
to use.
o In sk_init(), set sk_if_softc.sk_use_jumbo if ifnet.if_mtu > 1518. This
should only be done after sk_stop(), so sk_stop() will not free wrong RX
buffers. Add a comment about it.
o Don't touch jumbo buffer related bits in hardware registers, if jumbo
buffer is not used currently.
o Rename old sk_newbuf() to sk_newbuf_jumbo().
o Implement sk_newbuf_std(), which allocates RX buffer using mbuf clusters.
o Add a wrapper function, sk_newbuf(), to switch between above two functions
based on whether sk_if_softc.sk_use_jumbo is set or not.
- If something fail in sk_rxeof(), don't call sk_newbuf() with old mbuf:
Hardware will not change RX descriptor's buffer address part. Only
controlling bits of the RX descriptor need to be set up properly.
Nuke third parameter (i.e. mbuf) of sk_newbuf() after this change and
rearrange sk_newbuf_jumbo() accordingly.
- Since sk_chain and TX/RX descriptor use same index, nuke unnecessary
sk_chain.sk_desc field, which points to a corresponding TX/RX descriptor.
Pass the TX/RX descriptor index to sk_newbuf() instead of sk_chain pointer.
Nuke never used sk_chain.sk_next field. These changes degenarate sk_chain
into a mbuf pointer, so nuke no longer needed sk_chain structure.
Tested-by: Rumko <rumcic@gmail.com> and Gergo Szakal <bastyaelvtars@gmail.com>
Partially-reviewed-by: dillon@