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_iavf.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_iavf.c')
-rw-r--r-- | sys/dev/pci/if_iavf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iavf.c b/sys/dev/pci/if_iavf.c index d65769d787b..eff312b6a70 100644 --- a/sys/dev/pci/if_iavf.c +++ b/sys/dev/pci/if_iavf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iavf.c,v 1.11 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: if_iavf.c,v 1.12 2023/11/10 15:51:20 bluhm Exp $ */ /* * Copyright (c) 2013-2015, Intel Corporation @@ -890,7 +890,7 @@ iavf_attach(struct device *parent, struct device *self, void *aux) if (ifp->if_hardmtu == 0) ifp->if_hardmtu = IAVF_HARDMTU; strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ); - ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs); + ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs); ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; #if 0 |