r8152: limit the RX buffer size of RTL8153A for USB 2.0
authorHayes Wang <hayeswang@realtek.com>
Fri, 19 Mar 2021 07:37:21 +0000 (15:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:32:02 +0000 (14:32 +0200)
commit961d9a6e47b9880068317638dbd413b3a5691a25
tree0da7a3f0f049278b1c880289ea4a7dcdd2aadfed
parent2330d46db081367db6b20161ed280b5024799fe8
r8152: limit the RX buffer size of RTL8153A for USB 2.0

[ Upstream commit f91a50d8b51b5c8ef1cfb08115a005bba4250507 ]

If the USB host controller is EHCI, the throughput is reduced from
300Mb/s to 60Mb/s, when the rx buffer size is modified from 16K to
32K.

According to the EHCI spec, the maximum size of the qTD is 20K.
Therefore, when the driver uses more than 20K buffer, the latency
time of EHCI would be increased. And, it let the RTL8153A get worse
throughput.

However, the driver uses alloc_pages() for rx buffer, so I limit
the rx buffer to 16K rather than 20K.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205923
Fixes: ec5791c202ac ("r8152: separate the rx buffer size")
Reported-by: Robert Davies <robdavies1977@gmail.com>
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/r8152.c