net/mlx5: DR, Fix postsend actions write length
authorHamdan Igbaria <hamdani@mellanox.com>
Mon, 24 Feb 2020 12:41:29 +0000 (14:41 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 5 Mar 2020 23:13:33 +0000 (15:13 -0800)
Fix the send info write length to be (actions x action) size in bytes.

Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations")
Signed-off-by: Hamdan Igbaria <hamdani@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c

index 6dec2a5..2d93228 100644 (file)
@@ -933,7 +933,6 @@ static int dr_actions_l2_rewrite(struct mlx5dr_domain *dmn,
 
        action->rewrite.data = (void *)ops;
        action->rewrite.num_of_actions = i;
-       action->rewrite.chunk->byte_size = i * sizeof(*ops);
 
        ret = mlx5dr_send_postsend_action(dmn, action);
        if (ret) {
index c7f10d4..095ec7b 100644 (file)
@@ -558,7 +558,8 @@ int mlx5dr_send_postsend_action(struct mlx5dr_domain *dmn,
        int ret;
 
        send_info.write.addr = (uintptr_t)action->rewrite.data;
-       send_info.write.length = action->rewrite.chunk->byte_size;
+       send_info.write.length = action->rewrite.num_of_actions *
+                                DR_MODIFY_ACTION_SIZE;
        send_info.write.lkey = 0;
        send_info.remote_addr = action->rewrite.chunk->mr_addr;
        send_info.rkey = action->rewrite.chunk->rkey;