summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_tx.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2018-04-27 21:06:35 +0300
committerDavid S. Miller <davem@davemloft.net>2018-04-30 05:01:32 +0300
commitd80d8d55734998a22a064e7cd59ffc66dcc86fb2 (patch)
tree789b026390595a7e8d0bdd5629812e65ab6be5ed /drivers/net/ethernet/mellanox/mlx4/en_tx.c
parentf90652841f38886c2d70100a9c613ccaabf56465 (diff)
downloadlinux-d80d8d55734998a22a064e7cd59ffc66dcc86fb2.tar.xz
opa_vnic: Just use skb_get_hash instead of skb_tx_hash
This patch is meant to clean up how the opa_vnic is obtaining entropy from Tx packets. The code as it was written was claiming to get 16 bits of hash, but from what I can tell it was only ever actually getting 14 bits as it was limited to 0 - (2^15 - 1). It then was folding the result to get a 8 bit value for entropy. Instead of throwing away all that input I am cutting out the middle man and instead having the code call skb_get_hash directly and then folding the 32 bit value into a 8 bit value using a pair of shifts and XOR operations. Execution wise this new approach should provide more entropy and be faster since we are bypassing the reciprocal multiplication to reduce the 32b value to 16b and instead just using a shift/XOR combination. In addition we can drop the unneeded adapter value from the call to get the entropy since the netdev itself isn't even needed. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_tx.c')
0 files changed, 0 insertions, 0 deletions