linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Alexander Aring <aahringo@redhat.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	linux-wpan - ML <linux-wpan@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Network Development <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 wpan-next v2 02/14] net: mac802154: Create a transmit error helper
Date: Mon, 21 Feb 2022 15:22:40 -0500	[thread overview]
Message-ID: <CAB_54W6iBmxnRjdjmbWTPzci0za7Lu5UwVFqLJsjQFacxAYQYQ@mail.gmail.com> (raw)
In-Reply-To: <CAK-6q+iebK43LComxxjvg0pBiD_AK0MMyMucLHmeVG2zbHPErQ@mail.gmail.com>

Hi,

On Sun, Feb 20, 2022 at 6:31 PM Alexander Aring <aahringo@redhat.com> wrote:
>
> Hi,
>
> On Mon, Feb 7, 2022 at 10:09 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > So far there is only a helper for successful transmission, which led
> > device drivers to implement their own handling in case of
> > error. Unfortunately, we really need all the drivers to give the hand
> > back to the core once they are done in order to be able to build a
> > proper synchronous API. So let's create a _xmit_error() helper.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >  include/net/mac802154.h | 10 ++++++++++
> >  net/mac802154/util.c    | 10 ++++++++++
> >  2 files changed, 20 insertions(+)
> >
> > diff --git a/include/net/mac802154.h b/include/net/mac802154.h
> > index 2c3bbc6645ba..9fe8cfef1ba0 100644
> > --- a/include/net/mac802154.h
> > +++ b/include/net/mac802154.h
> > @@ -498,4 +498,14 @@ 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_error - frame transmission failed
> > + *
> > + * @hw: pointer as obtained from ieee802154_alloc_hw().
> > + * @skb: buffer for transmission
> > + * @ifs_handling: indicate interframe space handling
> > + */
> > +void ieee802154_xmit_error(struct ieee802154_hw *hw, struct sk_buff *skb,
> > +                          bool ifs_handling);
> > +
> >  #endif /* NET_MAC802154_H */
> > diff --git a/net/mac802154/util.c b/net/mac802154/util.c
> > index 6f82418e9dec..9016f634efba 100644
> > --- a/net/mac802154/util.c
> > +++ b/net/mac802154/util.c
> > @@ -102,6 +102,16 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
> >  }
> >  EXPORT_SYMBOL(ieee802154_xmit_complete);
> >
> > +void ieee802154_xmit_error(struct ieee802154_hw *hw, struct sk_buff *skb,
> > +                          bool ifs_handling)
> > +{
> > +       unsigned int skb_len = skb->len;
> > +
> > +       dev_kfree_skb_any(skb);
> > +       ieee802154_xmit_end(hw, ifs_handling, skb_len);
> > +}
>
> Remove ieee802154_xmit_end() function and just call to wake up the
> queue here, also drop the "ifs_handling" parameter here.

I am sorry, I think I should deliver an explanation here... I think
the handling of success and error paths are just too different. In
error there will also never ifs handling in the error path. Also
please note there are not just errors as bus/transceiver errors, in
future transceiver should also deliver [0] to the caller, in sync
transmit it should return those errors to the caller... in async mode
there exists different ways to deliver errors like (no ack) to user
space by using socket error queue, here again is worth to look into
wireless subsystem which have a similar feature.

The errors in [0] are currently ignored but I think should be switched
some time soon or with an additional patch by you to calling
xmit_error with an int for $REASON. Those errors are happening on the
transceiver because some functionality is offloaded. btw: so far I
know some MLME-ops need to know if an ack is received or not.

You can split the functionality somehow it makes sense, but with the
above change I only see the wake up queue is the only thing that both
(success/error) should have in common.

- Alex

[0] https://elixir.bootlin.com/linux/v5.16-rc7/source/drivers/net/ieee802154/at86rf230.c#L670

  reply	other threads:[~2022-02-21 20:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 14:47 [PATCH wpan-next v2 00/14] ieee802154: Synchronous Tx API Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 01/14] net: ieee802154: Move the logic restarting the queue upon transmission Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 02/14] net: mac802154: Create a transmit error helper Miquel Raynal
2022-02-20 23:31   ` Alexander Aring
2022-02-21 20:22     ` Alexander Aring [this message]
2022-02-22  8:43       ` Miquel Raynal
2022-02-24  1:53         ` Alexander Aring
2022-02-07 14:47 ` [PATCH wpan-next v2 03/14] net: ieee802154: at86rf230: Call _xmit_error() when a transmission fails Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 04/14] net: ieee802154: atusb: " Miquel Raynal
2022-02-20 23:35   ` Alexander Aring
2022-02-24  2:00     ` Alexander Aring
2022-02-24 14:43       ` Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 05/14] net: ieee802154: ca8210: " Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 06/14] net: mac802154: Stop exporting ieee802154_wake/stop_queue() Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 07/14] net: mac802154: Rename the synchronous xmit worker Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 08/14] net: mac802154: Rename the main tx_work struct Miquel Raynal
2022-02-07 14:47 ` [PATCH wpan-next v2 09/14] net: mac802154: Follow the count of ongoing transmissions Miquel Raynal
2022-02-07 14:48 ` [PATCH wpan-next v2 10/14] net: mac802154: Hold the transmit queue when relevant Miquel Raynal
2022-02-07 14:48 ` [PATCH wpan-next v2 11/14] net: mac802154: Create a hot tx path Miquel Raynal
2022-02-07 14:48 ` [PATCH wpan-next v2 12/14] net: mac802154: Add a warning in the hot path Miquel Raynal
2022-02-07 14:48 ` [PATCH wpan-next v2 13/14] net: mac802154: Introduce a tx queue flushing mechanism Miquel Raynal
2022-02-20 23:49   ` Alexander Aring
2022-03-03 18:17     ` Miquel Raynal
2022-03-04 10:54       ` Miquel Raynal
2022-03-13 20:43         ` Alexander Aring
2022-03-18 18:11           ` Miquel Raynal
2022-03-27 16:45             ` Alexander Aring
2022-03-29 16:29               ` Miquel Raynal
2022-02-07 14:48 ` [PATCH wpan-next v2 14/14] net: mac802154: Introduce a synchronous API for MLME commands Miquel Raynal
2022-02-20 23:52   ` Alexander Aring
2022-02-21 20:33     ` Alexander Aring
2022-02-21 20:33       ` Alexander Aring

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_54W6iBmxnRjdjmbWTPzci0za7Lu5UwVFqLJsjQFacxAYQYQ@mail.gmail.com \
    --to=alex.aring@gmail.com \
    --cc=aahringo@redhat.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).