Skip to content

Commit

Permalink
IB/mlx4: Add report for RSS capabilities by vendor channel
Browse files Browse the repository at this point in the history
The mlx4's RSS patches submission missed a report of RSS capabilities
which should be reported by the vendor channel in query_device.

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: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Guy Levi authored and Doug Ledford committed Nov 10, 2017
1 parent fec99ed commit 09d208b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
17 changes: 17 additions & 0 deletions drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,23 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
sizeof(struct mlx4_wqe_data_seg);
}

if (uhw->outlen >= resp.response_length + sizeof(resp.rss_caps)) {
resp.response_length += sizeof(resp.rss_caps);
if (props->rss_caps.supported_qpts) {
resp.rss_caps.rx_hash_function =
MLX4_IB_RX_HASH_FUNC_TOEPLITZ;
resp.rss_caps.rx_hash_fields_mask =
MLX4_IB_RX_HASH_SRC_IPV4 |
MLX4_IB_RX_HASH_DST_IPV4 |
MLX4_IB_RX_HASH_SRC_IPV6 |
MLX4_IB_RX_HASH_DST_IPV6 |
MLX4_IB_RX_HASH_SRC_PORT_TCP |
MLX4_IB_RX_HASH_DST_PORT_TCP |
MLX4_IB_RX_HASH_SRC_PORT_UDP |
MLX4_IB_RX_HASH_DST_PORT_UDP;
}
}

if (uhw->outlen) {
err = ib_copy_to_udata(uhw, &resp, resp.response_length);
if (err)
Expand Down
16 changes: 11 additions & 5 deletions drivers/infiniband/hw/mlx4/mlx4_ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,18 @@ enum query_device_resp_mask {
QUERY_DEVICE_RESP_MASK_TIMESTAMP = 1UL << 0,
};

struct mlx4_ib_rss_caps {
__u64 rx_hash_fields_mask; /* enum mlx4_rx_hash_fields */
__u8 rx_hash_function; /* enum mlx4_rx_hash_function_flags */
__u8 reserved[7];
};

struct mlx4_uverbs_ex_query_device_resp {
__u32 comp_mask;
__u32 response_length;
__u64 hca_core_clock_offset;
__u32 max_inl_recv_sz;
__u32 reserved;
__u32 comp_mask;
__u32 response_length;
__u64 hca_core_clock_offset;
__u32 max_inl_recv_sz;
struct mlx4_ib_rss_caps rss_caps;
};

static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev)
Expand Down

0 comments on commit 09d208b

Please sign in to comment.