Lines Matching +full:1 +full:- +full:cell

1 // SPDX-License-Identifier: GPL-2.0
15 struct net_device *dev = skb->dev; in gro_cells_receive()
16 struct gro_cell *cell; in gro_cells_receive() local
20 if (unlikely(!(dev->flags & IFF_UP))) in gro_cells_receive()
23 if (!gcells->cells || skb_cloned(skb) || netif_elide_gro(dev)) { in gro_cells_receive()
28 cell = this_cpu_ptr(gcells->cells); in gro_cells_receive()
30 if (skb_queue_len(&cell->napi_skbs) > READ_ONCE(net_hotdata.max_backlog)) { in gro_cells_receive()
38 __skb_queue_tail(&cell->napi_skbs, skb); in gro_cells_receive()
39 if (skb_queue_len(&cell->napi_skbs) == 1) in gro_cells_receive()
40 napi_schedule(&cell->napi); in gro_cells_receive()
53 struct gro_cell *cell = container_of(napi, struct gro_cell, napi); in gro_cell_poll() local
58 skb = __skb_dequeue(&cell->napi_skbs); in gro_cell_poll()
74 gcells->cells = alloc_percpu(struct gro_cell); in gro_cells_init()
75 if (!gcells->cells) in gro_cells_init()
76 return -ENOMEM; in gro_cells_init()
79 struct gro_cell *cell = per_cpu_ptr(gcells->cells, i); in gro_cells_init() local
81 __skb_queue_head_init(&cell->napi_skbs); in gro_cells_init()
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()
102 free_percpu(defer->ptr); in percpu_free_defer_callback()
111 if (!gcells->cells) in gro_cells_destroy()
114 struct gro_cell *cell = per_cpu_ptr(gcells->cells, i); in gro_cells_destroy() local
116 napi_disable(&cell->napi); in gro_cells_destroy()
117 __netif_napi_del(&cell->napi); in gro_cells_destroy()
118 __skb_queue_purge(&cell->napi_skbs); in gro_cells_destroy()
120 /* We need to observe an rcu grace period before freeing ->cells, in gro_cells_destroy()
121 * because netpoll could access dev->napi_list under rcu protection. in gro_cells_destroy()
128 defer->ptr = gcells->cells; in gro_cells_destroy()
129 call_rcu(&defer->rcu, percpu_free_defer_callback); in gro_cells_destroy()
135 free_percpu(gcells->cells); in gro_cells_destroy()
137 gcells->cells = NULL; in gro_cells_destroy()