[2/4] net/mlx5/hws: use union in the wqe-data struct

Message ID 20230612200552.3450964-3-akozyrev@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: implement Flow update API |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Alexander Kozyrev June 12, 2023, 8:05 p.m. UTC
  From: Erez Shitrit <erezsh@nvidia.com>

To be clear about which field we are going to set.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ori Kam June 14, 2023, 5 p.m. UTC | #1
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Monday, June 12, 2023 11:06 PM
> 
> From: Erez Shitrit <erezsh@nvidia.com>
> 
> To be clear about which field we are going to set.
> 
> Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
> Reviewed-by: Alex Vesker <valex@nvidia.com>
> ---
>  drivers/net/mlx5/hws/mlx5dr_send.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c
> b/drivers/net/mlx5/hws/mlx5dr_send.c
> index d650c55124..e58fdeb117 100644
> --- a/drivers/net/mlx5/hws/mlx5dr_send.c
> +++ b/drivers/net/mlx5/hws/mlx5dr_send.c
> @@ -110,7 +110,7 @@ mlx5dr_send_wqe_set_tag(struct
> mlx5dr_wqe_gta_data_seg_ste *wqe_data,
>  	if (is_jumbo) {
>  		/* Clear previous possibly dirty control */
>  		memset(wqe_data, 0, MLX5DR_STE_CTRL_SZ);
> -		memcpy(wqe_data->action, tag->jumbo,
> MLX5DR_JUMBO_TAG_SZ);
> +		memcpy(wqe_data->jumbo, tag->jumbo,
> MLX5DR_JUMBO_TAG_SZ);
>  	} else {
>  		/* Clear previous possibly dirty control and actions */
>  		memset(wqe_data, 0, MLX5DR_STE_CTRL_SZ +
> MLX5DR_ACTIONS_SZ);
> --
> 2.18.2

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index d650c55124..e58fdeb117 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -110,7 +110,7 @@  mlx5dr_send_wqe_set_tag(struct mlx5dr_wqe_gta_data_seg_ste *wqe_data,
 	if (is_jumbo) {
 		/* Clear previous possibly dirty control */
 		memset(wqe_data, 0, MLX5DR_STE_CTRL_SZ);
-		memcpy(wqe_data->action, tag->jumbo, MLX5DR_JUMBO_TAG_SZ);
+		memcpy(wqe_data->jumbo, tag->jumbo, MLX5DR_JUMBO_TAG_SZ);
 	} else {
 		/* Clear previous possibly dirty control and actions */
 		memset(wqe_data, 0, MLX5DR_STE_CTRL_SZ + MLX5DR_ACTIONS_SZ);