diff options
author | Noa Osherovich <noaos@mellanox.com> | 2017-01-18 08:40:01 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-02-14 11:41:14 -0500 |
commit | e8161334403ed34a9214bcce517d50bbe3e02b97 (patch) | |
tree | 9fdda97e39034783a3d2d7fe3f698ba2b074ff16 | |
parent | 9e1b161f3b8f14f2459fa20c26e41e40e049d90e (diff) |
IB/mlx5: Expose vlan offloads capabilities
Check device's capabilities and report which raw packet capabilities
are supported.
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@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>
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index f8fe98d22965..fe37da2be26f 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -581,8 +581,15 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
581 | props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK; | 581 | props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK; |
582 | 582 | ||
583 | if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) { | 583 | if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) { |
584 | if (MLX5_CAP_ETH(mdev, csum_cap)) | 584 | if (MLX5_CAP_ETH(mdev, csum_cap)) { |
585 | /* Legacy bit to support old userspace libraries */ | ||
585 | props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM; | 586 | props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM; |
587 | props->raw_packet_caps |= IB_RAW_PACKET_CAP_IP_CSUM; | ||
588 | } | ||
589 | |||
590 | if (MLX5_CAP_ETH(dev->mdev, vlan_cap)) | ||
591 | props->raw_packet_caps |= | ||
592 | IB_RAW_PACKET_CAP_CVLAN_STRIPPING; | ||
586 | 593 | ||
587 | if (field_avail(typeof(resp), tso_caps, uhw->outlen)) { | 594 | if (field_avail(typeof(resp), tso_caps, uhw->outlen)) { |
588 | max_tso = MLX5_CAP_ETH(mdev, max_lso_cap); | 595 | max_tso = MLX5_CAP_ETH(mdev, max_lso_cap); |
@@ -621,8 +628,11 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
621 | } | 628 | } |
622 | 629 | ||
623 | if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) && | 630 | if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) && |
624 | MLX5_CAP_ETH(dev->mdev, scatter_fcs)) | 631 | MLX5_CAP_ETH(dev->mdev, scatter_fcs)) { |
632 | /* Legacy bit to support old userspace libraries */ | ||
625 | props->device_cap_flags |= IB_DEVICE_RAW_SCATTER_FCS; | 633 | props->device_cap_flags |= IB_DEVICE_RAW_SCATTER_FCS; |
634 | props->raw_packet_caps |= IB_RAW_PACKET_CAP_SCATTER_FCS; | ||
635 | } | ||
626 | 636 | ||
627 | if (mlx5_get_flow_namespace(dev->mdev, MLX5_FLOW_NAMESPACE_BYPASS)) | 637 | if (mlx5_get_flow_namespace(dev->mdev, MLX5_FLOW_NAMESPACE_BYPASS)) |
628 | props->device_cap_flags |= IB_DEVICE_MANAGED_FLOW_STEERING; | 638 | props->device_cap_flags |= IB_DEVICE_MANAGED_FLOW_STEERING; |