Home | History | Annotate | Download | only in qbus
History log of /src/sys/dev/qbus/if_qt.c
RevisionDateAuthorComments
 1.29  08-Jan-2025  tsutsui Use ETHER_CRC_LEN where appropriate.
 1.28  08-Jan-2025  tsutsui Fix misc style, especially weird indent, per KNF.
 1.27  02-Sep-2022  thorpej Remove unnecessary inclusion of <net/netisr.h>.
 1.26  20-Dec-2021  rhialto Set up multicast (input) filter on qt (DELQA-Turbo).
 1.25  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.24  21-Oct-2019  msaitoh branches: 1.24.2;
if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.23  26-Jun-2018  msaitoh branches: 1.23.2; 1.23.8;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.22  22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.21  15-Dec-2016  ozaki-r branches: 1.21.8; 1.21.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.20  12-Dec-2016  maya acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
 1.19  09-Feb-2016  ozaki-r branches: 1.19.2;
Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.18  05-Apr-2010  joerg branches: 1.18.18; 1.18.36;
Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.17  19-Jan-2010  pooka branches: 1.17.2; 1.17.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.16  11-Jan-2009  matt Initialize sc->sc_dev before we use it.
 1.15  16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.14  11-Mar-2008  matt branches: 1.14.4; 1.14.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.13  04-Jan-2008  joerg branches: 1.13.2; 1.13.6;
Add missing sys/device.h.
 1.12  19-Oct-2007  ad branches: 1.12.2; 1.12.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11  04-Mar-2007  christos branches: 1.11.2; 1.11.14; 1.11.16; 1.11.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10  07-Sep-2006  dogcow branches: 1.10.8;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.9  29-Mar-2006  thorpej Use device_private().
 1.8  25-Mar-2006  thorpej Use device_parent().
 1.7  11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6  26-Feb-2005  simonb branches: 1.6.4;
White space nits.
 1.5  30-Oct-2004  thorpej branches: 1.5.4; 1.5.6;
- qtinit(): Don't skip initialization if we're already marked RUNNING.
ether_ioctl() will call (*if_init)() when flags change. Instead, do
what other drivers do and stop the interface in this case before
re-initializing.
- qtioctl(): Now that qtinit() does the right thing, remove the check
for IFF_PROMISC change.

When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.4  31-Aug-2003  ragge branches: 1.4.4; 1.4.6;
Add stop routine. Add support for turning the device into promiscous mode.
Force interrupt in probe so that the interrupt vector can be detected.
 1.3  29-Aug-2003  ragge bus-ify. Make bpf work, but no promiscuous mode yet.
 1.2  29-Aug-2003  ragge Make the qt driver work under NetBSD. Still to do:
- bus-ify.
- bpf support.
- multicast support.
 1.1  28-Aug-2003  ragge Driver for the DELQA-PLUS card in Turbo mode, from 2.11BSD, written by
Steven M. Schultz.
 1.4.6.1  30-Jan-2005  he Pull up revision 1.5 (requested by thorpej in ticket #942):
In qtinit(), don't skip initialization if the interface is
already RUNNING. ether_ioctl() will call (*if_init)() when
flags change. Instead, do what other drivers do, and stop
the interface in this case before re-initializing.
In qtioctl(), now that qtinit() does the right thing, remove
the check for the IFF_PROMISC change.
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#37678.
 1.4.4.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.5  02-Nov-2004  skrll Sync with HEAD.
 1.4.4.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.4.3  18-Sep-2004  skrll Sync with HEAD.
 1.4.4.2  03-Aug-2004  skrll Sync with HEAD
 1.4.4.1  31-Aug-2003  skrll file if_qt.c was added on branch ktrace-lwp on 2004-08-03 10:50:28 +0000
 1.5.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.4.1  29-Apr-2005  kent sync with -current
 1.6.4.6  17-Mar-2008  yamt sync with head.
 1.6.4.5  21-Jan-2008  yamt sync with head
 1.6.4.4  27-Oct-2007  yamt sync with head.
 1.6.4.3  03-Sep-2007  yamt sync with head.
 1.6.4.2  30-Dec-2006  yamt sync with head.
 1.6.4.1  21-Jun-2006  yamt sync with head.
 1.7.12.2  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.7.12.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.7.10.1  19-Apr-2006  elad sync with head.
 1.7.8.2  14-Sep-2006  yamt sync with head.
 1.7.8.1  01-Apr-2006  yamt sync with head.
 1.7.6.1  22-Apr-2006  simonb Sync with head.
 1.7.4.1  09-Sep-2006  rpaulo sync with head
 1.10.8.1  12-Mar-2007  rmind Sync with HEAD.
 1.11.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.11.16.3  23-Mar-2008  matt sync with HEAD
 1.11.16.2  09-Jan-2008  matt sync with HEAD
 1.11.16.1  06-Nov-2007  matt sync with HEAD
 1.11.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.11.2.1  23-Oct-2007  ad Sync with head.
 1.12.8.1  08-Jan-2008  bouyer Sync with HEAD
 1.12.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.13.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.13.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.13.2.1  24-Mar-2008  keiichi sync with head.
 1.14.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.14.4.3  11-Aug-2010  yamt sync with head.
 1.14.4.2  11-Mar-2010  yamt sync with head
 1.14.4.1  04-May-2009  yamt sync with head.
 1.17.4.1  30-May-2010  rmind sync with head
 1.17.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.18.36.2  05-Feb-2017  skrll Sync with HEAD
 1.18.36.1  19-Mar-2016  skrll Sync with HEAD
 1.18.18.1  03-Dec-2017  jdolecek update from HEAD
 1.19.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.21.14.2  28-Jul-2018  pgoyette Sync with HEAD
 1.21.14.1  25-Jun-2018  pgoyette Sync with HEAD
 1.21.8.2  24-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.21.8.1  26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.23.8.1  23-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #371):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/arch/arm/sunxi/sunxi_can.c: revision 1.2
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_ipackets is incremented in can_input(), so don't increment it in
sunxi_can_rx_intr to prevent double count. OK'd by bouyer@.

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.23.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.23.2.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.24.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed