• Vladimir Oltean's avatar
    net: enetc: only commit preemptible TCs to hardware when MM TX is active · 82714539
    Vladimir Oltean authored
    This was left as TODO in commit 01e23b2b ("net: enetc: add support
    for preemptible traffic classes") since it's relatively complicated.
    
    Where this makes a difference is with a configuration as follows:
    
    ethtool --set-mm eno0 pmac-enabled on tx-enabled on verify-enabled on
    
    Preemptible packets should only be sent when the MAC Merge TX direction
    becomes active (i.o.w. when the verification process succeeds, aka when
    the link partner confirms it can process preemptible traffic). But the
    tc qdisc with the preemptible traffic classes is offloaded completely
    asynchronously w.r.t. the MM becoming active.
    
    The ENETC manual does suggest that this should be handled in the driver:
    "On startup, software should wait for the verification process to
    complete (MMCSR[VSTS]=011) before initiating traffic".
    
    Adding the necessary logic allows future selftests to uphold the claim
    that an inactive or disabled MAC Merge layer should never send data
    packets through the pMAC.
    
    This change moves enetc_set_ptcfpr() from enetc.c to enetc_ethtool.c,
    where its only caller is now - enetc_mm_commit_preemptible_tcs().
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    82714539
enetc.c 77.2 KB