DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: Li Zhang <lizh@nvidia.com>, Dekel Peled <dekelp@nvidia.com>,
	Ori Kam <orika@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH V1 1/1] net/mlx5: support item type error message in flow Verbs
Date: Tue, 27 Oct 2020 12:08:50 +0000	[thread overview]
Message-ID: <DM6PR12MB27481A055EA05BB800433E7ACF160@DM6PR12MB2748.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200928065546.26742-1-lizh@nvidia.com>

Hi,

> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Monday, September 28, 2020 9:56 AM
> To: Dekel Peled <dekelp@nvidia.com>; Ori Kam <orika@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH V1 1/1] net/mlx5: support item type error message in flow
> Verbs
> 
> Update the flow verbs error message to "item type X not supported",
> when it is not supported,
> instead of a generic error message "item not supported".
> 
> Signed-off-by: Li Zhang <lizh@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_verbs.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 62c18b834f..0e0042f17b 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -1258,6 +1258,7 @@ flow_verbs_validate(struct rte_eth_dev *dev,
>  	uint64_t last_item = 0;
>  	uint8_t next_protocol = 0xff;
>  	uint16_t ether_type = 0;
> +	char errstr[32];
> 
>  	if (items == NULL)
>  		return -1;
> @@ -1408,9 +1409,11 @@ flow_verbs_validate(struct rte_eth_dev *dev,
>  			last_item = MLX5_FLOW_LAYER_MPLS;
>  			break;
>  		default:
> +			snprintf(errstr, sizeof(errstr), "item type %d not
> supported",
> +				 items->type);
>  			return rte_flow_error_set(error, ENOTSUP,
> 
> RTE_FLOW_ERROR_TYPE_ITEM,
> -						  NULL, "item not
> supported");
> +						  NULL, errstr);
>  		}
>  		item_flags |= last_item;
>  	}
> @@ -1704,6 +1707,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
>  	struct mlx5_flow_rss_desc *rss_desc = &((struct
> mlx5_flow_rss_desc *)
>  					      priv->rss_desc)
>  					      [!!priv->flow_nested_idx];
> +	char errstr[32];
> 
>  	if (priority == MLX5_FLOW_PRIO_RSVD)
>  		priority = priv->config.flow_prio - 1;
> @@ -1849,10 +1853,11 @@ flow_verbs_translate(struct rte_eth_dev *dev,
>  			item_flags |= MLX5_FLOW_LAYER_MPLS;
>  			break;
>  		default:
> +			snprintf(errstr, sizeof(errstr), "item type %d not
> supported",
> +				 items->type);
>  			return rte_flow_error_set(error, ENOTSUP,
> 
> RTE_FLOW_ERROR_TYPE_ITEM,
> -						  NULL,
> -						  "item not supported");
> +						  NULL, errstr);
>  		}
>  	}
>  	dev_flow->handle->layers = item_flags;
> --
> 2.21.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

      parent reply	other threads:[~2020-10-27 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28  6:55 Li Zhang
2020-10-26 14:10 ` Slava Ovsiienko
2020-10-27 12:08 ` Raslan Darawsheh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR12MB27481A055EA05BB800433E7ACF160@DM6PR12MB2748.namprd12.prod.outlook.com \
    --to=rasland@nvidia.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=lizh@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).