]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvpp2: fix the computation of the RXQs
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 1 Mar 2019 10:52:09 +0000 (11:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Mar 2019 07:23:34 +0000 (23:23 -0800)
commit952b5786c7b625bacbeea421bcd690d2723cbb6b
treef3195639ec71251aa0f09d00c862e0bc1c616174
parentf191468dda6ee94ac5b26aa1eb4e8c080a71d6bf
net: mvpp2: fix the computation of the RXQs

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
9f9c5974dddf, as PPv2.1 ports ended up with a single RXQ while they
needed 4. This patch fixes it.

Fixes: 9f9c5974dddf ("net: mvpp2: use only one rx queue per port per CPU")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c