Re: [PATCH rdma-next] RDMA/mlx5: Add support for flow tag to raw create flow

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

 



On Wed, Oct 10, 2018 at 09:55:10AM +0300, Leon Romanovsky wrote:
> From: Mark Bloch <markb@xxxxxxxxxxxx>
> 
> A user can provide a hint which will be attached to the packet and
> written to the CQE on receive. This can be used as a way to offload
> operations into the HW, for example parsing a packet which is a tunneled
> packet, and if so, pass 0x1 as the hint. The software can use that hint
> to decapsulate the packet and parse only the inner headers thus saving
> CPU cycles.
> 
> Signed-off-by: Mark Bloch <markb@xxxxxxxxxxxx>
> Reviewed-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/mlx5/flow.c        | 15 ++++++++++++++-
>  include/uapi/rdma/mlx5_user_ioctl_cmds.h |  1 +
>  2 files changed, 15 insertions(+), 1 deletion(-)

Applied to for-next, thanks
 
> diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c
> index 4ee4af450720..e57435cb6d96 100644
> --- a/drivers/infiniband/hw/mlx5/flow.c
> +++ b/drivers/infiniband/hw/mlx5/flow.c
> @@ -153,6 +153,16 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
>  				   arr_flow_actions[i]->object);
>  	}
>  
> +	ret = uverbs_copy_from(&flow_act.flow_tag, attrs,
> +			       MLX5_IB_ATTR_CREATE_FLOW_TAG);
> +	if (!ret) {
> +		if (flow_act.flow_tag >= BIT(24)) {
> +			ret = -EINVAL;
> +			goto err_out;
> +		}
> +		flow_act.has_flow_tag = true;
> +	}

I'm not super keen on this pattern though, uverbs_copy_from can fail
with more than ENOENT, but since the attribute is inline it can't in
this case. Little too tricky perhaps.

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