summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-06-06 03:01:55 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-07 19:51:41 +0300
commit2c7e41c0b2f103056f93dd5922c03d6e2021c76d (patch)
treecd6bcbe33776d635825c16eb642fbf9ea85f5193 /drivers/net/ethernet/netronome/nfp
parent6d4b0d8ed6d2f9e1741b9abd0ce64c641f890d6c (diff)
downloadlinux-2c7e41c0b2f103056f93dd5922c03d6e2021c76d.tar.xz
nfp: allow non-equal distribution of IRQs
Thus far the code assumed all vNICs will request similar number of IRQs. This will be no longer true with control vNICs (where 1 IRQ will suffice). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 98a99b199674..362dca38223b 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -420,7 +420,8 @@ static int nfp_net_pf_alloc_irqs(struct nfp_pf *pf)
list_for_each_entry(nn, &pf->vnics, vnic_list) {
unsigned int n;
- n = DIV_ROUND_UP(irqs_left, vnics_left);
+ n = min(NFP_NET_NON_Q_VECTORS + nn->dp.num_r_vecs,
+ DIV_ROUND_UP(irqs_left, vnics_left));
nfp_net_irqs_assign(nn, &pf->irq_entries[num_irqs - irqs_left],
n);
irqs_left -= n;