/linux-6.14.4/Documentation/networking/ |
D | napi.rst | 6 NAPI title 9 NAPI is the event handling mechanism used by the Linux networking stack. 10 The name NAPI no longer stands for anything in particular [#]_. 14 The host then schedules a NAPI instance to process the events. 15 The device may also be polled for events via NAPI without receiving 18 NAPI processing usually happens in the software interrupt context, 20 for NAPI processing. 22 All in all NAPI abstracts away from the drivers the context and configuration 28 The two most important elements of NAPI are the struct napi_struct 30 of the NAPI instance while the method is the driver-specific event [all …]
|
D | multi-pf-netdev.rst | 90 The relation between PF, irq, napi, and queue can be observed via netlink spec:: 93 [{'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'rx'}, 94 {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'rx'}, 95 {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'rx'}, 96 {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'rx'}, 97 {'id': 4, 'ifindex': 13, 'napi-id': 543, 'type': 'rx'}, 98 {'id': 0, 'ifindex': 13, 'napi-id': 539, 'type': 'tx'}, 99 {'id': 1, 'ifindex': 13, 'napi-id': 540, 'type': 'tx'}, 100 {'id': 2, 'ifindex': 13, 'napi-id': 541, 'type': 'tx'}, 101 {'id': 3, 'ifindex': 13, 'napi-id': 542, 'type': 'tx'}, [all …]
|
/linux-6.14.4/io_uring/ |
D | napi.c | 4 #include "napi.h" 37 /* napi approximating usecs, reverse busy_loop_current_time */ in net_to_ktime() 46 /* Non-NAPI IDs can be rejected. */ in __io_napi_add_id() 89 /* Non-NAPI IDs can be rejected. */ in __io_napi_del_id() 212 /* Singular lists use a different napi loop end check function and are in io_napi_blocking_busy_loop() 232 * io_napi_init() - Init napi settings 235 * Init napi settings in the io-uring context. 249 * io_napi_free() - Deallocate napi 252 * Free the napi list and the hash table in the io-uring context. 267 struct io_uring_napi *napi) in io_napi_register_napi() argument [all …]
|
/linux-6.14.4/net/core/ |
D | gro.c | 254 static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb) in napi_gro_complete() argument 287 gro_normal_one(napi, skb, NAPI_GRO_CB(skb)->count); in napi_gro_complete() 290 static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index, in __napi_gro_flush_chain() argument 293 struct list_head *head = &napi->gro_hash[index].list; in __napi_gro_flush_chain() 300 napi_gro_complete(napi, skb); in __napi_gro_flush_chain() 301 napi->gro_hash[index].count--; in __napi_gro_flush_chain() 304 if (!napi->gro_hash[index].count) in __napi_gro_flush_chain() 305 __clear_bit(index, &napi->gro_bitmask); in __napi_gro_flush_chain() 308 /* napi->gro_hash[].list contains packets ordered by age. 312 void napi_gro_flush(struct napi_struct *napi, bool flush_old) in napi_gro_flush() argument [all …]
|
D | dev.h | 182 * napi_get_defer_hard_irqs - get the NAPI's defer_hard_irqs 183 * @n: napi struct to get the defer_hard_irqs field from 185 * Return: the per-NAPI value of the defar_hard_irqs field. 193 * napi_set_defer_hard_irqs - set the defer_hard_irqs for a napi 212 struct napi_struct *napi; in netdev_set_defer_hard_irqs() local 216 list_for_each_entry(napi, &netdev->napi_list, dev_list) in netdev_set_defer_hard_irqs() 217 napi_set_defer_hard_irqs(napi, defer); in netdev_set_defer_hard_irqs() 225 * @n: napi struct to get the gro_flush_timeout from 227 * Return: the per-NAPI value of the gro_flush_timeout field. 236 * napi_set_gro_flush_timeout - set the gro_flush_timeout for a napi [all …]
|
D | gro_cells.c | 10 struct napi_struct napi; member 40 napi_schedule(&cell->napi); in gro_cells_receive() 51 static int gro_cell_poll(struct napi_struct *napi, int budget) in gro_cell_poll() argument 53 struct gro_cell *cell = container_of(napi, struct gro_cell, napi); in gro_cell_poll() 61 napi_gro_receive(napi, skb); in gro_cell_poll() 66 napi_complete_done(napi, work_done); in gro_cell_poll() 83 set_bit(NAPI_STATE_NO_BUSY_POLL, &cell->napi.state); in gro_cells_init() 85 netif_napi_add(dev, &cell->napi, gro_cell_poll); in gro_cells_init() 86 napi_enable(&cell->napi); in gro_cells_init() 116 napi_disable(&cell->napi); in gro_cells_destroy() [all …]
|
D | netdev-genl.c | 163 netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi, in netdev_nl_napi_fill_one() argument 172 if (!napi->dev->up) in netdev_nl_napi_fill_one() 179 if (nla_put_u32(rsp, NETDEV_A_NAPI_ID, napi->napi_id)) in netdev_nl_napi_fill_one() 182 if (nla_put_u32(rsp, NETDEV_A_NAPI_IFINDEX, napi->dev->ifindex)) in netdev_nl_napi_fill_one() 185 if (napi->irq >= 0 && nla_put_u32(rsp, NETDEV_A_NAPI_IRQ, napi->irq)) in netdev_nl_napi_fill_one() 188 if (napi->thread) { in netdev_nl_napi_fill_one() 189 pid = task_pid_nr(napi->thread); in netdev_nl_napi_fill_one() 194 napi_defer_hard_irqs = napi_get_defer_hard_irqs(napi); in netdev_nl_napi_fill_one() 199 irq_suspend_timeout = napi_get_irq_suspend_timeout(napi); in netdev_nl_napi_fill_one() 204 gro_flush_timeout = napi_get_gro_flush_timeout(napi); in netdev_nl_napi_fill_one() [all …]
|
/linux-6.14.4/include/trace/events/ |
D | napi.h | 3 #define TRACE_SYSTEM napi 16 TP_PROTO(struct napi_struct *napi, int work, int budget), 18 TP_ARGS(napi, work, budget), 21 __field( struct napi_struct *, napi) 22 __string( dev_name, napi->dev ? napi->dev->name : NO_DEV) 28 __entry->napi = napi; 34 TP_printk("napi poll on napi struct %p for device %s work %d budget %d", 35 __entry->napi, __get_str(dev_name),
|
/linux-6.14.4/drivers/net/ethernet/intel/igc/ |
D | igc_xdp.c | 51 struct napi_struct *napi; in igc_xdp_enable_pool() local 80 /* Rx and Tx rings share the same napi context. */ in igc_xdp_enable_pool() 81 napi = &rx_ring->q_vector->napi; in igc_xdp_enable_pool() 86 napi_disable(napi); in igc_xdp_enable_pool() 93 napi_enable(napi); in igc_xdp_enable_pool() 111 struct napi_struct *napi; in igc_xdp_disable_pool() local 126 /* Rx and Tx rings share the same napi context. */ in igc_xdp_disable_pool() 127 napi = &rx_ring->q_vector->napi; in igc_xdp_disable_pool() 132 napi_disable(napi); in igc_xdp_disable_pool() 140 napi_enable(napi); in igc_xdp_disable_pool()
|
/linux-6.14.4/Documentation/netlink/specs/ |
D | netdev.yaml | 39 support in the driver napi callback. 143 name: napi-id 144 doc: Id of NAPI using this Page Pool instance. 233 name: napi 237 doc: ifindex of the netdevice to which NAPI instance belongs. 243 doc: ID of the NAPI instance. 247 doc: The associated interrupt vector number for the napi 251 doc: PID of the napi thread, if NAPI is configured to operate in 252 threaded mode. If NAPI is not in threaded mode (i.e. uses normal 264 doc: The timeout, in nanoseconds, of when to trigger the NAPI watchdog [all …]
|
/linux-6.14.4/drivers/infiniband/hw/hfi1/ |
D | ipoib_rx.c | 22 static struct sk_buff *prepare_frag_skb(struct napi_struct *napi, int size) in prepare_frag_skb() argument 33 return napi_alloc_skb(napi, size); in prepare_frag_skb() 49 struct napi_struct *napi = &rxq->napi; in hfi1_ipoib_prepare_skb() local 55 * napi cache. Otherwise we will try to use napi frag cache. in hfi1_ipoib_prepare_skb() 58 skb = napi_alloc_skb(napi, skb_size); in hfi1_ipoib_prepare_skb() 60 skb = prepare_frag_skb(napi, skb_size); in hfi1_ipoib_prepare_skb()
|
D | netdev_rx.c | 211 rxq->rcd->napi = &rxq->napi; in hfi1_netdev_rxq_init() 212 dd_dev_info(dd, "Setting rcv queue %d napi to context %d\n", in hfi1_netdev_rxq_init() 215 * Disable BUSY_POLL on this NAPI as this is not supported in hfi1_netdev_rxq_init() 218 set_bit(NAPI_STATE_NO_BUSY_POLL, &rxq->napi.state); in hfi1_netdev_rxq_init() 219 netif_napi_add(dev, &rxq->napi, hfi1_netdev_rx_napi); in hfi1_netdev_rxq_init() 252 netif_napi_del(&rxq->napi); in hfi1_netdev_rxq_deinit() 272 napi_enable(&rxq->napi); in enable_queues() 291 /* wait for napi if it was scheduled */ in disable_queues() 295 napi_synchronize(&rxq->napi); in disable_queues() 296 napi_disable(&rxq->napi); in disable_queues() [all …]
|
D | netdev.h | 18 * @napi: napi object 23 struct napi_struct napi; member 47 * When 0 NAPI will be disabled. 58 /* count of enabled napi polls */ 103 int hfi1_netdev_rx_napi(struct napi_struct *napi, int budget);
|
/linux-6.14.4/include/linux/ |
D | netpoll.h | 72 static inline void *netpoll_poll_lock(struct napi_struct *napi) in netpoll_poll_lock() argument 74 struct net_device *dev = napi->dev; in netpoll_poll_lock() 79 while (cmpxchg(&napi->poll_owner, -1, owner) != -1) in netpoll_poll_lock() 82 return napi; in netpoll_poll_lock() 89 struct napi_struct *napi = have; in netpoll_poll_unlock() local 91 if (napi) in netpoll_poll_unlock() 92 smp_store_release(&napi->poll_owner, -1); in netpoll_poll_unlock() 101 static inline void *netpoll_poll_lock(struct napi_struct *napi) in netpoll_poll_lock() argument
|
/linux-6.14.4/drivers/net/netdevsim/ |
D | netdev.c | 90 napi_schedule(&rq->napi); in nsim_start_xmit() 363 static int nsim_poll(struct napi_struct *napi, int budget) in nsim_poll() argument 365 struct nsim_rq *rq = container_of(napi, struct nsim_rq, napi); in nsim_poll() 369 napi_complete(napi); in nsim_poll() 374 static int nsim_create_page_pool(struct page_pool **p, struct napi_struct *napi) in nsim_create_page_pool() argument 380 .dev = &napi->dev->dev, in nsim_create_page_pool() 381 .napi = napi, in nsim_create_page_pool() 383 .netdev = napi->dev, in nsim_create_page_pool() 404 netif_napi_add_config(dev, &rq->napi, nsim_poll, i); in nsim_init_napi() 410 err = nsim_create_page_pool(&rq->page_pool, &rq->napi); in nsim_init_napi() [all …]
|
/linux-6.14.4/drivers/net/wireless/ath/wil6210/ |
D | netdev.c | 91 static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget) in wil6210_netdev_poll_rx() argument 93 struct wil6210_priv *wil = container_of(napi, struct wil6210_priv, in wil6210_netdev_poll_rx() 102 napi_complete_done(napi, done); in wil6210_netdev_poll_rx() 104 wil_dbg_txrx(wil, "NAPI RX complete\n"); in wil6210_netdev_poll_rx() 107 wil_dbg_txrx(wil, "NAPI RX poll(%d) done %d\n", budget, done); in wil6210_netdev_poll_rx() 112 static int wil6210_netdev_poll_rx_edma(struct napi_struct *napi, int budget) in wil6210_netdev_poll_rx_edma() argument 114 struct wil6210_priv *wil = container_of(napi, struct wil6210_priv, in wil6210_netdev_poll_rx_edma() 123 napi_complete_done(napi, done); in wil6210_netdev_poll_rx_edma() 125 wil_dbg_txrx(wil, "NAPI RX complete\n"); in wil6210_netdev_poll_rx_edma() 128 wil_dbg_txrx(wil, "NAPI RX poll(%d) done %d\n", budget, done); in wil6210_netdev_poll_rx_edma() [all …]
|
/linux-6.14.4/drivers/net/ethernet/hisilicon/hibmcge/ |
D | hbg_txrx.c | 152 static int hbg_napi_tx_recycle(struct napi_struct *napi, int budget) in hbg_napi_tx_recycle() argument 154 struct hbg_ring *ring = container_of(napi, struct hbg_ring, napi); in hbg_napi_tx_recycle() 165 * Per NAPI documentation budget is for Rx. in hbg_napi_tx_recycle() 166 * So We hardcode the amount of work Tx NAPI does to 128. in hbg_napi_tx_recycle() 192 napi_complete_done(napi, packet_done))) in hbg_napi_tx_recycle() 238 static int hbg_napi_rx_poll(struct napi_struct *napi, int budget) in hbg_napi_rx_poll() argument 240 struct hbg_ring *ring = container_of(napi, struct hbg_ring, napi); in hbg_napi_rx_poll() 268 napi_gro_receive(napi, buffer->skb); in hbg_napi_rx_poll() 278 napi_complete_done(napi, packet_done))) in hbg_napi_rx_poll() 292 napi_disable(&ring->napi); in hbg_ring_uninit() [all …]
|
/linux-6.14.4/drivers/net/ethernet/synopsys/ |
D | dwc-xlgmac-net.c | 283 * enabled before using the private data napi structure. in xlgmac_isr() 290 if (napi_schedule_prep(&pdata->napi)) { in xlgmac_isr() 296 __napi_schedule_irqoff(&pdata->napi); in xlgmac_isr() 348 * channel napi structure and not the private data napi structure in xlgmac_dma_isr() 350 if (napi_schedule_prep(&channel->napi)) { in xlgmac_dma_isr() 355 __napi_schedule_irqoff(&channel->napi); in xlgmac_dma_isr() 365 struct napi_struct *napi; in xlgmac_tx_timer() local 367 napi = (pdata->per_channel_irq) ? &channel->napi : &pdata->napi; in xlgmac_tx_timer() 369 if (napi_schedule_prep(napi)) { in xlgmac_tx_timer() 378 __napi_schedule(napi); in xlgmac_tx_timer() [all …]
|
/linux-6.14.4/drivers/net/ethernet/ |
D | lantiq_xrx200.c | 64 struct napi_struct napi; member 151 napi_enable(&priv->chan_tx.napi); in xrx200_open() 155 napi_enable(&priv->chan_rx.napi); in xrx200_open() 178 napi_disable(&priv->chan_rx.napi); in xrx200_close() 181 napi_disable(&priv->chan_tx.napi); in xrx200_close() 283 static int xrx200_poll_rx(struct napi_struct *napi, int budget) in xrx200_poll_rx() argument 285 struct xrx200_chan *ch = container_of(napi, in xrx200_poll_rx() 286 struct xrx200_chan, napi); in xrx200_poll_rx() 306 if (napi_complete_done(&ch->napi, rx)) in xrx200_poll_rx() 313 static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget) in xrx200_tx_housekeeping() argument [all …]
|
/linux-6.14.4/drivers/net/ethernet/aquantia/atlantic/ |
D | aq_vec.c | 21 struct napi_struct napi; member 28 static int aq_vec_poll(struct napi_struct *napi, int budget) in aq_vec_poll() argument 30 struct aq_vec_s *self = container_of(napi, struct aq_vec_s, napi); in aq_vec_poll() 68 napi, in aq_vec_poll() 93 napi_complete_done(napi, work_done); in aq_vec_poll() 122 netif_napi_add(aq_nic_get_ndev(aq_nic), &self->napi, aq_vec_poll); in aq_vec_alloc() 151 self->napi.napi_id) < 0) { in aq_vec_ring_alloc() 245 napi_enable(&self->napi); in aq_vec_start() 265 napi_disable(&self->napi); in aq_vec_stop() 290 netif_napi_del(&self->napi); in aq_vec_free() [all …]
|
/linux-6.14.4/drivers/net/ethernet/mellanox/mlx4/ |
D | en_cq.c | 152 netif_napi_add_tx(cq->dev, &cq->napi, mlx4_en_poll_tx_cq); in mlx4_en_activate_cq() 153 netif_napi_set_irq(&cq->napi, irq); in mlx4_en_activate_cq() 154 napi_enable(&cq->napi); in mlx4_en_activate_cq() 155 netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_TX, &cq->napi); in mlx4_en_activate_cq() 159 netif_napi_add_config(cq->dev, &cq->napi, mlx4_en_poll_rx_cq, in mlx4_en_activate_cq() 161 netif_napi_set_irq(&cq->napi, irq); in mlx4_en_activate_cq() 162 napi_enable(&cq->napi); in mlx4_en_activate_cq() 163 netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_RX, &cq->napi); in mlx4_en_activate_cq() 166 /* nothing regarding napi, it's shared with rx ring */ in mlx4_en_activate_cq() 207 napi_disable(&cq->napi); in mlx4_en_deactivate_cq() [all …]
|
/linux-6.14.4/drivers/net/ethernet/google/gve/ |
D | gve_utils.c | 67 struct sk_buff *gve_rx_copy_data(struct net_device *dev, struct napi_struct *napi, in gve_rx_copy_data() argument 72 skb = napi_alloc_skb(napi, len); in gve_rx_copy_data() 83 struct sk_buff *gve_rx_copy(struct net_device *dev, struct napi_struct *napi, in gve_rx_copy() argument 89 return gve_rx_copy_data(dev, napi, va, len); in gve_rx_copy() 113 netif_napi_add(priv->dev, &block->napi, gve_poll); in gve_add_napi() 114 netif_napi_set_irq(&block->napi, block->irq); in gve_add_napi() 121 netif_napi_del(&block->napi); in gve_remove_napi()
|
/linux-6.14.4/drivers/net/ethernet/mellanox/mlx5/core/en/ |
D | trap.c | 8 static int mlx5e_trap_napi_poll(struct napi_struct *napi, int budget) in mlx5e_trap_napi_poll() argument 10 struct mlx5e_trap *trap_ctx = container_of(napi, struct mlx5e_trap, napi); in mlx5e_trap_napi_poll() 29 if (unlikely(!napi_complete_done(napi, work_done))) in mlx5e_trap_napi_poll() 77 ccp.napi = &t->napi; in mlx5e_open_trap_rq() 152 netif_napi_add(netdev, &t->napi, mlx5e_trap_napi_poll); in mlx5e_open_trap() 167 netif_napi_del(&t->napi); in mlx5e_open_trap() 176 netif_napi_del(&trap->napi); in mlx5e_close_trap() 182 napi_enable(&trap->napi); in mlx5e_activate_trap() 184 mlx5e_trigger_napi_sched(&trap->napi); in mlx5e_activate_trap() 192 napi_disable(&trap->napi); in mlx5e_deactivate_trap()
|
/linux-6.14.4/drivers/net/caif/ |
D | caif_virtio.c | 30 /* NAPI schedule quota */ 41 /* struct cfv_napi_contxt - NAPI context info 54 * @rx_napi_complete: Number of NAPI completions (RX) 84 * @napi: Napi context used in cfv_rx_poll() 111 struct napi_struct napi; member 250 static int cfv_rx_poll(struct napi_struct *napi, int quota) in cfv_rx_poll() argument 252 struct cfv_info *cfv = container_of(napi, struct cfv_info, napi); in cfv_rx_poll() 319 napi_complete(napi); in cfv_rx_poll() 321 napi_schedule_prep(napi)) { in cfv_rx_poll() 323 __napi_schedule(napi); in cfv_rx_poll() [all …]
|
/linux-6.14.4/drivers/net/ethernet/meta/fbnic/ |
D | fbnic_txrx.c | 442 txq = txring_txq(nv->napi.dev, ring); in fbnic_clean_twq0() 481 netdev_err(nv->napi.dev, in fbnic_clean_tsq() 493 fbn = netdev_priv(nv->napi.dev); in fbnic_clean_tsq() 843 skb->protocol = eth_type_trans(skb, nv->napi.dev); in fbnic_build_skb() 868 fbn = netdev_priv(nv->napi.dev); in fbnic_rx_tstamp() 880 struct net_device *netdev = nv->napi.dev; in fbnic_populate_skb_fields() 955 napi_gro_receive(&nv->napi, skb); in fbnic_clean_rcq() 1017 static int fbnic_poll(struct napi_struct *napi, int budget) in fbnic_poll() argument 1019 struct fbnic_napi_vector *nv = container_of(napi, in fbnic_poll() 1021 napi); in fbnic_poll() [all …]
|