• Vladimir Oltean's avatar
    net: ethtool: mm: sanitize some UAPI configurations · 35b288d6
    Vladimir Oltean authored
    The verify-enabled boolean (ETHTOOL_A_MM_VERIFY_ENABLED) was intended to
    be a sub-setting of tx-enabled (ETHTOOL_A_MM_TX_ENABLED). IOW, MAC Merge
    TX can be enabled with or without verification, but verification with TX
    disabled makes no sense.
    
    The pmac-enabled boolean (ETHTOOL_A_MM_PMAC_ENABLED) was intended to be
    a global toggle from an API perspective, whereas tx-enabled just handles
    the TX direction. IOW, the pMAC can be enabled with or without TX, but
    it doesn't make sense to enable TX if the pMAC is not enabled.
    
    Add two checks which sanitize and reject these invalid cases.
    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>
    35b288d6
mm.c 8.06 KB