Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'link-napi-instances-to-queues-and-irqs'

Justin Lai says:

====================
Link NAPI instances to queues and IRQs

This patch series introduces netdev-genl support to rtase, enabling
user-space applications to query the relationships between IRQs,
queues, and NAPI instances.
====================

Link: https://patch.msgid.link/20250616032226.7318-1-justinlai0215@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+32 -8
+1
drivers/net/ethernet/realtek/rtase/rtase.h
··· 288 288 u32 cur_idx; 289 289 u32 dirty_idx; 290 290 u16 index; 291 + u8 type; 291 292 292 293 struct sk_buff *skbuff[RTASE_NUM_DESC]; 293 294 void *data_buf[RTASE_NUM_DESC];
+31 -8
drivers/net/ethernet/realtek/rtase/rtase_main.c
··· 326 326 ring->cur_idx = 0; 327 327 ring->dirty_idx = 0; 328 328 ring->index = idx; 329 + ring->type = NETDEV_QUEUE_TYPE_TX; 329 330 ring->alloc_fail = 0; 330 331 331 332 for (i = 0; i < RTASE_NUM_DESC; i++) { ··· 346 345 ring->ivec = &tp->int_vector[0]; 347 346 list_add_tail(&ring->ring_entry, &tp->int_vector[0].ring_list); 348 347 } 348 + 349 + netif_queue_set_napi(tp->dev, ring->index, 350 + ring->type, &ring->ivec->napi); 349 351 } 350 352 351 353 static void rtase_map_to_asic(union rtase_rx_desc *desc, dma_addr_t mapping, ··· 594 590 ring->cur_idx = 0; 595 591 ring->dirty_idx = 0; 596 592 ring->index = idx; 593 + ring->type = NETDEV_QUEUE_TYPE_RX; 597 594 ring->alloc_fail = 0; 598 595 599 596 for (i = 0; i < RTASE_NUM_DESC; i++) ··· 602 597 603 598 ring->ring_handler = rx_handler; 604 599 ring->ivec = &tp->int_vector[idx]; 600 + netif_queue_set_napi(tp->dev, ring->index, 601 + ring->type, &ring->ivec->napi); 605 602 list_add_tail(&ring->ring_entry, &tp->int_vector[idx].ring_list); 606 603 } 607 604 ··· 1168 1161 ivec = &tp->int_vector[i]; 1169 1162 napi_disable(&ivec->napi); 1170 1163 list_for_each_entry_safe(ring, tmp, &ivec->ring_list, 1171 - ring_entry) 1164 + ring_entry) { 1165 + netif_queue_set_napi(tp->dev, ring->index, 1166 + ring->type, NULL); 1167 + 1172 1168 list_del(&ring->ring_entry); 1169 + } 1173 1170 } 1174 1171 1175 1172 netif_tx_disable(dev); ··· 1529 1518 for (i = 0; i < tp->int_nums; i++) { 1530 1519 ivec = &tp->int_vector[i]; 1531 1520 list_for_each_entry_safe(ring, tmp, &ivec->ring_list, 1532 - ring_entry) 1521 + ring_entry) { 1522 + netif_queue_set_napi(tp->dev, ring->index, 1523 + ring->type, NULL); 1524 + 1533 1525 list_del(&ring->ring_entry); 1526 + } 1534 1527 } 1535 1528 1536 1529 ret = rtase_init_ring(dev); ··· 1886 1871 dev->ethtool_ops = &rtase_ethtool_ops; 1887 1872 } 1888 1873 1874 + static void rtase_init_napi(struct rtase_private *tp) 1875 + { 1876 + u16 i; 1877 + 1878 + for (i = 0; i < tp->int_nums; i++) { 1879 + netif_napi_add_config(tp->dev, &tp->int_vector[i].napi, 1880 + tp->int_vector[i].poll, i); 1881 + netif_napi_set_irq(&tp->int_vector[i].napi, 1882 + tp->int_vector[i].irq); 1883 + } 1884 + } 1885 + 1889 1886 static void rtase_reset_interrupt(struct pci_dev *pdev, 1890 1887 const struct rtase_private *tp) 1891 1888 { ··· 1983 1956 memset(tp->int_vector[0].name, 0x0, sizeof(tp->int_vector[0].name)); 1984 1957 INIT_LIST_HEAD(&tp->int_vector[0].ring_list); 1985 1958 1986 - netif_napi_add(tp->dev, &tp->int_vector[0].napi, 1987 - tp->int_vector[0].poll); 1988 - 1989 1959 /* interrupt vector 1 ~ 3 */ 1990 1960 for (i = 1; i < tp->int_nums; i++) { 1991 1961 tp->int_vector[i].tp = tp; ··· 1996 1972 memset(tp->int_vector[i].name, 0x0, 1997 1973 sizeof(tp->int_vector[0].name)); 1998 1974 INIT_LIST_HEAD(&tp->int_vector[i].ring_list); 1999 - 2000 - netif_napi_add(tp->dev, &tp->int_vector[i].napi, 2001 - tp->int_vector[i].poll); 2002 1975 } 2003 1976 } 2004 1977 ··· 2226 2205 dev_err(&pdev->dev, "unable to alloc MSIX/MSI\n"); 2227 2206 goto err_out_del_napi; 2228 2207 } 2208 + 2209 + rtase_init_napi(tp); 2229 2210 2230 2211 rtase_init_netdev_ops(dev); 2231 2212