* [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change
@ 2009-07-19 13:06 Yevgeny Petrilin
2009-07-21 20:10 ` David Miller
2009-08-07 2:28 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Yevgeny Petrilin @ 2009-07-19 13:06 UTC (permalink / raw)
To: David Miller; +Cc: netdev
If the net device is identified as "sender" (number of sent packets
is higher then the number of received packets and the incoming packets are
small), set the moderation time to its low limit.
We do it because the incoming packets are acks, and we don't want to delay them
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
drivers/net/mlx4/en_netdev.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 93f4abd..c8a24dc 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -414,6 +414,7 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
unsigned long avg_pkt_size;
unsigned long rx_packets;
unsigned long rx_bytes;
+ unsigned long rx_byte_diff;
unsigned long tx_packets;
unsigned long tx_pkt_diff;
unsigned long rx_pkt_diff;
@@ -437,6 +438,8 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
rx_pkt_diff = ((unsigned long) (rx_packets -
priv->last_moder_packets));
packets = max(tx_pkt_diff, rx_pkt_diff);
+ rx_byte_diff = rx_bytes - priv->last_moder_bytes;
+ rx_byte_diff = rx_byte_diff ? rx_byte_diff : 1;
rate = packets * HZ / period;
avg_pkt_size = packets ? ((unsigned long) (rx_bytes -
priv->last_moder_bytes)) / packets : 0;
@@ -447,10 +450,13 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
/* If tx and rx packet rates are not balanced, assume that
* traffic is mainly BW bound and apply maximum moderation.
* Otherwise, moderate according to packet rate */
- if (2 * tx_pkt_diff > 3 * rx_pkt_diff ||
- 2 * rx_pkt_diff > 3 * tx_pkt_diff) {
+ if (2 * tx_pkt_diff > 3 * rx_pkt_diff &&
+ rx_pkt_diff / rx_byte_diff <
+ MLX4_EN_SMALL_PKT_SIZE)
+ moder_time = priv->rx_usecs_low;
+ else if (2 * rx_pkt_diff > 3 * tx_pkt_diff)
moder_time = priv->rx_usecs_high;
- } else {
+ else {
if (rate < priv->pkt_rate_low)
moder_time = priv->rx_usecs_low;
else if (rate > priv->pkt_rate_high)
--
1.6.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change
2009-07-19 13:06 [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change Yevgeny Petrilin
@ 2009-07-21 20:10 ` David Miller
2009-07-28 8:06 ` Yevgeny Petrilin
2009-08-07 2:28 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2009-07-21 20:10 UTC (permalink / raw)
To: yevgenyp; +Cc: netdev, rdreier
Well Roland, after you flamed me last time for applying mlx4 patches
without your review, I'd like to know if you're going to look at these
three patches and also the independently submitted "mlx4: Fix double
pci unmapping." bug fix from Yevgeny or are these changes going to
simply rot on netdev?
They all look fine to me, but hey I remember what happened last time
:-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change
2009-07-21 20:10 ` David Miller
@ 2009-07-28 8:06 ` Yevgeny Petrilin
0 siblings, 0 replies; 4+ messages in thread
From: Yevgeny Petrilin @ 2009-07-28 8:06 UTC (permalink / raw)
To: David Miller; +Cc: netdev, rdreier
David Miller wrote:
> Well Roland, after you flamed me last time for applying mlx4 patches
> without your review, I'd like to know if you're going to look at these
> three patches and also the independently submitted "mlx4: Fix double
> pci unmapping." bug fix from Yevgeny or are these changes going to
> simply rot on netdev?
>
> They all look fine to me, but hey I remember what happened last time
> :-)
>
Hi,
Is there an update on those patches?
I saw that the "mlx4_en: Fix double pci unmapping." patch is still not applied and it is
pretty important bug fix that should make it to 2.6.31.
As for your discussion, I send all the Ethernet related patches (mlx4_en) to Dave, and all the
low level related patches (mlx4_core) to Roland. I put the netdev list in CC in both cases.
If you guys want me to change something in the way I send the patches, just let me know,
so we could avoid situations where both (or none) of you handle those patches.
Thanks,
Yevgeny
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change
2009-07-19 13:06 [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change Yevgeny Petrilin
2009-07-21 20:10 ` David Miller
@ 2009-08-07 2:28 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-08-07 2:28 UTC (permalink / raw)
To: yevgenyp; +Cc: netdev
From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Sun, 19 Jul 2009 16:06:44 +0300
> If the net device is identified as "sender" (number of sent packets
> is higher then the number of received packets and the incoming packets are
> small), set the moderation time to its low limit.
> We do it because the incoming packets are acks, and we don't want to delay them
>
> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-07 2:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19 13:06 [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change Yevgeny Petrilin
2009-07-21 20:10 ` David Miller
2009-07-28 8:06 ` Yevgeny Petrilin
2009-08-07 2:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox