From: Martin Schiller <ms@dev.tdt.de>
To: Xie He <xie.he.0141@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Linux X25 <linux-x25@vger.kernel.org>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH net] net: hdlc_x25: Use qdisc to queue outgoing LAPB frames
Date: Mon, 01 Feb 2021 14:14:41 +0100 [thread overview]
Message-ID: <1628f9442ccf18f9c08c98f122053fc0@dev.tdt.de> (raw)
In-Reply-To: <CAJht_ENs1Rnf=2iX8M1ufF=StWHKTei3zuKv-xBtkhDsY-xBOA@mail.gmail.com>
On 2021-02-01 12:38, Xie He wrote:
> On Mon, Feb 1, 2021 at 1:18 AM Martin Schiller <ms@dev.tdt.de> wrote:
>>
>> I have thought about this issue again.
>>
>> I also have to say that I have never noticed any problems in this area
>> before.
>>
>> So again for (my) understanding:
>> When a hardware driver calls netif_stop_queue, the frames sent from
>> layer 3 (X.25) with dev_queue_xmit are queued and not passed
>> "directly"
>> to x25_xmit of the hdlc_x25 driver.
>>
>> So nothing is added to the write_queue anymore (except possibly
>> un-acked-frames by lapb_requeue_frames).
>
> If the LAPB module only emits an L2 frame when an L3 packet comes from
> the upper layer, then yes, there would be no problem because the L3
> packet is already controlled by the qdisc and there is no need to
> control the corresponding L2 frame again.
>
> However, the LAPB module can emits L2 frames when there's no L3 packet
> coming, when 1) there are some packets queued in the LAPB module's
> internal queue; and 2) the LAPB decides to send some control frame
> (e.g. by the timers).
But control frames are currently sent past the lapb write_queue.
So another queue would have to be created.
And wouldn't it be better to have it in the hdlc_x25 driver, leaving
LAPB unaffected?
>
>> Shouldn't it actually be sufficient to check for netif_queue_stopped
>> in
>> lapb_kick and then do "nothing" if necessary?
>
> We can consider this situation: When the upper layer has nothing to
> send, but there are some packets in the LAPB module's internal queue
> waiting to be sent. The LAPB module will try to send the packets, but
> after it has sent out the first packet, it will meet the "queue
> stopped" situation. In this situation, it'd be preferable to
> immediately start sending the second packet after the queue is started
> again. "Doing nothing" in this situation would mean waiting until some
> other events occur, such as receiving responses from the other side,
> or receiving more outgoing packets from L3.
>
>> As soon as the hardware driver calls netif_wake_queue, the whole thing
>> should just continue running.
>
> This relies on the fact that the upper layer has something to send. If
> the upper layer has nothing to send, lapb_kick would not be
> automatically called again until some other events occur (such as
> receiving responses from the other side). I think it'd be better if we
> do not rely on the assumption that L3 is going to send more packets to
> us, as L3 itself would assume us to provide it a reliable link service
> and we should fulfill its expectation.
next prev parent reply other threads:[~2021-02-01 13:17 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
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 [this message]
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=1628f9442ccf18f9c08c98f122053fc0@dev.tdt.de \
--to=ms@dev.tdt.de \
--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=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).