tech-kern archive

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

Re: struct ifnet locking [was Re: IFEF_MPSAFE]





On 14/12/2017 10:48, Ryota Ozaki wrote:
On Fri, Dec 8, 2017 at 7:53 PM, Nick Hudson <skrll%netbsd.org@localhost> wrote:


Not sure I follow this. I think we agree that the driver should not use
if_flags in the rx/tx path (anymore).
Yes. Drivers should provide their own method.

Great.


Anyway I updated the document that reflects recent changes:
   http://www.netbsd.org/~ozaki-r/ifnet-locks.v2.diff

Some wording improvement suggestions...

@@ -391,11 +429,33 @@ typedef struct ifnet {
 #define	IFEF_NO_LINK_STATE_CHANGE	__BIT(1)	/* doesn't use link state interrupts */
/*
- * The following if_XXX() handlers don't take KERNEL_LOCK if the interface
- * is set IFEF_MPSAFE:
- *   - if_start
- *   - if_output
- *   - if_ioctl
+ * The guidline to enable IFEF_MPSAFE on an interface

	The guidelines for converting an interface to IFEF_MPSAFE are as follows

+ * Enabling IFEF_MPSAFE on an interface suppress taking KERNEL_LOCK
+ * on the following handlers:

	Enabling IFEF_MPSAFE on an interface suppresses taking KERNEL_LOCK when
	calling the following handlers:

Thanks for working on this.

Nick


Home | Main Index | Thread Index | Old Index