linux/drivers/net/ethernet/intel/igc
Paolo Abeni 40ee363c84 igc: fix tunnel offloading
Checking tunnel offloading, it turns out that offloading doesn't work
as expected.  The following script allows to reproduce the issue.
Call it as `testscript DEVICE LOCALIP REMOTEIP NETMASK'

=== SNIP ===
if [ $# -ne 4 ]
then
  echo "Usage $0 DEVICE LOCALIP REMOTEIP NETMASK"
  exit 1
fi
DEVICE="$1"
LOCAL_ADDRESS="$2"
REMOTE_ADDRESS="$3"
NWMASK="$4"
echo "Driver: $(ethtool -i ${DEVICE} | awk '/^driver:/{print $2}') "
ethtool -k "${DEVICE}" | grep tx-udp
echo
echo "Set up NIC and tunnel..."
ip addr add "${LOCAL_ADDRESS}/${NWMASK}" dev "${DEVICE}"
ip link set "${DEVICE}" up
sleep 2
ip link add vxlan1 type vxlan id 42 \
		   remote "${REMOTE_ADDRESS}" \
		   local "${LOCAL_ADDRESS}" \
		   dstport 0 \
		   dev "${DEVICE}"
ip addr add fc00::1/64 dev vxlan1
ip link set vxlan1 up
sleep 2
rm -f vxlan.pcap
echo "Running tcpdump and iperf3..."
( nohup tcpdump -i any -w vxlan.pcap >/dev/null 2>&1 ) &
sleep 2
iperf3 -c fc00::2 >/dev/null
pkill tcpdump
echo
echo -n "Max. Paket Size: "
tcpdump -r vxlan.pcap -nnle 2>/dev/null \
| grep "${LOCAL_ADDRESS}.*> ${REMOTE_ADDRESS}.*OTV" \
| awk '{print $8}' | awk -F ':' '{print $1}' \
| sort -n | tail -1
echo
ip link del vxlan1
ip addr del ${LOCAL_ADDRESS}/${NWMASK} dev "${DEVICE}"
=== SNAP ===

The expected outcome is

  Max. Paket Size: 64904

This is what you see on igb, the code igc has been taken from.
However, on igc the output is

  Max. Paket Size: 1516

so the GSO aggregate packets are segmented by the kernel before calling
igc_xmit_frame.  Inside the subsequent call to igc_tso, the check for
skb_is_gso(skb) fails and the function returns prematurely.

It turns out that this occurs because the feature flags aren't set
entirely correctly in igc_probe.  In contrast to the original code
from igb_probe, igc_probe neglects to set the flags required to allow
tunnel offloading.

Setting the same flags as igb fixes the issue on igc.

Fixes: 34428dff36 ("igc: Add GSO partial support")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Tested-by: Corinna Vinschen <vinschen@redhat.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Nechama Kraus <nechamax.kraus@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-16 14:29:58 +01:00
..
igc_base.c igc: Remove _I_PHY_ID checking 2021-07-20 16:11:36 -07:00
igc_base.h igc: Enable TX via AF_XDP zero-copy 2021-05-20 10:21:42 -07:00
igc_defines.h igc: Add support for CBS offloading 2021-08-27 09:31:09 -07:00
igc_diag.c igc: add support to eeprom, registers and link self-tests 2020-05-18 15:06:28 -07:00
igc_diag.h igc: add support to eeprom, registers and link self-tests 2020-05-18 15:06:28 -07:00
igc_dump.c igb/igc: use strongly typed pointer 2021-05-26 09:11:41 -07:00
igc_ethtool.c ethtool: extend coalesce setting uAPI with CQE mode 2021-08-24 07:38:29 -07:00
igc_hw.h igc: Clean up nvm_operations structure 2021-02-03 15:20:32 -08:00
igc_i225.c igc: Fix overwrites return value 2021-04-16 13:15:45 -07:00
igc_i225.h igc: Add initial LTR support 2020-06-29 18:21:09 -07:00
igc_mac.c igc: check return value of ret_val in igc_config_fc_after_link_up 2021-02-01 10:04:43 -08:00
igc_mac.h igc: remove IGC_REMOVED function 2020-05-19 15:01:48 -07:00
igc_main.c igc: fix tunnel offloading 2021-09-16 14:29:58 +01:00
igc_nvm.c igc: Add NVM support 2018-10-17 13:52:00 -07:00
igc_nvm.h igc: Add NVM support 2018-10-17 13:52:00 -07:00
igc_phy.c igc: Remove _I_PHY_ID checking 2021-07-20 16:11:36 -07:00
igc_phy.h igc: Expose the gPHY firmware version 2021-02-03 15:20:32 -08:00
igc_ptp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-26 17:57:57 -07:00
igc_regs.h igc: Add support for CBS offloading 2021-08-27 09:31:09 -07:00
igc_tsn.c igc: Add support for CBS offloading 2021-08-27 09:31:09 -07:00
igc_tsn.h igc: Simplify TSN flags handling 2021-08-27 09:31:08 -07:00
igc_xdp.c igc: Enable TX via AF_XDP zero-copy 2021-05-20 10:21:42 -07:00
igc_xdp.h igc: Enable RX via AF_XDP zero-copy 2021-05-20 10:21:42 -07:00
igc.h igc: Add support for CBS offloading 2021-08-27 09:31:09 -07:00
Makefile igc: Add initial XDP support 2021-03-29 09:09:53 -07:00