This patch adds netmap support for ixgbe SRIOV virtual functions (that
is, to if_ixv).
The existing ixgbe_netmap.h code had to be modified to handle the
minor differences between if_ix and if_ixv:
- ixgbe_netmap_reg now invokes the stop and init routines supplied by the adapter context. Two new members, init_locked() and stop_locked() were added to the adapter context to provide for this.
- hardware ring head and tail pointer updates must target different registers depending on whether the adapter is a VF or PF. The existing rxr->tail and txr->tail tail pointer register indexes already hide this detail and are used. The transmit head pointer write target is selected based on IXGBE_IS_VF().
- ixgbe_netmap_attach() is no longer static so it can be accessed by if_ixv.c.
- CRC stripping can only be configured in the PF and not on a per-VF basis, so set_crcstrip() is not invoked for VFs. This implementation accommodates arbitrary CRC stripping configuration in the PF by having the VFs assume CRC stripping is never enabled. If in fact CRC stripping is enabled in the PF, the reported packet lengths in the VF will be four bytes longer. As CRC stripping is only ever disabled in netmap mode as a performance optimization (there is no consumer of that information), reporting a length that includes a CRC when the CRC data is not present is not believed to be harmful.
This patch requires (and includes) the relocated receive tail pointer
initialization under review in D2922.
Depends on D2922.