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

modules/mqnic: Add ifdefs for kernel API changes related to netif_napi_add/netif_tx_napi_add

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-04-04 01:15:50 -07:00
parent d06fbaf178
commit 1a8adb646f

View File

@ -52,8 +52,13 @@ static int mqnic_start_port(struct net_device *ndev)
mqnic_activate_cq_ring(priv->rx_cpl_ring[k], mqnic_activate_cq_ring(priv->rx_cpl_ring[k],
priv->event_ring[k % priv->event_queue_count]); priv->event_ring[k % priv->event_queue_count]);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
netif_napi_add(ndev, &priv->rx_cpl_ring[k]->napi,
mqnic_poll_rx_cq);
#else
netif_napi_add(ndev, &priv->rx_cpl_ring[k]->napi, netif_napi_add(ndev, &priv->rx_cpl_ring[k]->napi,
mqnic_poll_rx_cq, NAPI_POLL_WEIGHT); mqnic_poll_rx_cq, NAPI_POLL_WEIGHT);
#endif
napi_enable(&priv->rx_cpl_ring[k]->napi); napi_enable(&priv->rx_cpl_ring[k]->napi);
mqnic_arm_cq(priv->rx_cpl_ring[k]); mqnic_arm_cq(priv->rx_cpl_ring[k]);
@ -73,8 +78,13 @@ static int mqnic_start_port(struct net_device *ndev)
mqnic_activate_cq_ring(priv->tx_cpl_ring[k], mqnic_activate_cq_ring(priv->tx_cpl_ring[k],
priv->event_ring[k % priv->event_queue_count]); priv->event_ring[k % priv->event_queue_count]);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
netif_napi_add_tx(ndev, &priv->tx_cpl_ring[k]->napi,
mqnic_poll_tx_cq);
#else
netif_tx_napi_add(ndev, &priv->tx_cpl_ring[k]->napi, netif_tx_napi_add(ndev, &priv->tx_cpl_ring[k]->napi,
mqnic_poll_tx_cq, NAPI_POLL_WEIGHT); mqnic_poll_tx_cq, NAPI_POLL_WEIGHT);
#endif
napi_enable(&priv->tx_cpl_ring[k]->napi); napi_enable(&priv->tx_cpl_ring[k]->napi);
mqnic_arm_cq(priv->tx_cpl_ring[k]); mqnic_arm_cq(priv->tx_cpl_ring[k]);