• Radu Pirea (NXP OSS)'s avatar
    net: macsec: indicate next pn update when offloading · 0412cc84
    Radu Pirea (NXP OSS) authored
    Indicate next PN update using update_pn flag in macsec_context.
    Offloaded MACsec implementations does not know whether or not the
    MACSEC_SA_ATTR_PN attribute was passed for an SA update and assume
    that next PN should always updated, but this is not always true.
    
    The PN can be reset to its initial value using the following command:
    $ ip macsec set macsec0 tx sa 0 off #octeontx2-pf case
    
    Or, the update PN command will succeed even if the driver does not support
    PN updates.
    $ ip macsec set macsec0 tx sa 0 pn 1 on #mscc phy driver case
    
    Comparing the initial PN with the new PN value is not a solution. When
    the user updates the PN using its initial value the command will
    succeed, even if the driver does not support it. Like this:
    $ ip macsec add macsec0 tx sa 0 pn 1 on key 00 \
    ead3664f508eb06c40ac7104cdae4ce5
    $ ip macsec set macsec0 tx sa 0 pn 1 on #mlx5 case
    Signed-off-by: default avatarRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
    Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    0412cc84
macsec.c 108 KB