OSDN Git Service

net: mvpp2: introduce per-port nrxqs/ntxqs variables
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 3 Aug 2017 08:41:57 +0000 (10:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 22:16:09 +0000 (15:16 -0700)
commit09f8397553a24c66e0141ec57f2c1801acd4e4a0
tree892c83f29a1302eb20dcc8d3e475ab57dde5d242
parentb5635ad2e4906e8f8bd3ab145059ce413c03a7ad
net: mvpp2: introduce per-port nrxqs/ntxqs variables

Currently, the global variables rxq_number and txq_number hold the
number of per-port TXQs and RXQs. Until now, such numbers were
constant regardless of the driver configuration. As we are going to
introduce different modes for TX and RX queues, these numbers will
depend on the configuration (PPv2.1 vs. PPv2.2, exact queue
distribution logic).

Therefore, as a preparation, we move the number of RXQs and TXQs in
the 'struct mvpp2_port' structure, next to the RXQs and TXQs
descriptor arrays.

For now, they remain initialized to the same default values as
rxq_number/txq_number used to be initialized, but this will change in
future commits.

The only non-mechanical change in this patch is that the check to
verify hardware constraints on the number of RXQs and TXQs is moved
from mvpp2_probe() to mvpp2_port_probe(), since it's now in
mvpp2_port_probe() that we initialize the per-port count of RXQ and
TXQ.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c