[dpdk-dev] net/mlx5: fix checksum offload cap

Message ID 20171004082843.66576-1-shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shahaf Shuler Oct. 4, 2017, 8:28 a.m. UTC
  The PMD was using the wrong flag to query device checksum capabilities

Fixes: bba710e6b99b ("net/mlx5: support upstream rdma-core")
Cc: shacharbe@mellanox.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Nélio Laranjeiro Oct. 4, 2017, 12:02 p.m. UTC | #1
On Wed, Oct 04, 2017 at 11:28:43AM +0300, Shahaf Shuler wrote:
> The PMD was using the wrong flag to query device checksum capabilities
> 
> Fixes: bba710e6b99b ("net/mlx5: support upstream rdma-core")
> Cc: shacharbe@mellanox.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index 229b824bc..a4b718417 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -649,8 +649,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
>  		}
>  
>  		priv->hw_csum =
> -			((device_attr_ex.device_cap_flags_ex &
> -			  IBV_DEVICE_UD_IP_CSUM));
> +			!!(device_attr_ex.device_cap_flags_ex &
> +			   IBV_DEVICE_RAW_IP_CSUM);
>  		DEBUG("checksum offloading is %ssupported",
>  		      (priv->hw_csum ? "" : "not "));
>  
> -- 
> 2.12.0


Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
  
Ferruh Yigit Oct. 5, 2017, 12:56 a.m. UTC | #2
On 10/4/2017 1:02 PM, Nélio Laranjeiro wrote:
> On Wed, Oct 04, 2017 at 11:28:43AM +0300, Shahaf Shuler wrote:
>> The PMD was using the wrong flag to query device checksum capabilities
>>
>> Fixes: bba710e6b99b ("net/mlx5: support upstream rdma-core")
>> Cc: shacharbe@mellanox.com
>>
>> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Applied to dpdk-next-net/master, thanks.
  
Ferruh Yigit Oct. 5, 2017, 6:05 p.m. UTC | #3
On 10/5/2017 1:56 AM, Ferruh Yigit wrote:
> On 10/4/2017 1:02 PM, Nélio Laranjeiro wrote:
>> On Wed, Oct 04, 2017 at 11:28:43AM +0300, Shahaf Shuler wrote:
>>> The PMD was using the wrong flag to query device checksum capabilities
>>>
>>> Fixes: bba710e6b99b ("net/mlx5: support upstream rdma-core")
>>> Cc: shacharbe@mellanox.com
>>>
>>> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> 
>> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

> Applied to dpdk-next-net/master, thanks.
 Squashed into relevant commit in next-net, thanks.

(since waiting pull-request invalidated, squashed in next-net)
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 229b824bc..a4b718417 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -649,8 +649,8 @@  mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		}
 
 		priv->hw_csum =
-			((device_attr_ex.device_cap_flags_ex &
-			  IBV_DEVICE_UD_IP_CSUM));
+			!!(device_attr_ex.device_cap_flags_ex &
+			   IBV_DEVICE_RAW_IP_CSUM);
 		DEBUG("checksum offloading is %ssupported",
 		      (priv->hw_csum ? "" : "not "));