When working on enhancements to the simple transmit routine, I noticed that iflib is not reporting back output drops & errors due to full tx rings or other misc. errors. This change:
- Fixes an mbuf leak with iflib.simple_tx=1 by freeing the mbuf chain in iflib_encap(). Note that seems odd, but iflib_encap() can consume mbufs for other errors, so it seemed simplest to just have it always consume the mbuf than try to untangle the error handling and conditionally free mbufs in iflib_simple_transmit(). This fixes an mbuf leak that would happen with the iflib.simple_tx=1 and output drops/errors.
Note that I don't understand the normal tx routine fully, and I can't tell by inspection if it also leaks, so I have left it alone (except for reporting the drop).
- Increments counters for output drops when ENOBUFS is encountered, and output errors when other transmit errors are encountered for both the simple and normal tx routines
- Augments iflib_if_get_counter() by adding iflib's observed IFCOUNTER_OQDROPS & IFCOUNTER_OERRORS to whatever the underlying driver reports. The underlying driver can't see these drops, so it makes sense to get these counters from the iflib / ifnet level. This was done as a switch in case there are similar counters to add that I'm forgetting