netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Qingfang Deng <dqfext@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-ppp@vger.kernel.org
Subject: Re: [RFC PATCH net-next] net: ppp: convert to IFF_NO_QUEUE
Date: Tue, 05 Nov 2024 15:35:18 +0100	[thread overview]
Message-ID: <87a5ed92ah.fsf@toke.dk> (raw)
In-Reply-To: <CALW65jbz=3JNTx-SWk21DT4yc+oD3Dsz49z__zgDXF7TjUV7Lw@mail.gmail.com>

Qingfang Deng <dqfext@gmail.com> writes:

> Hi Toke,
>
> On Tue, Nov 5, 2024 at 8:24 PM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>>
>> Qingfang Deng <dqfext@gmail.com> writes:
>>
>> > When testing the parallel TX performance of a single PPPoE interface
>> > over a 2.5GbE link with multiple hardware queues, the throughput could
>> > not exceed 1.9Gbps, even with low CPU usage.
>> >
>> > This issue arises because the PPP interface is registered with a single
>> > queue and a tx_queue_len of 3. This default behavior dates back to Linux
>> > 2.3.13, which was suitable for slower serial ports. However, in modern
>> > devices with multiple processors and hardware queues, this configuration
>> > can lead to congestion.
>> >
>> > For PPPoE/PPTP, the lower interface should handle qdisc, so we need to
>> > set IFF_NO_QUEUE.
>>
>> This bit makes sense - the PPPoE and PPTP channel types call through to
>> the underlying network stack, and their start_xmit() ops never return
>> anything other than 1 (so there's no pushback against the upper PPP
>> device anyway). The same goes for the L2TP PPP channel driver.
>>
>> > For PPP over a serial port, we don't benefit from a qdisc with such a
>> > short TX queue, so handling TX queueing in the driver and setting
>> > IFF_NO_QUEUE is more effective.
>>
>> However, this bit is certainly not true. For the channel drivers that
>> do push back (which is everything apart from the three mentioned above,
>> AFAICT), we absolutely do want a qdisc to store the packets, instead of
>> this arbitrary 32-packet FIFO inside the driver. Your comment about the
>> short TX queue only holds for the pfifo_fast qdisc (that's the only one
>> that uses the tx_queue_len for anything), anything else will do its own
>> thing.
>>
>> (Side note: don't use pfifo_fast!)
>>
>> I suppose one option here could be to set the IFF_NO_QUEUE flag
>> conditionally depending on whether the underlying channel driver does
>> pushback against the PPP device or not (add a channel flag to indicate
>> this, or something), and then call the netif_{wake,stop}_queue()
>> functions conditionally depending on this. But setting the noqueue flag
>> unconditionally like this patch does, is definitely not a good idea!
>
> I agree. Then the problem becomes how to test if a PPP device is a PPPoE.
> It seems like PPPoE is the only one that implements
> ops->fill_forward_path, should I use that? Or is there a better way?

Just add a new field to struct ppp_channel and have the PPoE channel
driver set that? Could be a flags field, or even just a 'bool
direct_xmit' field...

-Toke


  reply	other threads:[~2024-11-05 14:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 10:36 [RFC PATCH net-next] net: ppp: convert to IFF_NO_QUEUE Qingfang Deng
2024-11-04 11:50 ` Simon Horman
2024-11-05 11:47   ` Toke Høiland-Jørgensen
2024-11-07 14:51     ` Simon Horman
2024-11-05 12:23 ` Toke Høiland-Jørgensen
2024-11-05 14:25   ` Qingfang Deng
2024-11-05 14:35     ` Toke Høiland-Jørgensen [this message]
2024-11-05 15:04       ` Qingfang Deng

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=87a5ed92ah.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).