Thread (30 messages) 30 messages, 3 authors, 2023-12-11

Re: [PATCH v7 net-next 5/8] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2023-12-04 13:48:37

On Fri, Dec 01, 2023 at 03:57:59PM +0200, Roger Quadros wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c
index 49ae9d1cd948..2733bac55bfa 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-qos.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c
@@ -15,6 +15,8 @@
 #include "am65-cpts.h"
 #include "cpsw_ale.h"
 
+#define TO_MBPS(x)	((x) * 8 / 1000000)
Can be rewritten as ((x) * BITS_PER_BYTE / MEGA)

and further as ((x) / BYTES_PER_MBIT).

Also, I wonder if it wouldn't be better to do a DIV_ROUND_UP(x, BYTES_PER_MBIT)
instead. When user space requests a certain bandwidth, it expects to get it.
If the hardware is not fine grained enough, it should prefer giving it slightly
more rather than slightly less.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help