1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

modules/mqnic: Only allocate netdev queue resources for what is supported in HW

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-05-03 01:35:46 -07:00
parent a6da3a41cb
commit 8faefe19cd

View File

@ -541,7 +541,8 @@ struct net_device *mqnic_create_netdev(struct mqnic_if *interface, int index, in
int k;
u32 desc_block_size;
ndev = alloc_etherdev_mqs(sizeof(*priv), MQNIC_MAX_TXQ, MQNIC_MAX_RXQ);
ndev = alloc_etherdev_mqs(sizeof(*priv), mqnic_res_get_count(interface->txq_res),
mqnic_res_get_count(interface->rxq_res));
if (!ndev) {
dev_err(dev, "Failed to allocate memory");
return ERR_PTR(-ENOMEM);