Re: [PATCH rdma-next 4/4] RDMA/mlx5: Add support in steering default miss

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 13, 2020 at 04:52:20PM +0300, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg@xxxxxxxxxxxx>
> 
> User can configure default miss rule in order to skip matching in
> the user domain and forward the packet to the kernel steering domain.
> When user requests a default miss rule, we add steering rule
> to forward the traffic to the next namespace.
> 
> Signed-off-by: Maor Gottlieb <maorg@xxxxxxxxxxxx>
> Reviewed-by: Mark Zhang <markz@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  drivers/infiniband/hw/mlx5/flow.c        | 35 ++++++++++++++++++++----
>  drivers/infiniband/hw/mlx5/main.c        |  9 +++---
>  include/uapi/rdma/mlx5_user_ioctl_cmds.h |  5 ++++
>  3 files changed, 38 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c
> index 7ff8d7188b82..7db672fd1395 100644
> +++ b/drivers/infiniband/hw/mlx5/flow.c
> @@ -69,19 +69,35 @@ static const struct uverbs_attr_spec mlx5_ib_flow_type[] = {
>  
>  static int get_dests(struct uverbs_attr_bundle *attrs,
>  		     struct mlx5_ib_flow_matcher *fs_matcher, int *dest_id,
> -		     int *dest_type, struct ib_qp **qp)
> +		     int *dest_type, struct ib_qp **qp, bool *def_miss)
>  {
>  	bool dest_devx, dest_qp;
>  	void *devx_obj;
> +	u32 flags;
>  
>  	dest_devx = uverbs_attr_is_valid(attrs,
>  					 MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX);
>  	dest_qp = uverbs_attr_is_valid(attrs,
>  				       MLX5_IB_ATTR_CREATE_FLOW_DEST_QP);
>  
> -	if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS &&
> -	    ((dest_devx && dest_qp) || (!dest_devx && !dest_qp)))
> -		return -EINVAL;
> +	*def_miss = false;
> +	if (uverbs_attr_is_valid(attrs, MLX5_IB_ATTR_FLOW_MATCHER_FLOW_FLAGS)) {

attr_is_valid should not be called on flags, get_flags already knows
to return 0 as the flags if the attr is not present.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux