Subject: Re: Fw: [Bug 70071] New: Sending netconsole messages over a bridged network interface doesn't work anymore

From: Toshiaki Makita <[email-masked]>
Date: Thu, 06 Feb 2014 14:44:44 +0900

(2014/02/06 14:05), Cong Wang wrote:
> On Wed, Feb 5, 2014 at 7:58 PM, Toshiaki Makita
> <[email-masked]> wrote:
>> (2014/02/06 6:15), Stephen Hemminger wrote:
>>>
>>>
>>> Begin forwarded message:
>>>
>>> Date: Wed, 5 Feb 2014 04:36:03 -0800
>>> From: "[email-masked]" <[email-masked]>
>>> To: "[email-masked]" <[email-masked]>
>>> Subject: [Bug 70071] New: Sending netconsole messages over a bridged network interface doesn't work anymore
>>
>> Reverting this commit seems to fix the problem.
>> 93d8bf9fb8f3 ("bridge: cleanup netpoll code")
>>
>> In the following code path, p->br->dev->npinfo is NULL at
>> br_netpoll_enable() because __netpoll_setup() assigns ndev->npinfo after
>> calling ndo_netpoll_setup().
>>
>>   __netpoll_setup() -> br_netpoll_setup() -> br_netpoll_enable()
> 
> Yeah, looks like we can just remove that incorrect 'if'.
> Please test the following patch.
> 
> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index e4401a5..bb2b706 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -254,9 +254,6 @@ int br_netpoll_enable(struct net_bridge_port *p, gfp_t gfp)
>         struct netpoll *np;
>         int err;
> 
> -       if (!p->br->dev->npinfo)
> -               return 0;
> -
>         np = kzalloc(sizeof(*p->np), gfp);
>         if (!np)
>                 return -ENOMEM;

Tested this patch with latest net-tree and netconsole works with it.
But I thinks it is better to move that "if" to br_add_if() because if we
don't have npinfo, we don't have to alloc p->np in br_add_if(), right?

Thanks,
Toshiaki Makita