Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mlx5: Enable TX on a DEVX flow table

Flow table can be passed as a DEVX object which is a valid destination in
an EGRESS flow. Fix the original code to allow that.

Fixes: a7ee18bdee83 ("RDMA/mlx5: Allow creating a matcher for a NIC TX flow table")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Alex Vesker and committed by
Jason Gunthorpe
419822c8 0fbc9b8b

+4 -4
+4 -4
drivers/infiniband/hw/mlx5/flow.c
··· 93 93 ((dest_devx && dest_qp) || (!dest_devx && !dest_qp))) 94 94 return -EINVAL; 95 95 96 - if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS && 97 - (dest_devx || dest_qp)) 98 - return -EINVAL; 99 - 100 96 if (dest_devx) { 101 97 devx_obj = uverbs_attr_get_obj( 102 98 attrs, MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX); ··· 136 140 } 137 141 if (dev->rep) 138 142 return -ENOTSUPP; 143 + 144 + if (dest_type == MLX5_FLOW_DESTINATION_TYPE_TIR && 145 + fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS) 146 + return -EINVAL; 139 147 140 148 cmd_in = uverbs_attr_get_alloced_ptr( 141 149 attrs, MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE);