diff options
author | Guy Levi <guyle@mellanox.com> | 2017-12-24 14:51:24 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2017-12-28 11:33:14 -0700 |
commit | 07d84f7b6adf3ea0d9f8c2bbee412a2a7aaa83e5 (patch) | |
tree | daf01e5fe7b8125ddab39ec44bb2020086bcf0ad /drivers/infiniband/hw/mlx4/qp.c | |
parent | 76a895d9e1332ca3cfa3edff3dc04420dfd7d603 (diff) | |
download | linux-07d84f7b6adf3ea0d9f8c2bbee412a2a7aaa83e5.tar.bz2 |
IB/mlx4: Add support to RSS hash for inner headers
Support RSS hash for inner headers according to a new flag,
MLX4_IB_RX_HASH_INNER provided by the vendor channel.
In case the flag is set, RSS hash will be done on the inner headers of
VXLAN packets (which are encapsulated).
Non-encapsulated packets will be hashed according to the outer headers.
Signed-off-by: Guy Levi <guyle@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f5f5c5960bba..f045491f2c14 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -734,6 +734,20 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, return (-EOPNOTSUPP); } + if (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_INNER) { + if (dev->dev->caps.tunnel_offload_mode == + MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) { + /* + * Hash according to inner headers if exist, otherwise + * according to outer headers. + */ + rss_ctx->flags |= MLX4_RSS_BY_INNER_HEADERS_IPONLY; + } else { + pr_debug("RSS Hash for inner headers isn't supported\n"); + return (-EOPNOTSUPP); + } + } + return 0; } |