From: David Laight <David.Laight@ACULAB.COM>
To: 'Xie He' <xie.he.0141@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"linux-x25@vger.kernel.org" <linux-x25@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Martin Schiller <ms@dev.tdt.de>,
"Krzysztof Halasa" <khc@pm.waw.pl>
Subject: RE: [PATCH net] net: hdlc_x25: Use qdisc to queue outgoing LAPB frames
Date: Wed, 27 Jan 2021 10:14:10 +0000 [thread overview]
Message-ID: <77971dffcff441c3ad3d257825dc214b@AcuMS.aculab.com> (raw)
In-Reply-To: <20210127090747.364951-1-xie.he.0141@gmail.com>
From: Xie He
> Sent: 27 January 2021 09:08
>
> An HDLC hardware driver may call netif_stop_queue to temporarily stop
> the TX queue when the hardware is busy sending a frame, and after the
> hardware has finished sending the frame, call netif_wake_queue to
> resume the TX queue.
>
> However, the LAPB module doesn't know about this. Whether or not the
> hardware driver has stopped the TX queue, the LAPB module still feeds
> outgoing frames to the hardware driver for transmission. This can cause
> frames to be dropped by the hardware driver.
>
> It's not easy to fix this issue in the LAPB module. We can indeed let the
> LAPB module check whether the TX queue has been stopped before feeding
> each frame to the hardware driver, but when the hardware driver resumes
> the TX queue, it's not easy to immediately notify the LAPB module and ask
> it to resume transmission.
>
> Instead, we can fix this issue at the hdlc_x25 layer, by using qdisc TX
> queues to queue outgoing LAPB frames. The qdisc TX queue will then
> automatically be controlled by netif_stop_queue and netif_wake_queue.
>
> This way, when sending, we will use the qdisc queue to queue and send
> the data twice: once as the L3 packet and then (after processed by the
> LAPB module) as an LAPB (L2) frame. This does not make the logic of the
> code messy, because when receiving, data are already "received" on the
> device twice: once as an LAPB (L2) frame and then (after processed by
> the LAPB module) as the L3 packet.
If I read this correctly it adds a (potentially big) queue between the
LAPB code that adds the sequence numbers to the frames and the hardware
that actually sends them.
IIRC [1] there is a general expectation that the NR in a transmitted frame
will be the same as the last received NS unless acks are being delayed
for flow control reasons.
You definitely want to be able to ack a received frame while transmitting
back-to-back I-frames.
This really means that you only want 2 frames in the hardware driver.
The one being transmitted and the next one - so it gets sent with a
shared flag.
There is no point sending an RR unless the hardware link is actually idle.
[1] I've been doing to much SS7 MTP2 recently, I can't quite remember
all of LAPB!
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2021-01-27 10:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 9:07 [PATCH net] net: hdlc_x25: Use qdisc to queue outgoing LAPB frames Xie He
2021-01-27 10:14 ` David Laight [this message]
2021-01-27 20:29 ` Xie He
2021-01-28 6:39 ` Martin Schiller
2021-01-28 19:46 ` Jakub Kicinski
2021-01-28 22:06 ` Xie He
2021-01-29 5:56 ` Martin Schiller
2021-01-30 1:36 ` Jakub Kicinski
2021-01-30 14:29 ` Xie He
2021-01-30 19:16 ` Jakub Kicinski
2021-01-31 3:16 ` Xie He
2021-02-01 9:18 ` Martin Schiller
2021-02-01 11:38 ` Xie He
2021-02-01 13:14 ` Martin Schiller
2021-02-01 14:02 ` Xie He
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=77971dffcff441c3ad3d257825dc214b@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=davem@davemloft.net \
--cc=khc@pm.waw.pl \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=netdev@vger.kernel.org \
--cc=xie.he.0141@gmail.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).