[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB_54W4PL1ty5XsqRoEKwsy-h8KL9gSGMK6N=HiWJDp6NHsb0A@mail.gmail.com>
Date: Wed, 12 Jan 2022 17:44:02 -0500
From: Alexander Aring <alex.aring@...il.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: Stefan Schmidt <stefan@...enfreihafen.org>,
linux-wpan - ML <linux-wpan@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
Michael Hennerich <michael.hennerich@...log.com>,
Harry Morris <h.morris@...coda.com>,
Varka Bhadram <varkabhadram@...il.com>,
Xue Liu <liuxuenetmail@...il.com>, Alan Ott <alan@...nal11.us>,
David Girault <david.girault@...vo.com>,
Romuald Despres <romuald.despres@...vo.com>,
Frederic Blain <frederic.blain@...vo.com>,
Nicolas Schodet <nico@...fr.eu.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
"linux-wireless@...r.kernel.org Wireless"
<linux-wireless@...r.kernel.org>
Subject: Re: [wpan-next v2 18/27] net: mac802154: Handle scan requests
Hi,
On Wed, 12 Jan 2022 at 12:33, Miquel Raynal <miquel.raynal@...tlin.com> wrote:
...
> + return 0;
> +}
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index c829e4a75325..40656728c624 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -54,6 +54,9 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
> struct net_device *dev = skb->dev;
> int ret;
>
> + if (unlikely(mac802154_scan_is_ongoing(local)))
> + return NETDEV_TX_BUSY;
> +
Please look into the functions "ieee802154_wake_queue()" and
"ieee802154_stop_queue()" which prevent this function from being
called. Call stop before starting scanning and wake after scanning is
done or stopped.
Also there exists a race which exists in your way and also the one
mentioned above. There can still be some transmissions going on... We
need to wait until "all possible" tx completions are done... to be
sure there are really no transmissions going on. However we need to be
sure that a wake cannot be done if a tx completion is done, we need to
avoid it when the scan operation is ongoing as a workaround for this
race.
This race exists and should be fixed in future work?
- Alex
Powered by blists - more mailing lists