From: Alexander Aring <alex.aring@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Stefan Schmidt <stefan@datenfreihafen.org>,
linux-wpan - ML <linux-wpan@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
David Girault <david.girault@qorvo.com>,
Romuald Despres <romuald.despres@qorvo.com>,
Frederic Blain <frederic.blain@qorvo.com>,
Nicolas Schodet <nico@ni.fr.eu.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v5 05/11] net: mac802154: Create a transmit bus error helper
Date: Wed, 6 Apr 2022 17:43:30 -0400 [thread overview]
Message-ID: <CAB_54W53OrQVYo4pjCpgYaQGVsa-hZ2gBrquFGO_vQ5RMsm-jQ@mail.gmail.com> (raw)
In-Reply-To: <20220406153441.1667375-6-miquel.raynal@bootlin.com>
Hi,
On Wed, Apr 6, 2022 at 11:34 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> A few drivers do the full transmit operation asynchronously, which means
> that a bus error that happens when forwarding the packet to the
> transmitter will not be reported immediately. The solution in this case
> is to call this new helper to free the necessary resources, restart the
> the queue and return a generic TRAC error code: IEEE802154_SYSTEM_ERROR.
>
> Suggested-by: Alexander Aring <alex.aring@gmail.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> include/net/mac802154.h | 9 +++++++++
> net/mac802154/util.c | 10 ++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/include/net/mac802154.h b/include/net/mac802154.h
> index abbe88dc9df5..5240d94aad8e 100644
> --- a/include/net/mac802154.h
> +++ b/include/net/mac802154.h
> @@ -498,6 +498,15 @@ void ieee802154_stop_queue(struct ieee802154_hw *hw);
> void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
> bool ifs_handling);
>
> +/**
> + * ieee802154_xmit_bus_error - frame could not be delivered to the trasmitter
> + * because of a bus error
> + *
> + * @hw: pointer as obtained from ieee802154_alloc_hw().
> + * @skb: buffer for transmission
> + */
> +void ieee802154_xmit_bus_error(struct ieee802154_hw *hw, struct sk_buff *skb);
> +
> /**
> * ieee802154_xmit_error - frame transmission failed
> *
> diff --git a/net/mac802154/util.c b/net/mac802154/util.c
> index ec523335336c..79ba803c40c9 100644
> --- a/net/mac802154/util.c
> +++ b/net/mac802154/util.c
> @@ -102,6 +102,16 @@ void ieee802154_xmit_error(struct ieee802154_hw *hw, struct sk_buff *skb,
> }
> EXPORT_SYMBOL(ieee802154_xmit_error);
>
> +void ieee802154_xmit_bus_error(struct ieee802154_hw *hw, struct sk_buff *skb)
> +{
> + struct ieee802154_local *local = hw_to_local(hw);
> +
> + local->tx_result = IEEE802154_SYSTEM_ERROR;
> + ieee802154_wake_queue(hw);
> + dev_kfree_skb_any(skb);
> +}
> +EXPORT_SYMBOL(ieee802154_xmit_bus_error);
> +
why not calling ieee802154_xmit_error(..., IEEE802154_SYSTEM_ERROR) ?
Just don't give the user a chance to pick a error code if something
bad happened.
- Alex
next prev parent reply other threads:[~2022-04-06 21:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 15:34 [PATCH v5 00/11] ieee802154: Better Tx error handling Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 01/11] net: ieee802154: Enhance/fix the names of the MLME return codes Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 02/11] net: ieee802154: Fill the list of " Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 03/11] net: mac802154: Save a global error code on transmissions Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 04/11] net: mac802154: Create a transmit error helper Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 05/11] net: mac802154: Create a transmit bus " Miquel Raynal
2022-04-06 21:43 ` Alexander Aring [this message]
2022-04-07 7:56 ` Miquel Raynal
2022-04-07 10:02 ` Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 06/11] net: ieee802154: at86rf230: Rename the asynchronous " Miquel Raynal
2022-04-06 21:57 ` Alexander Aring
2022-04-07 8:05 ` Miquel Raynal
2022-04-25 12:22 ` Alexander Aring
2022-04-06 15:34 ` [PATCH v5 07/11] net: ieee802154: at86rf230: Call _xmit_bus_error() when a bus error occurs Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 08/11] net: ieee802154: at86rf230: Drop debugfs support Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 09/11] net: ieee802154: atusb: Call _xmit_error() when a transmission fails Miquel Raynal
2022-04-06 21:58 ` Alexander Aring
2022-04-07 8:06 ` Miquel Raynal
2022-04-25 12:35 ` Alexander Aring
2022-04-25 13:05 ` Alexander Aring
2022-04-25 13:16 ` Miquel Raynal
2022-04-25 13:43 ` Alexander Aring
2022-04-06 15:34 ` [PATCH v5 10/11] net: ieee802154: ca8210: Use core return codes instead of hardcoding them Miquel Raynal
2022-04-06 15:34 ` [PATCH v5 11/11] net: ieee802154: ca8210: Call _xmit_error() when a transmission fails Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAB_54W53OrQVYo4pjCpgYaQGVsa-hZ2gBrquFGO_vQ5RMsm-jQ@mail.gmail.com \
--to=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=david.girault@qorvo.com \
--cc=frederic.blain@qorvo.com \
--cc=kuba@kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=nico@ni.fr.eu.org \
--cc=romuald.despres@qorvo.com \
--cc=stefan@datenfreihafen.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).