tech-net archive

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

bpf_mtap_softint



Hi,

This proposal is a part of the task of MP-safe bpf. To make
the task easy, we want to prevent bpf_mtap* from running
in hardware interrupt context.

By the commit "Move bpf_mtap and if_ipackets++ on Rx of each
driver to percpuq if_input" (*), most bpf_mtap on Rx run in
softint now. However, there remain some bpf_mtap that still
run in hardware interrupt context, which are marked as
"XXX not in softint" (**).

(*) http://www.nerv.org/netbsd/?q=id:20161215T092807Z.77df0ccf164687a2911f2ff5cc2dafe4fcbb08c5
(**) wireless drivers and net80211 are also remaining ones.
     nonaka@ is working on them (iwm(4) is already softint-based).

Ideally they (some drivers and ISDN protocol processing) are
converted to softint-based, but it is difficult because we
don't have actual devices for testing, time to work, (and
interest/love). So instead, provide a means to defer only
bpf_mtap to a softint handler.

This is a patch:
  http://www.netbsd.org/~ozaki-r/bpf_mtap_softint.diff

We need to only add bpf_mtap_softint_init to the driver
initializations and replace bpf_mtap with bpf_mtap_softint.
I tested it with wm(4) and it works for me. If someone
can test the patch, please do it (ISDN users?).

Note that it of course consumes more CPU time for softint
and more memory for m_dup. That said, I think that this is
a suitable workaround for now until someone makes them
softint-based.

Comments?

Thanks,
  ozaki-r


Home | Main Index | Thread Index | Old Index