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.kerkm...@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


Reply via email to