* [PATCH rdma-next] RDMA/mlx5: Fix drop packet rule in egress table
@ 2021-03-18 13:51 Leon Romanovsky
2021-03-26 16:58 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2021-03-18 13:51 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Maor Gottlieb, Daria Velikovsky, linux-rdma, Mark Bloch
From: Maor Gottlieb <maorg@nvidia.com>
Initial drop action support missed that drop action can be added to
egress flow tables as well. Add the missing support.
This requires making sure that dest_type isn't set to PORT which in
turn exposes a possibility of passing dst while indicating number of
dsts as zero. Explicitly check for number of dsts and pass the appropriate
pointer.
Fixes: f29de9eee782 ("RDMA/mlx5: Add support for drop action in DV steering")
Reviewed-by: Mark Bloch <markb@nvidia.com>
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/infiniband/hw/mlx5/fs.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c
index 25da0b05b4e2..f0af3f1ae039 100644
--- a/drivers/infiniband/hw/mlx5/fs.c
+++ b/drivers/infiniband/hw/mlx5/fs.c
@@ -1528,8 +1528,8 @@ static struct mlx5_ib_flow_handler *raw_fs_rule_add(
dst_num++;
}
- handler = _create_raw_flow_rule(dev, ft_prio, dst, fs_matcher,
- flow_context, flow_act,
+ handler = _create_raw_flow_rule(dev, ft_prio, dst_num ? dst : NULL,
+ fs_matcher, flow_context, flow_act,
cmd_in, inlen, dst_num);
if (IS_ERR(handler)) {
@@ -1885,8 +1885,9 @@ static int get_dests(struct uverbs_attr_bundle *attrs,
else
*dest_id = mqp->raw_packet_qp.rq.tirn;
*dest_type = MLX5_FLOW_DESTINATION_TYPE_TIR;
- } else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS ||
- fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_RDMA_TX) {
+ } else if ((fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS ||
+ fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_RDMA_TX) &&
+ !(*flags & MLX5_IB_ATTR_CREATE_FLOW_FLAGS_DROP)) {
*dest_type = MLX5_FLOW_DESTINATION_TYPE_PORT;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-next] RDMA/mlx5: Fix drop packet rule in egress table
2021-03-18 13:51 [PATCH rdma-next] RDMA/mlx5: Fix drop packet rule in egress table Leon Romanovsky
@ 2021-03-26 16:58 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-03-26 16:58 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, Maor Gottlieb, Daria Velikovsky, linux-rdma,
Mark Bloch
On Thu, Mar 18, 2021 at 03:51:23PM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@nvidia.com>
>
> Initial drop action support missed that drop action can be added to
> egress flow tables as well. Add the missing support.
>
> This requires making sure that dest_type isn't set to PORT which in
> turn exposes a possibility of passing dst while indicating number of
> dsts as zero. Explicitly check for number of dsts and pass the appropriate
> pointer.
>
> Fixes: f29de9eee782 ("RDMA/mlx5: Add support for drop action in DV steering")
> Reviewed-by: Mark Bloch <markb@nvidia.com>
> Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> drivers/infiniband/hw/mlx5/fs.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-26 16:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-18 13:51 [PATCH rdma-next] RDMA/mlx5: Fix drop packet rule in egress table Leon Romanovsky
2021-03-26 16:58 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox