linux/drivers/net/ethernet/intel/ice
Anatolii Gerasymenko affa1029d6 ice: Implement FCS/CRC and VLAN stripping co-existence policy
Make sure that only the valid combinations of FCS/CRC stripping and
VLAN stripping offloads are allowed.

You cannot have FCS/CRC stripping disabled while VLAN stripping is
enabled - this breaks the correctness of the FCS/CRC.

If administrator tries to enable VLAN stripping when FCS/CRC stripping is
disabled, the request should be rejected.

If administrator tries to disable FCS/CRC stripping when VLAN stripping
is enabled, the request should be rejected if VLANs are configured. If
there is no VLAN configured, then both FCS/CRC and VLAN stripping should
be disabled.

Testing Hints:
The default settings after driver load are:
- VLAN C-Tag offloads are enabled
- VLAN S-Tag offloads are disabled
- FCS/CRC stripping is enabled

Restore the default settings before each test with the command:
ethtool -K eth0 rx-fcs off rxvlan on txvlan on rx-vlan-stag-hw-parse off
tx-vlan-stag-hw-insert off

Test 1:
Disable FCS/CRC and VLAN stripping:
ethtool -K eth0 rx-fcs on rxvlan off
Try to enable VLAN stripping:
ethtool -K eth0 rxvlan on

Expected: VLAN stripping request is rejected

Test 2:
Try to disable FCS/CRC stripping:
ethtool -K eth0 rx-fcs on

Expected: VLAN stripping is also disabled, as there are no VLAN
configured

Test 3:
Add a VLAN:
ip link add link eth0 eth0.42 type vlan id 42
ip link set eth0 up
Try to disable FCS/CRC stripping:
ethtool -K eth0 rx-fcs on

Expected: FCS/CRC stripping request is rejected

Signed-off-by: Anatolii Gerasymenko <anatolii.gerasymenko@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-08-18 08:08:23 -07:00
..
ice.h ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_adminq_cmd.h ice: add i2c write command 2022-07-21 11:22:45 -07:00
ice_arfs.c ice: arfs: fix use-after-free when freeing @rx_cpu_rmap 2022-04-08 09:08:36 -07:00
ice_arfs.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_base.c ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_base.h
ice_cgu_regs.h
ice_common.c ice: add i2c write command 2022-07-21 11:22:45 -07:00
ice_common.h ice: add i2c write command 2022-07-21 11:22:45 -07:00
ice_controlq.c
ice_controlq.h
ice_dcb.c
ice_dcb.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_dcb_lib.c
ice_dcb_lib.h
ice_dcb_nl.c
ice_dcb_nl.h
ice_devids.h ice: handle E822 generic device ID in PLDM header 2022-07-12 09:25:34 -07:00
ice_devlink.c ice: change devlink code to read NVM in blocks 2022-07-12 09:25:47 -07:00
ice_devlink.h
ice_eswitch.c ice: Introduce enabling promiscuous mode on multiple VF's 2022-07-28 11:44:22 -07:00
ice_eswitch.h ice: allow creating VFs for !CONFIG_NET_SWITCHDEV 2022-04-14 08:19:54 -07:00
ice_ethtool.c ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_ethtool_fdir.c ice: Use correct order for the parameters of devm_kcalloc() 2022-06-08 08:55:13 -07:00
ice_fdir.c
ice_fdir.h
ice_flex_pipe.c ice: Add support for PPPoE hardware offload 2022-07-26 10:56:32 -07:00
ice_flex_pipe.h
ice_flex_type.h
ice_flow.c ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_flow.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_fltr.c ice: Fix broken IFF_ALLMULTI handling 2022-04-01 12:01:38 +01:00
ice_fltr.h
ice_fw_update.c ice: handle E822 generic device ID in PLDM header 2022-07-12 09:25:34 -07:00
ice_fw_update.h
ice_gnss.c ice: add write functionality for GNSS TTY 2022-07-21 13:25:17 -07:00
ice_gnss.h ice: add write functionality for GNSS TTY 2022-07-21 13:25:17 -07:00
ice_hw_autogen.h
ice_idc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
ice_idc_int.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_lag.c ice: Remove unnecessary NULL check before dev_put 2022-06-30 13:53:33 -07:00
ice_lag.h
ice_lan_tx_rx.h
ice_lib.c ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_lib.h ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_main.c ice: Implement FCS/CRC and VLAN stripping co-existence policy 2022-08-18 08:08:23 -07:00
ice_nvm.c ice: Fix memory leak in ice_get_orom_civd_data() 2022-04-14 08:31:01 -07:00
ice_nvm.h
ice_osdep.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h ice: Add support for PPPoE hardware offload 2022-07-26 10:56:32 -07:00
ice_ptp.c ice: introduce ice_ptp_reset_cached_phctime function 2022-08-16 09:04:38 -07:00
ice_ptp.h ice: track and warn when PHC update is late 2022-08-16 09:04:38 -07:00
ice_ptp_consts.h
ice_ptp_hw.c
ice_ptp_hw.h
ice_repr.c ice: link representors to PCI device 2022-05-06 09:43:01 -07:00
ice_repr.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_sbq_cmd.h
ice_sched.c
ice_sched.h
ice_sriov.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-07-28 18:21:16 -07:00
ice_sriov.h ice: introduce ice_virtchnl.c and ice_virtchnl.h 2022-03-15 13:23:10 -07:00
ice_switch.c Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
ice_switch.h ice: Introduce enabling promiscuous mode on multiple VF's 2022-07-28 11:44:22 -07:00
ice_tc_lib.c ice: Add support for PPPoE hardware offload 2022-07-26 10:56:32 -07:00
ice_tc_lib.h ice: Add support for PPPoE hardware offload 2022-07-26 10:56:32 -07:00
ice_trace.h ice: add trace events for tx timestamps 2022-03-16 10:38:15 -07:00
ice_txrx.c ice: track Tx timestamp stats similar to other Intel drivers 2022-08-16 09:04:38 -07:00
ice_txrx.h ice: Implement control of FCS/CRC stripping 2022-08-18 08:08:23 -07:00
ice_txrx_lib.c
ice_txrx_lib.h
ice_type.h ice: Introduce enabling promiscuous mode on multiple VF's 2022-07-28 11:44:22 -07:00
ice_vf_lib.c ice: Fix promiscuous mode not turning off 2022-07-28 11:44:40 -07:00
ice_vf_lib.h ice: Fix promiscuous mode not turning off 2022-07-28 11:44:40 -07:00
ice_vf_lib_private.h ice: remove PF pointer from ice_check_vf_init 2022-03-15 13:23:14 -07:00
ice_vf_mbx.c
ice_vf_mbx.h
ice_vf_vsi_vlan_ops.c
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 2022-07-29 21:26:10 -07:00
ice_virtchnl.h ice: introduce ice_virtchnl.c and ice_virtchnl.h 2022-03-15 13:23:10 -07:00
ice_virtchnl_allowlist.c
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c ice: always check VF VSI pointer values 2022-05-05 11:28:36 -07:00
ice_virtchnl_fdir.h ice: introduce ice_vf_lib.c, ice_vf_lib.h, and ice_vf_lib_private.h 2022-03-15 13:22:13 -07:00
ice_vlan.h
ice_vlan_mode.c ice: Add support for VLAN TPID filters in switchdev 2022-06-30 13:53:33 -07:00
ice_vlan_mode.h
ice_vsi_vlan_lib.c
ice_vsi_vlan_lib.h
ice_vsi_vlan_ops.c
ice_vsi_vlan_ops.h
ice_xsk.c Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-04-27 17:09:32 -07:00
ice_xsk.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
Makefile ice: fix access-beyond-end in the switch code 2022-06-02 12:41:10 +02:00