tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Unify bpf_mtap & if_ipackets++ on Rx


This is another proposal that unifies bpf_mtap and
if_ipackets++, which are executed in each driver now,
into the percpuq if_input framework.

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
  - How if_ipackets is counted up
  - Well, actually some drivers periodically update
    packet statistics though
- We can run bpf_mtap in softint
  - This makes it easy to MP-ify bpf

Here is a patch:

The patch is almost mechanically generated by spatch.
Let me know if there are mistakes.

We can move most bpf_mtap into softint by the patch
but there remain some bpf_mtap that can run in
hardware interrupt context.

Two of them that are executed from Tx interrupt and can be
moved if_start which is the usual place for bpf_mtap on Tx.

Here is a patch for the change:

Is this kind of changes correct?

So there are five remaining bpf_mtap that cannot be solved
without big changes. I annotate them:

One solution is to provide a deferred bpf_mtap mechanism that
duplicates mbuf and run bpf_mtap in softint (or workqueue).
It should work but it's perhaps a last resort.

Let me know if there is a better approach.

Any comments or suggestions?


Home | Main Index | Thread Index | Old Index