Make ifq and ifiq interface MP safe.
authorbluhm <bluhm@openbsd.org>
Fri, 10 Nov 2023 15:51:19 +0000 (15:51 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 10 Nov 2023 15:51:19 +0000 (15:51 +0000)
commitcf96265bb25b08cea5a0b5654925448396fd9df0
tree31449762ca1799e0ad0a9fda62e6a504ec945940
parent851351478282e4dd75b05b8351e1fc4a91b967b2
Make ifq and ifiq interface MP safe.

Rename ifq_set_maxlen() to ifq_init_maxlen().  This function neither
uses WRITE_ONCE() nor a mutex and is called before the ifq mutex
is initialized.  The new name expresses that it should be used only
during interface attach when there is no concurrency.

Protect ifq_len(), ifq_empty(), ifiq_len(), and ifiq_empty() with
READ_ONCE().  They can be used without lock as they only read a
single integer.

OK dlg@
71 files changed:
sys/arch/armv7/omap/if_cpsw.c
sys/arch/armv7/sunxi/sxie.c
sys/arch/octeon/dev/if_cnmac.c
sys/dev/fdt/if_dwge.c
sys/dev/fdt/if_dwxe.c
sys/dev/fdt/if_mvneta.c
sys/dev/fdt/if_mvpp.c
sys/dev/ic/acx.c
sys/dev/ic/aic6915.c
sys/dev/ic/ath.c
sys/dev/ic/bcmgenet.c
sys/dev/ic/bwi.c
sys/dev/ic/dc.c
sys/dev/ic/dwqe.c
sys/dev/ic/elink3.c
sys/dev/ic/fxp.c
sys/dev/ic/gem.c
sys/dev/ic/malo.c
sys/dev/ic/pgt.c
sys/dev/ic/re.c
sys/dev/ic/smc83c170.c
sys/dev/ic/ti.c
sys/dev/ic/xl.c
sys/dev/pci/if_age.c
sys/dev/pci/if_alc.c
sys/dev/pci/if_ale.c
sys/dev/pci/if_aq_pci.c
sys/dev/pci/if_bge.c
sys/dev/pci/if_bnx.c
sys/dev/pci/if_bnxt.c
sys/dev/pci/if_cas.c
sys/dev/pci/if_em.c
sys/dev/pci/if_et.c
sys/dev/pci/if_iavf.c
sys/dev/pci/if_igc.c
sys/dev/pci/if_ix.c
sys/dev/pci/if_ixgb.c
sys/dev/pci/if_ixl.c
sys/dev/pci/if_jme.c
sys/dev/pci/if_lge.c
sys/dev/pci/if_mcx.c
sys/dev/pci/if_msk.c
sys/dev/pci/if_myx.c
sys/dev/pci/if_nfe.c
sys/dev/pci/if_ngbe.c
sys/dev/pci/if_nge.c
sys/dev/pci/if_nxe.c
sys/dev/pci/if_oce.c
sys/dev/pci/if_pcn.c
sys/dev/pci/if_rge.c
sys/dev/pci/if_se.c
sys/dev/pci/if_sis.c
sys/dev/pci/if_sk.c
sys/dev/pci/if_ste.c
sys/dev/pci/if_stge.c
sys/dev/pci/if_tht.c
sys/dev/pci/if_tl.c
sys/dev/pci/if_txp.c
sys/dev/pci/if_vge.c
sys/dev/pci/if_vic.c
sys/dev/pci/if_vmx.c
sys/dev/pci/if_vte.c
sys/dev/pci/if_wb.c
sys/dev/pci/if_xge.c
sys/dev/pv/if_hvn.c
sys/dev/pv/if_vio.c
sys/dev/pv/if_xnf.c
sys/net/if.c
sys/net/if_spppsubr.c
sys/net/ifq.c
sys/net/ifq.h