[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJht_EMYEvcsOn6QGxGFBeR288ep+vJNxJVan48R8mEoVaVpUg@mail.gmail.com>
Date: Tue, 19 Jan 2021 05:54:26 -0800
From: Xie He <xie.he.0141@...il.com>
To: Martin Schiller <ms@....tdt.de>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Linux X25 <linux-x25@...r.kernel.org>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v2] net: lapb: Add locking to the lapb module
On Tue, Jan 19, 2021 at 3:34 AM Martin Schiller <ms@....tdt.de> wrote:
>
> > 4. In lapb_device_event, replace the "lapb_disconnect_request" call
> > with
> > the content of "lapb_disconnect_request", to avoid trying to hold the
> > lock twice. When I do this, I removed "lapb_start_t1timer" because I
> > don't think it's necessary to start the timer when "NETDEV_GOING_DOWN".
>
> I don't like the code redundancy this creates. Maybe you should move the
> actual functionality from lapb_disconnect_request() to a
> __lapb_disconnect_request(), and in lapb_disconnect_request() call this
> function including locking around it and also in lapb_device_event
> (without locking).
>
> Calling lapb_start_t1timer() on a "NETDEV_GOING_DOWN" event does not
> hurt and is correct from a protocol flow point of view after sending
> the DISC.
Thanks! I created a new __lapb_disconnect_request function and the
code indeed looked cleaner. I'll send a new version.
Powered by blists - more mailing lists