All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@mandelbit.com>
To: netdev@vger.kernel.org
Cc: "Subash Abhinov Kasiviswanathan"
	<subash.a.kasiviswanathan@oss.qualcomm.com>,
	"Sean Tranchetti" <sean.tranchetti@oss.qualcomm.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Daniele Palmas" <dnlplm@gmail.com>,
	"Koen Vandeputte" <koen.vandeputte@citymesh.com>,
	"Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>,
	"Antonio Quartulli" <antonio@mandelbit.com>
Subject: [PATCH net-next v2 3/3] net: qualcomm: rmnet: fix TX aggregation timeout overflow on 32-bit
Date: Fri, 27 Nov 2026 16:08:27 +0100	[thread overview]
Message-ID: <20261127150827.785753-4-antonio@mandelbit.com> (raw)
In-Reply-To: <20261127150827.785753-1-antonio@mandelbit.com>

On 32-bit, time * NSEC_PER_USEC is computed in 32 bits before being
stored in the u64 time_nsec, so a tx-aggr-time-usecs above 4294967
wraps: 5000000 is stored as 705032704 ns and read back as 705032.

Reproducer:

  ethtool -C rmnet0 tx-aggr-max-frames 64 tx-aggr-time-usecs 5000000
  ethtool -c rmnet0

Do the multiplication in 64 bits.

Fixes: 64b5d1f8f2d1 ("net: qualcomm: rmnet: add tx packets aggregation")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 033699aa0385..46dcfba86b3f 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -686,7 +686,7 @@ void rmnet_map_update_ul_agg_config(struct rmnet_port *port, u32 size,
 	spin_lock_bh(&port->agg_lock);
 	port->egress_agg_params.bytes = size;
 	WRITE_ONCE(port->egress_agg_params.count, count);
-	port->egress_agg_params.time_nsec = time * NSEC_PER_USEC;
+	port->egress_agg_params.time_nsec = (u64)time * NSEC_PER_USEC;
 	spin_unlock_bh(&port->agg_lock);
 }
 
-- 
2.56.1


  parent reply	other threads:[~2026-11-27 15:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 15:08 [PATCH net-next v2 0/3] net: qualcomm: rmnet: fix TX aggregation bugs Antonio Quartulli
2026-11-27 15:08 ` [PATCH net-next v2 1/3] net: qualcomm: rmnet: recheck the aggregate after flushing it Antonio Quartulli
2026-11-28 15:39   ` netdev-bot+sashiko
2026-11-30 13:37     ` Antonio Quartulli
2026-11-27 15:08 ` [PATCH net-next v2 2/3] net: qualcomm: rmnet: always arm the flush timer for a new aggregate Antonio Quartulli
2026-11-27 15:08 ` Antonio Quartulli [this message]
2026-11-27 15:14 ` [PATCH net-next v2 0/3] net: qualcomm: rmnet: fix TX aggregation bugs netdev-bot+sinfo
2026-11-27 15:16   ` Antonio Quartulli

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=20261127150827.785753-4-antonio@mandelbit.com \
    --to=antonio@mandelbit.com \
    --cc=Jeremy.Jean@oss.cyber.gouv.fr \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dnlplm@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=koen.vandeputte@citymesh.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.tranchetti@oss.qualcomm.com \
    --cc=subash.a.kasiviswanathan@oss.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.