From: Stefan Kerkmann <s.kerkmann@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>
Cc: Stefan Kerkmann <s.kerkmann@pengutronix.de>
Subject: [PATCH 1/4] net: usb: r8152: disable rx aggregation
Date: Thu, 07 Aug 2025 17:53:10 +0200 [thread overview]
Message-ID: <20250807-fix-rtl8152-dropped-packages-v1-1-a71d05b4d166@pengutronix.de> (raw)
In-Reply-To: <20250807-fix-rtl8152-dropped-packages-v1-0-a71d05b4d166@pengutronix.de>
Enabling RX aggregation packs multiple ethernet frames into one usb bulk
transfer. This increases the throughput significantly, but the driver
currently has no logic in `r8152_rx_fixup` to split the received frames.
This causes silently dropped packets. As the expected througput in a
bootloader using a USB ethernet adapter is rather low this "workaround"
is fine for now.
Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
drivers/net/usb/r8152.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 2511c524cd6933cd9de844970edcdaa26a62b8e5..e29dd2ba43cedd9204f9cc418975ba1ace4f5167 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -926,10 +926,9 @@ static void r8153_first_init(struct r8152 *tp)
r8152_ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL,
TXFIFO_THR_NORMAL2);
- /* rx aggregation */
+ /* Disable rx aggregation */
ocp_data = r8152_ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
-
- ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
+ ocp_data |= (RX_AGG_DISABLE | RX_ZERO_EN);
r8152_ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
}
@@ -1117,10 +1116,9 @@ static void rtl8152b_init(struct r8152 *tp)
r8152b_enable_fc(tp);
rtl_tally_reset(tp);
- /* enable rx aggregation */
+ /* Disable rx aggregation */
ocp_data = r8152_ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
-
- ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
+ ocp_data |= (RX_AGG_DISABLE | RX_ZERO_EN);
r8152_ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
}
@@ -1259,9 +1257,9 @@ static void r8153b_init(struct r8152 *tp)
}
}
- /* rx aggregation */
+ /* Disable rx aggregation */
ocp_data = r8152_ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
- ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
+ ocp_data |= (RX_AGG_DISABLE | RX_ZERO_EN);
r8152_ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
rtl_tally_reset(tp);
--
2.39.5
next prev parent reply other threads:[~2025-08-07 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 15:53 [PATCH 0/4] " Stefan Kerkmann
2025-08-07 15:53 ` Stefan Kerkmann [this message]
2025-08-07 15:53 ` [PATCH 2/4] net: usb: r8152: print the detected version Stefan Kerkmann
2025-08-07 15:53 ` [PATCH 3/4] net: usb: usbnet: calm noisy debug calls Stefan Kerkmann
2025-08-07 15:53 ` [PATCH 4/4] net: usb: add debug call in the receive path Stefan Kerkmann
2025-08-08 8:52 ` [PATCH 0/4] net: usb: r8152: disable rx aggregation Sascha Hauer
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=20250807-fix-rtl8152-dropped-packages-v1-1-a71d05b4d166@pengutronix.de \
--to=s.kerkmann@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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