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 Thu, Dec 14, 2017 at 10:41 PM, Nick Hudson <nick.hudson%gmx.co.uk@localhost> wrote:
>
>
> 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. I reflected the suggestions and committed the updated document.

BTW I committed a change that disables IFEF_MPSAFE by default on
all interfaces because it seems that IFEF_MPSAFE requires additional
changes to work safely with it. We should enable it by default if an
interface is guaranteed to be safe.

  ozaki-r



Home | Main Index | Thread Index | Old Index