net: thunderx: Set max queue count taking XDP_TX into account
authorSunil Goutham <sgoutham@cavium.com>
Fri, 24 Nov 2017 12:04:03 +0000 (15:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Nov 2017 14:24:07 +0000 (09:24 -0500)
on T81 there are only 4 cores, hence setting max queue count to 4
would leave nothing for XDP_TX. This patch fixes this by doubling
max queue count in above scenarios.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: cjacob <cjacob@caviumnetworks.com>
Signed-off-by: Aleksey Makarov <aleksey.makarov@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nicvf_main.c

index b82e28262c57c85b4aa89b6e95fc4e096ca2a724..52b3a6044f85f4cf1a1ddcc920b3695664e3ed8b 100644 (file)
@@ -1891,6 +1891,11 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        nic->pdev = pdev;
        nic->pnicvf = nic;
        nic->max_queues = qcount;
+       /* If no of CPUs are too low, there won't be any queues left
+        * for XDP_TX, hence double it.
+        */
+       if (!nic->t88)
+               nic->max_queues *= 2;
 
        /* MAP VF's configuration registers */
        nic->reg_base = pcim_iomap(pdev, PCI_CFG_REG_BAR_NUM, 0);