]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/bpf/devmap.c
drm/i915/execlists: Track active elements during dequeue
[linux.git] / kernel / bpf / devmap.c
index 373c6a30d8a5091f117c55000a1dbc446faeb3ea..58bdca5d978a820eec9f7efa9ecdba95f61b0883 100644 (file)
@@ -366,16 +366,17 @@ static int bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags)
  * from NET_RX_SOFTIRQ. Either way the poll routine must complete before the
  * net device can be torn down. On devmap tear down we ensure the flush list
  * is empty before completing to ensure all flush operations have completed.
+ * When drivers update the bpf program they may need to ensure any flush ops
+ * are also complete. Using synchronize_rcu or call_rcu will suffice for this
+ * because both wait for napi context to exit.
  */
 void __dev_flush(void)
 {
        struct list_head *flush_list = this_cpu_ptr(&dev_flush_list);
        struct xdp_dev_bulk_queue *bq, *tmp;
 
-       rcu_read_lock();
        list_for_each_entry_safe(bq, tmp, flush_list, flush_node)
                bq_xmit_all(bq, XDP_XMIT_FLUSH);
-       rcu_read_unlock();
 }
 
 /* rcu_read_lock (from syscall and BPF contexts) ensures that if a delete and/or