• Antoine Tenart's avatar
    net: mvpp2: fix the computation of the RXQs · 3f136849
    Antoine Tenart authored
    The patch fixes the computation of RXQs being used by the PPv2 driver,
    which is set depending on the PPv2 engine version and the queue mode
    used. There are three cases:
    
    - PPv2.1: 1 RXQ per CPU.
    - PPV2.2 with MVPP2_QDIST_MULTI_MODE: 1 RXQ per CPU.
    - PPv2.2 with MVPP2_QDIST_SINGLE_MODE: 1 RXQ is shared between the CPUs.
    
    The PPv2 engine supports a maximum of 32 queues per port. This patch
    adds a check so that we do not overstep this maximum.
    
    It appeared the calculation was broken for PPv2.1 engines since
    f8c6ba84, as PPv2.1 ports ended up with a single RXQ while they
    needed 4. This patch fixes it.
    
    Fixes: f8c6ba84 ("net: mvpp2: use only one rx queue per port per CPU")
    Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    3f136849
mvpp2.h 37.2 KB