diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-11-10 15:51:25 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2023-11-10 15:51:25 +0000 |
commit | 67680ffa08ea8739b777a8b57ac3ac62eb1b1c2f (patch) | |
tree | 28d84f0566badb4b35cd162f9bb53a93e96e75d0 /sys/dev/pci/if_oce.c | |
parent | 69fb630aba24c73ac8c8c98da1b02370f5cc9489 (diff) |
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@
Diffstat (limited to 'sys/dev/pci/if_oce.c')
-rw-r--r-- | sys/dev/pci/if_oce.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index 2a01f022d94..1e2710c4a87 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.107 2023/04/28 10:18:58 bluhm Exp $ */ +/* $OpenBSD: if_oce.c,v 1.108 2023/11/10 15:51:20 bluhm Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -823,7 +823,7 @@ oce_attach_ifp(struct oce_softc *sc) ifp->if_watchdog = oce_watchdog; ifp->if_hardmtu = OCE_MAX_MTU; ifp->if_softc = sc; - ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_size - 1); + ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_size - 1); ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 | IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4; |