Source-Changes-D archive

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

Re: CVS commit: src/sys/dev/pci





On 03/08/2022 07:26, Kengo NAKAHARA wrote:
Hi,

On 2022/08/03 14:23, Nick Hudson wrote:
Module Name:    src
Committed By:    skrll
Date:        Wed Aug  3 05:23:30 UTC 2022

Modified Files:
    src/sys/dev/pci: if_wm.c

Log Message:
Add some KASSERTs around the locking protocol.

Discussed with msaitoh@, knakahara@ and riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.749 -r1.750 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Will you add "KASSERT(IFNET_LOCKED(ifp))" to all ethernet device driver
init routine?  If not, why the code is added wm(4) only?

Good questions.

While I don't see the problem with documenting the locking protocol this
way and flushing out bugs with the KASSERTs I don't proposed to
(personally) add them to every driver at this time.

My motivation here is is that I'm making bge(4) MP safe and using wm(4)
as a reference. It's even mentioned as a reference for the if_percpuq
framework.

	https://nxr.netbsd.org/xref/src/sys/net/if.c#814

Perhaps as a driver is made MP safe it can also have similar KASSERTs added?

Nick



Home | Main Index | Thread Index | Old Index