idpf: preserve tcp-data-split setting across hard resets
Subsystems (3)
PATCH 1/1 idpf: preserve tcp-data-split setting across hard resets
idpf_vport_init() runs on both initial probe and hard reset, and unconditionally calls idpf_vport_set_hsplit() with ETHTOOL_TCP_DATA_SPLIT_ENABLED. If a user disabled header split via 'ethtool -G <dev> tcp-data-split off', a subsequent hard reset sets __IDPF_USER_FLAG_HSPLIT again and silently re-enables header split.
Move the default idpf_vport_set_hsplit() call to idpf_cfg_netdev(), which runs after idpf_vport_init() sets rxq_model and returns early on hard reset when IDPF_VPORT_REG_NETDEV is already set.
Found by code inspection. Reproduced and verified on an Intel IPU PF (8086:1452) by disabling tcp-data-split via ethtool and triggering a function reset from a test module via idpf_idc_request_reset(): before this change tcp-data-split reverted to 'on' after reset, and with this change it stays 'off' (with rx-hsplit remaining 0).
--- drivers/net/ethernet/intel/idpf/idpf_lib.c | 1 + drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_lib.c +1 -0
@@ -945,6 +945,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport) netdev->vlan_features |= netdev->features | other_offloads; netdev->hw_enc_features |= dflt_features | other_offloads;idpf_xdp_set_features (vport); +idpf_vport_set_hsplit (vport,ETHTOOL_TCP_DATA_SPLIT_ENABLED );idpf_set_ethtool_ops (netdev);netif_set_affinity_auto (netdev);
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +0 -2
@@ -3381,8 +3381,6 @@ int idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q)memcpy (vport->rx_itr_profile, rx_itr,IDPF_DIM_PROFILE_SLOTS );memcpy (vport->tx_itr_profile, tx_itr,IDPF_DIM_PROFILE_SLOTS ); -idpf_vport_set_hsplit (vport,ETHTOOL_TCP_DATA_SPLIT_ENABLED ); -idpf_vport_init_num_qs (vport, vport_msg, rsrc);idpf_vport_calc_num_q_desc (vport, rsrc);idpf_vport_calc_num_q_groups (rsrc);
Signature · 1 line
2.56.0.611.g1030f0b940-goog
Thanks for the patch Ray,
Since header-split is on by default on this device, and vport_config is allocated zeroed, what about fliping the the user_flag meaning?
__IDPF_USER_FLAG_HSPLIT -> __IDPF_USER_FLAG_HSPLIT_DIS
If we do that then config starts with the right value on the user_config, if it's flipped user_config is already persistent acrros hard resets. And then we can just delete the call idpf_vport_set_hsplit(vport, ETHTOOL_TCP_DATA_SPLIT_ENABLED) from idpf_vport_init and do not worry about where it should be.
Quoted 52 lines · Ray Zhang
idpf_vport_init()runs on both initial probe and hard reset, and unconditionally callsidpf_vport_set_hsplit()withETHTOOL_TCP_DATA_SPLIT_ENABLED. If a user disabled header split via 'ethtool -G <dev> tcp-data-split off', a subsequent hard reset sets__IDPF_USER_FLAG_HSPLITagain and silently re-enables header split.Move the default
idpf_vport_set_hsplit()call toidpf_cfg_netdev(), which runs afteridpf_vport_init()setsrxq_modeland returns early on hard reset whenIDPF_VPORT_REG_NETDEVis already set.Found by code inspection. Reproduced and verified on an Intel IPU PF (8086:1452) by disabling tcp-data-split via ethtool and triggering a function reset from a test module via
idpf_idc_request_reset(): before this change tcp-data-split reverted to 'on' after reset, and with this change it stays 'off' (with rx-hsplit remaining 0).Fixes 9b1aa3ef2328 ("idpf: add get/set for Ethtool's header split ringparam")Signed-off-by Ray Zhang <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_lib.c | 1 + drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/net/ethernet/intel/idpf/idpf_lib.c +1
-0@@ -945,6 +945,7 @@ static int idpf_cfg_netdev(struct idpf_vport *vport) netdev->vlan_features |= netdev->features | other_offloads; netdev->hw_enc_features |= dflt_features | other_offloads;idpf_xdp_set_features (vport); +idpf_vport_set_hsplit (vport,ETHTOOL_TCP_DATA_SPLIT_ENABLED );idpf_set_ethtool_ops (netdev);netif_set_affinity_auto (netdev);drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +0
-3@@ -3381,8 +3381,6 @@ int idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q)memcpy (vport->rx_itr_profile, rx_itr,IDPF_DIM_PROFILE_SLOTS );memcpy (vport->tx_itr_profile, tx_itr,IDPF_DIM_PROFILE_SLOTS ); -idpf_vport_set_hsplit (vport,ETHTOOL_TCP_DATA_SPLIT_ENABLED ); -idpf_vport_init_num_qs (vport, vport_msg, rsrc);idpf_vport_calc_num_q_desc (vport, rsrc);idpf_vport_calc_num_q_groups (rsrc); --2.56.0.611.g1030f0b940-goog