mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-19 23:02:31 +00:00
net/mlx4: link NAPI instances to queues and IRQs
Make mlx4 compatible with the newly added netlink queue GET APIs. Signed-off-by: Joe Damato <jdamato@fastly.com> Tested-by: Martin Karsten <mkarsten@uwaterloo.ca> Acked-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20240528181139.515070-3-jdamato@fastly.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6166bb0cac
commit
64b62146ba
@ -126,6 +126,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
|
|||||||
cq_idx = cq_idx % priv->rx_ring_num;
|
cq_idx = cq_idx % priv->rx_ring_num;
|
||||||
rx_cq = priv->rx_cq[cq_idx];
|
rx_cq = priv->rx_cq[cq_idx];
|
||||||
cq->vector = rx_cq->vector;
|
cq->vector = rx_cq->vector;
|
||||||
|
irq = mlx4_eq_get_irq(mdev->dev, cq->vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cq->type == RX)
|
if (cq->type == RX)
|
||||||
@ -142,18 +143,23 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
|
|||||||
if (err)
|
if (err)
|
||||||
goto free_eq;
|
goto free_eq;
|
||||||
|
|
||||||
|
cq->cq_idx = cq_idx;
|
||||||
cq->mcq.event = mlx4_en_cq_event;
|
cq->mcq.event = mlx4_en_cq_event;
|
||||||
|
|
||||||
switch (cq->type) {
|
switch (cq->type) {
|
||||||
case TX:
|
case TX:
|
||||||
cq->mcq.comp = mlx4_en_tx_irq;
|
cq->mcq.comp = mlx4_en_tx_irq;
|
||||||
netif_napi_add_tx(cq->dev, &cq->napi, mlx4_en_poll_tx_cq);
|
netif_napi_add_tx(cq->dev, &cq->napi, mlx4_en_poll_tx_cq);
|
||||||
|
netif_napi_set_irq(&cq->napi, irq);
|
||||||
napi_enable(&cq->napi);
|
napi_enable(&cq->napi);
|
||||||
|
netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_TX, &cq->napi);
|
||||||
break;
|
break;
|
||||||
case RX:
|
case RX:
|
||||||
cq->mcq.comp = mlx4_en_rx_irq;
|
cq->mcq.comp = mlx4_en_rx_irq;
|
||||||
netif_napi_add(cq->dev, &cq->napi, mlx4_en_poll_rx_cq);
|
netif_napi_add(cq->dev, &cq->napi, mlx4_en_poll_rx_cq);
|
||||||
|
netif_napi_set_irq(&cq->napi, irq);
|
||||||
napi_enable(&cq->napi);
|
napi_enable(&cq->napi);
|
||||||
|
netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_RX, &cq->napi);
|
||||||
break;
|
break;
|
||||||
case TX_XDP:
|
case TX_XDP:
|
||||||
/* nothing regarding napi, it's shared with rx ring */
|
/* nothing regarding napi, it's shared with rx ring */
|
||||||
@ -189,6 +195,14 @@ void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq **pcq)
|
|||||||
void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
|
void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
|
||||||
{
|
{
|
||||||
if (cq->type != TX_XDP) {
|
if (cq->type != TX_XDP) {
|
||||||
|
enum netdev_queue_type qtype;
|
||||||
|
|
||||||
|
if (cq->type == RX)
|
||||||
|
qtype = NETDEV_QUEUE_TYPE_RX;
|
||||||
|
else
|
||||||
|
qtype = NETDEV_QUEUE_TYPE_TX;
|
||||||
|
|
||||||
|
netif_queue_set_napi(cq->dev, cq->cq_idx, qtype, NULL);
|
||||||
napi_disable(&cq->napi);
|
napi_disable(&cq->napi);
|
||||||
netif_napi_del(&cq->napi);
|
netif_napi_del(&cq->napi);
|
||||||
}
|
}
|
||||||
|
@ -380,6 +380,7 @@ struct mlx4_en_cq {
|
|||||||
#define MLX4_EN_OPCODE_ERROR 0x1e
|
#define MLX4_EN_OPCODE_ERROR 0x1e
|
||||||
|
|
||||||
const struct cpumask *aff_mask;
|
const struct cpumask *aff_mask;
|
||||||
|
int cq_idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mlx4_en_port_profile {
|
struct mlx4_en_port_profile {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user