linux/drivers/net/ethernet/intel/ixgbevf
Samuel Mendoza-Jonas fe68195daf ixgbevf: Require large buffers for build_skb on 82599VF
From 4.17 onwards the ixgbevf driver uses build_skb() to build an skb
around new data in the page buffer shared with the ixgbe PF.
This uses either a 2K or 3K buffer, and offsets the DMA mapping by
NET_SKB_PAD + NET_IP_ALIGN. When using a smaller buffer RXDCTL is set to
ensure the PF does not write a full 2K bytes into the buffer, which is
actually 2K minus the offset.

However on the 82599 virtual function, the RXDCTL mechanism is not
available. The driver attempts to work around this by using the SET_LPE
mailbox method to lower the maximm frame size, but the ixgbe PF driver
ignores this in order to keep the PF and all VFs in sync[0].

This means the PF will write up to the full 2K set in SRRCTL, causing it
to write NET_SKB_PAD + NET_IP_ALIGN bytes past the end of the buffer.
With 4K pages split into two buffers, this means it either writes
NET_SKB_PAD + NET_IP_ALIGN bytes past the first buffer (and into the
second), or NET_SKB_PAD + NET_IP_ALIGN bytes past the end of the DMA
mapping.

Avoid this by only enabling build_skb when using "large" buffers (3K).
These are placed in each half of an order-1 page, preventing the PF from
writing past the end of the mapping.

[0]: Technically it only ever raises the max frame size, see
ixgbe_set_vf_lpe() in ixgbe_sriov.c

Fixes: f15c5ba5b6 ("ixgbevf: add support for using order 1 pages to receive large frames")
Signed-off-by: Samuel Mendoza-Jonas <samjonas@amazon.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-04 10:23:21 +00:00
..
defines.h ixgbevf: Mailbox improvements 2021-11-17 08:07:42 -08:00
ethtool.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
ipsec.c ixgbevf: Add support for new mailbox communication between PF and VF 2021-11-17 08:07:42 -08:00
ipsec.h ixgbevf: add VF IPsec offload code 2018-08-28 14:33:26 -07:00
ixgbevf_main.c ixgbevf: Require large buffers for build_skb on 82599VF 2022-02-04 10:23:21 +00:00
ixgbevf.h ixgbevf: Mailbox improvements 2021-11-17 08:07:42 -08:00
Makefile ixgbe/ixgbevf: fix XFRM_ALGO dependency 2018-10-31 10:53:15 -07:00
mbx.c ixgbevf: Mailbox improvements 2021-11-17 08:07:42 -08:00
mbx.h ixgbevf: Add support for new mailbox communication between PF and VF 2021-11-17 08:07:42 -08:00
regs.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
vf.c ixgbevf: Add support for new mailbox communication between PF and VF 2021-11-17 08:07:42 -08:00
vf.h ixgbevf: Mailbox improvements 2021-11-17 08:07:42 -08:00