diff mbox

[for-next,2/2] IB/mlx5: Report mlx5 LSO capabilities when querying device

Message ID 1460996717-18778-3-git-send-email-majd@mellanox.com (mailing list archive)
State Superseded
Headers show

Commit Message

Majd Dibbiny April 18, 2016, 4:25 p.m. UTC
From: Bodong Wang <bodong@mellanox.com>

mlx5 based hardware supports LSO for Raw Ethernet QPs.
LSO (large segment offload) applied here is mainly used
for TCP (also known as TSO).

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Or Gerlitz April 18, 2016, 8:41 p.m. UTC | #1
On Mon, Apr 18, 2016 at 7:25 PM, Majd Dibbiny <majd@mellanox.com> wrote:
> From: Bodong Wang <bodong@mellanox.com>
>
> mlx5 based hardware supports LSO for Raw Ethernet QPs.
> LSO (large segment offload) applied here is mainly used
> for TCP (also known as TSO).
>
> Signed-off-by: Bodong Wang <bodong@mellanox.com>
> Signed-off-by: Majd Dibbiny <majd@mellanox.com>
> Signed-off-by: Matan Barak <matanb@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/main.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 5acf346..09502ad 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -454,6 +454,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>         int max_rq_sg;
>         int max_sq_sg;
>         u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
> +       u64 max_lso;
>
>         if (uhw->inlen || uhw->outlen)
>                 return -EINVAL;
> @@ -508,10 +509,18 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>         if (MLX5_CAP_GEN(mdev, block_lb_mc))
>                 props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK;
>
> -       if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) &&
> -           (MLX5_CAP_ETH(dev->mdev, csum_cap)))
> +       if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) {
> +               if (MLX5_CAP_ETH(mdev, csum_cap))
>                         props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM;
>
> +               max_lso = MLX5_CAP_ETH(mdev, max_lso_cap);
> +               if (max_lso) {
> +                       props->lso_caps.max_lso = 1 << max_lso;
> +                       props->lso_caps.supported_qpts |=
> +                               1 << IB_QPT_RAW_ETHERTYPE;

what?!

This QP type is not supported by the driver


> +               }
> +       }
> +
>         if (MLX5_CAP_GEN(mdev, ipoib_basic_offloads)) {
>                 props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
>                 props->device_cap_flags |= IB_DEVICE_UD_TSO;
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bodong Wang April 18, 2016, 9:23 p.m. UTC | #2
On 4/18/2016 3:42 PM, Or Gerlitz wrote:
> On Mon, Apr 18, 2016 at 7:25 PM, Majd Dibbiny <majd@mellanox.com> wrote:
>> From: Bodong Wang <bodong@mellanox.com>
>>
>> mlx5 based hardware supports LSO for Raw Ethernet QPs.
>> LSO (large segment offload) applied here is mainly used
>> for TCP (also known as TSO).
>>
>> Signed-off-by: Bodong Wang <bodong@mellanox.com>
>> Signed-off-by: Majd Dibbiny <majd@mellanox.com>
>> Signed-off-by: Matan Barak <matanb@mellanox.com>
>> ---
>>  drivers/infiniband/hw/mlx5/main.c | 13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
>> index 5acf346..09502ad 100644
>> --- a/drivers/infiniband/hw/mlx5/main.c
>> +++ b/drivers/infiniband/hw/mlx5/main.c
>> @@ -454,6 +454,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>>         int max_rq_sg;
>>         int max_sq_sg;
>>         u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
>> +       u64 max_lso;
>>
>>         if (uhw->inlen || uhw->outlen)
>>                 return -EINVAL;
>> @@ -508,10 +509,18 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>>         if (MLX5_CAP_GEN(mdev, block_lb_mc))
>>                 props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK;
>>
>> -       if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) &&
>> -           (MLX5_CAP_ETH(dev->mdev, csum_cap)))
>> +       if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) {
>> +               if (MLX5_CAP_ETH(mdev, csum_cap))
>>                         props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM;
>>
>> +               max_lso = MLX5_CAP_ETH(mdev, max_lso_cap);
>> +               if (max_lso) {
>> +                       props->lso_caps.max_lso = 1 << max_lso;
>> +                       props->lso_caps.supported_qpts |=
>> +                               1 << IB_QPT_RAW_ETHERTYPE;
> what?!
>
> This QP type is not supported by the driver
>
>
>> +               }
>> +       }
>> +
>>         if (MLX5_CAP_GEN(mdev, ipoib_basic_offloads)) {
>>                 props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
>>                 props->device_cap_flags |= IB_DEVICE_UD_TSO;
>> --

Will change to IB_QPT_RAW_PACKET

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 5acf346..09502ad 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -454,6 +454,7 @@  static int mlx5_ib_query_device(struct ib_device *ibdev,
 	int max_rq_sg;
 	int max_sq_sg;
 	u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
+	u64 max_lso;
 
 	if (uhw->inlen || uhw->outlen)
 		return -EINVAL;
@@ -508,10 +509,18 @@  static int mlx5_ib_query_device(struct ib_device *ibdev,
 	if (MLX5_CAP_GEN(mdev, block_lb_mc))
 		props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK;
 
-	if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) &&
-	    (MLX5_CAP_ETH(dev->mdev, csum_cap)))
+	if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) {
+		if (MLX5_CAP_ETH(mdev, csum_cap))
 			props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM;
 
+		max_lso = MLX5_CAP_ETH(mdev, max_lso_cap);
+		if (max_lso) {
+			props->lso_caps.max_lso = 1 << max_lso;
+			props->lso_caps.supported_qpts |=
+				1 << IB_QPT_RAW_ETHERTYPE;
+		}
+	}
+
 	if (MLX5_CAP_GEN(mdev, ipoib_basic_offloads)) {
 		props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
 		props->device_cap_flags |= IB_DEVICE_UD_TSO;