mlx4_en: Setting RSS hash result to skb->rxhash field
Subsystems (2)
PATCH 1/1 mlx4_en: Setting RSS hash result to skb->rxhash field
--- drivers/net/mlx4/en_rx.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/mlx4/en_rx.c +3 -0
@@ -610,6 +610,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud gro_skb->data_len = length; gro_skb->truesize += length; gro_skb->ip_summed =CHECKSUM_UNNECESSARY ; + gro_skb->rxhash =be32_to_cpu (cqe->immed_rss_invalid) <<24 ; +skb_record_rx_queue (gro_skb, cq->ring);if (priv->vlgrp && (cqe->vlan_my_qpn &cpu_to_be32 (MLX4_CQE_VLAN_PRESENT_MASK )))
@@ -643,6 +645,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud goto next; } + skb->rxhash =be32_to_cpu (cqe->immed_rss_invalid) <<24 ; skb->ip_summed = ip_summed; skb->protocol =eth_type_trans (skb, dev);skb_record_rx_queue (skb, cq->ring);
Signature · 1 line
1.6.0.2
Quoted 10 lines · Yevgeny Petrilin
Signed-off-by Yevgeny Petrilin <[email protected]>--- drivers/net/mlx4/en_rx.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)drivers/net/mlx4/en_rx.c +0
-0
drivers/net/mlx4/en_rx.c int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · line 614
Quoted 5 lines
drivers/net/mlx4/en_rx.c +2
-0@@ -610,6 +610,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud gro_skb->data_len = length; gro_skb->truesize += length; gro_skb->ip_summed =CHECKSUM_UNNECESSARY ; + gro_skb->rxhash =be32_to_cpu (cqe->immed_rss_invalid) <<24 ; +skb_record_rx_queue (gro_skb, cq->ring);
An 8-bit hash is almost useless. It's entirely useless if you then shift it into the top bits of rxhash.
Ben.
Quoted 10 lines
drivers/net/mlx4/en_rx.c +1
-0if (priv->vlgrp && (cqe->vlan_my_qpn &cpu_to_be32 (MLX4_CQE_VLAN_PRESENT_MASK )))@@ -643,6 +645,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud goto next; } + skb->rxhash =be32_to_cpu (cqe->immed_rss_invalid) <<24 ; skb->ip_summed = ip_summed; skb->protocol =eth_type_trans (skb, dev);skb_record_rx_queue (skb, cq->ring);
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Quoted 6 lines · Ben Hutchings
Quoted 5 lines · Yevgeny Petrilin
Signed-off-by Yevgeny Petrilin <[email protected]>--- drivers/net/mlx4/en_rx.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
Quoted 14 lines
drivers/net/mlx4/en_rx.c int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · line 614
Quoted 10 lines
drivers/net/mlx4/en_rx.c +2
-0@@ -610,6 +610,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud gro_skb->data_len = length; gro_skb->truesize += length; gro_skb->ip_summed =CHECKSUM_UNNECESSARY ; + gro_skb->rxhash =be32_to_cpu (cqe->immed_rss_invalid) <<24 ; +skb_record_rx_queue (gro_skb, cq->ring);An 8-bit hash is almost useless. It's entirely useless if you then shift it into the top bits of rxhash.
Agreed. This is very bad.
Yevgeny probably did this shift because get_rps_cpu() does :
tcpu = map->cpus[((u64) skb->rxhash * map->len) >> 32];
(If rxhash is not a pure random u32 distribution, then high order bits are more important than low order bits)
Quoted 5 lines
Quoted 4 lines
An 8-bit hash is almost useless. It's entirely useless if you then shift it into the top bits of rxhash.
Quoted 9 lines
Agreed. This is very bad.
Yevgeny probably did this shift because
get_rps_cpu()does :tcpu = map->cpus[((u64)
skb->rxhash*map->len) >> 32];(If rxhash is not a pure random u32 distribution, then high order bits are more important than low order bits)
Eric, you are correct.
We do plan to enable full 32 bit hash for our devices.
Once it is done, we will naturally use the whole 32 bits.
In the meanwhile, even with this change we see improved performance when enabling RPS.
Thanks,
Yevgeny
Quoted 5 lines · Yevgeny Petrilin
Quoted 1 line
Eric, you are correct.
We do plan to enable full 32 bit hash for our devices.
Once it is done, we will naturally use the whole 32 bits.
In the meanwhile, even with this change we see improved performance when enabling RPS.
Hmm, thats strange because you have only 256 possible values for rxhash, and it's OK for maybe one hundred flows. (I am talking not of RPS but RFS here)
So your patch is a win only for small hosts, or particular workloads (did I say biased benchmarks ? ;) )
Really, we better use the linux/software full 32bit rxhash in this case, and wait for your 32bit full support.
Quoted 11 lines · Eric Dumazet
Quoted 5 lines · Yevgeny Petrilin
Quoted 1 line
Eric, you are correct.
We do plan to enable full 32 bit hash for our devices.
Once it is done, we will naturally use the whole 32 bits.
In the meanwhile, even with this change we see improved performance when enabling RPS.Hmm, thats strange because you have only 256 possible values for rxhash, and it's OK for maybe one hundred flows. (I am talking not of RPS but RFS here)
Quoted 7 lines
So your patch is a win only for small hosts, or particular workloads (did I say biased benchmarks ? ;) )
Really, we better use the linux/software full 32bit rxhash in this case, and wait for your 32bit full support.
BTW, before you submit another rxhash patch, please make sure ethtool support is included. An admin must be able to switch off hardware support :
ethtool -K eth0 rxhash off
Quoted 18 lines
Quoted 10 lines
Quoted 5 lines
Quoted 1 line
Eric, you are correct.
We do plan to enable full 32 bit hash for our devices.
Once it is done, we will naturally use the whole 32 bits.
In the meanwhile, even with this change we see improved performance when enabling RPS.Hmm, thats strange because you have only 256 possible values for rxhash, and it's OK for maybe one hundred flows. (I am talking not of RPS but RFS here)
Quoted 7 lines
So your patch is a win only for small hosts, or particular workloads (did I say biased benchmarks ? ;) )
Really, we better use the linux/software full 32bit rxhash in this case, and wait for your 32bit full support.
Quoted 7 lines
BTW, before you submit another rxhash patch, please make sure ethtool support is included. An admin must be able to switch off hardware support :
ethtool -K eth0 rxhash off
Thanks for this input
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Thu, 05 May 2011 08:55:18 +0200
Quoted 2 lines
Really, we better use the linux/software full 32bit rxhash in this case, and wait for your 32bit full support.
Agreed.