From: Jakub Kicinski <kuba@kernel.org>
To: Hayes Wang <hayeswang@realtek.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>
Subject: Re: [PATCH net v2] r8152: avoid the driver drops a lot of packets
Date: Wed, 6 Sep 2023 17:28:47 -0700 [thread overview]
Message-ID: <20230906172847.2b3b749a@kernel.org> (raw)
In-Reply-To: <20230906031148.16774-421-nic_swsd@realtek.com>
On Wed, 6 Sep 2023 11:11:48 +0800 Hayes Wang wrote:
> Stop submitting rx, if the driver queue more than 256 packets.
>
> If the hardware is more fast than the software, the driver would start
> queuing the packets. And, the driver starts dropping the packets, if it
> queues more than 1000 packets.
>
> Increase the weight of NAPI could improve the situation. However, the
> weight has been changed to 64, so we have to stop submitting rx when the
> driver queues too many packets. Then, the device may send the pause frame
> to slow down the receiving, when the FIFO of the device is full.
Good to see that you can repro the problem.
Before we tweak the heuristics let's make sure rx_bottom() behaves
correctly. Could you make sure that
- we don't perform _any_ rx processing when budget is 0
(see the NAPI documentation under Documentation/networking)
- finish the current aggregate even if budget run out, return
work_done = budget in that case.
With this change the rx_queue thing should be gone completely.
- instead of copying the head use napi_get_frags() + napi_gro_frags()
it gives you an skb, you just attach the page to it as a frag and
hand it back to GRO. This makes sure you never pull data into head
rather than just headers.
Please share the performance results with those changes.
--
pw-bot: cr
next prev parent reply other threads:[~2023-09-07 0:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 3:11 [PATCH net v2] r8152: avoid the driver drops a lot of packets Hayes Wang
2023-09-07 0:28 ` Jakub Kicinski [this message]
2023-09-07 7:16 ` Hayes Wang
2023-09-07 16:38 ` Jakub Kicinski
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=20230906172847.2b3b749a@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=hayeswang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.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).