lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB_54W562uzk3NzXDTgRLbQzi=hgQDntJOqmMDVZwaJ_eDZZMQ@mail.gmail.com>
Date:   Mon, 17 Jan 2022 17:43:49 -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>,
        "open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
        "linux-wireless@...r.kernel.org Wireless" 
        <linux-wireless@...r.kernel.org>,
        David Girault <david.girault@...vo.com>,
        Romuald Despres <romuald.despres@...vo.com>,
        Frederic Blain <frederic.blain@...vo.com>,
        Nicolas Schodet <nico@...fr.eu.org>,
        Michael Hennerich <michael.hennerich@...log.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Varka Bhadram <varkabhadram@...il.com>,
        Xue Liu <liuxuenetmail@...il.com>, Alan Ott <alan@...nal11.us>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v3 27/41] net: mac802154: Introduce a tx queue flushing mechanism

Hi,

On Mon, 17 Jan 2022 at 06:55, Miquel Raynal <miquel.raynal@...tlin.com> wrote:
...
>
>         /* stop hardware - this must stop RX */
> diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
> index 0291e49058f2..37d5438fdb3f 100644
> --- a/net/mac802154/ieee802154_i.h
> +++ b/net/mac802154/ieee802154_i.h
> @@ -122,6 +122,7 @@ extern struct ieee802154_mlme_ops mac802154_mlme_wpan;
>
>  void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb);
>  void ieee802154_xmit_sync_worker(struct work_struct *work);
> +void ieee802154_sync_tx(struct ieee802154_local *local);
>  netdev_tx_t
>  ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
>  netdev_tx_t
> diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
> index de5ecda80472..d1fd2cc67cbe 100644
> --- a/net/mac802154/tx.c
> +++ b/net/mac802154/tx.c
> @@ -48,6 +48,7 @@ void ieee802154_xmit_sync_worker(struct work_struct *work)
>
>         kfree_skb(skb);
>         atomic_dec(&local->phy->ongoing_txs);
> +       wake_up(&local->phy->sync_txq);

if (atomic_dec_and_test(&hw->phy->ongoing_txs))
      wake_up(&hw->phy->sync_txq);

>         netdev_dbg(dev, "transmission failed\n");
>  }
>
> @@ -117,6 +118,11 @@ ieee802154_hot_tx(struct ieee802154_local *local, struct sk_buff *skb)
>         return ieee802154_tx(local, skb);
>  }
>
> +void ieee802154_sync_tx(struct ieee802154_local *local)
> +{
> +       wait_event(local->phy->sync_txq, !atomic_read(&local->phy->ongoing_txs));
> +}
> +
>  netdev_tx_t
>  ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
> diff --git a/net/mac802154/util.c b/net/mac802154/util.c
> index db2ac53b937e..230fe3390df7 100644
> --- a/net/mac802154/util.c
> +++ b/net/mac802154/util.c
> @@ -90,6 +90,7 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
>  after_wakeup:
>         dev_consume_skb_any(skb);
>         atomic_dec(&hw->phy->ongoing_txs);
> +       wake_up(&hw->phy->sync_txq);

if (atomic_dec_and_test(&hw->phy->ongoing_txs))
      wake_up(&hw->phy->sync_txq);

- Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ