mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
rtase: Link queues to NAPI instances
Link queues to NAPI instances with netif_queue_set_napi. This information can be queried with the netdev-genl API. Signed-off-by: Justin Lai <justinlai0215@realtek.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20250616032226.7318-3-justinlai0215@realtek.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
9f611bfd10
commit
8d672a3e51
|
|
@ -288,6 +288,7 @@ struct rtase_ring {
|
|||
u32 cur_idx;
|
||||
u32 dirty_idx;
|
||||
u16 index;
|
||||
u8 type;
|
||||
|
||||
struct sk_buff *skbuff[RTASE_NUM_DESC];
|
||||
void *data_buf[RTASE_NUM_DESC];
|
||||
|
|
|
|||
|
|
@ -326,6 +326,7 @@ static void rtase_tx_desc_init(struct rtase_private *tp, u16 idx)
|
|||
ring->cur_idx = 0;
|
||||
ring->dirty_idx = 0;
|
||||
ring->index = idx;
|
||||
ring->type = NETDEV_QUEUE_TYPE_TX;
|
||||
ring->alloc_fail = 0;
|
||||
|
||||
for (i = 0; i < RTASE_NUM_DESC; i++) {
|
||||
|
|
@ -345,6 +346,9 @@ static void rtase_tx_desc_init(struct rtase_private *tp, u16 idx)
|
|||
ring->ivec = &tp->int_vector[0];
|
||||
list_add_tail(&ring->ring_entry, &tp->int_vector[0].ring_list);
|
||||
}
|
||||
|
||||
netif_queue_set_napi(tp->dev, ring->index,
|
||||
ring->type, &ring->ivec->napi);
|
||||
}
|
||||
|
||||
static void rtase_map_to_asic(union rtase_rx_desc *desc, dma_addr_t mapping,
|
||||
|
|
@ -590,6 +594,7 @@ static void rtase_rx_desc_init(struct rtase_private *tp, u16 idx)
|
|||
ring->cur_idx = 0;
|
||||
ring->dirty_idx = 0;
|
||||
ring->index = idx;
|
||||
ring->type = NETDEV_QUEUE_TYPE_RX;
|
||||
ring->alloc_fail = 0;
|
||||
|
||||
for (i = 0; i < RTASE_NUM_DESC; i++)
|
||||
|
|
@ -597,6 +602,8 @@ static void rtase_rx_desc_init(struct rtase_private *tp, u16 idx)
|
|||
|
||||
ring->ring_handler = rx_handler;
|
||||
ring->ivec = &tp->int_vector[idx];
|
||||
netif_queue_set_napi(tp->dev, ring->index,
|
||||
ring->type, &ring->ivec->napi);
|
||||
list_add_tail(&ring->ring_entry, &tp->int_vector[idx].ring_list);
|
||||
}
|
||||
|
||||
|
|
@ -1161,8 +1168,12 @@ static void rtase_down(struct net_device *dev)
|
|||
ivec = &tp->int_vector[i];
|
||||
napi_disable(&ivec->napi);
|
||||
list_for_each_entry_safe(ring, tmp, &ivec->ring_list,
|
||||
ring_entry)
|
||||
ring_entry) {
|
||||
netif_queue_set_napi(tp->dev, ring->index,
|
||||
ring->type, NULL);
|
||||
|
||||
list_del(&ring->ring_entry);
|
||||
}
|
||||
}
|
||||
|
||||
netif_tx_disable(dev);
|
||||
|
|
@ -1518,8 +1529,12 @@ static void rtase_sw_reset(struct net_device *dev)
|
|||
for (i = 0; i < tp->int_nums; i++) {
|
||||
ivec = &tp->int_vector[i];
|
||||
list_for_each_entry_safe(ring, tmp, &ivec->ring_list,
|
||||
ring_entry)
|
||||
ring_entry) {
|
||||
netif_queue_set_napi(tp->dev, ring->index,
|
||||
ring->type, NULL);
|
||||
|
||||
list_del(&ring->ring_entry);
|
||||
}
|
||||
}
|
||||
|
||||
ret = rtase_init_ring(dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user