DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Xiaoyu Min <jackmin@mellanox.com>,
	jerinjacobk@gmail.com, orika@mellanox.com,
	viacheslavo@mellanox.com, matan@mellanox.com,
	rasland@mellanox.com, Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/5] ethdev: add API to dump device internal flow info
Date: Fri, 17 Jan 2020 09:20:02 +0000
Message-ID: <816255da-1a15-12ba-1094-1726f4d2fe61@intel.com> (raw)
In-Reply-To: <20200116145617.7907ba46@hermes.lan>

On 1/16/2020 10:56 PM, Stephen Hemminger wrote:
> On Thu, 16 Jan 2020 20:37:36 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 1/16/2020 10:14 AM, Xiaoyu Min wrote:
>>> Introduce an API which dump the device's internal representation
>>> information of rte flows in hardware.
>>>
>>> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>  
>>
>> <...>
>>
>>> @@ -1212,3 +1212,19 @@ rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size,
>>>  	}
>>>  	return lsize;
>>>  }
>>> +
>>> +int
>>> +rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error)
>>> +{
>>> +	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
>>> +	const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
>>> +
>>> +	if (unlikely(!ops))
>>> +		return -rte_errno;
>>> +	if (likely(!!ops->dev_dump))
>>> +		return flow_err(port_id, ops->dev_dump(dev, file, error),
>>> +				error);
>>> +	return rte_flow_error_set(error, ENOSYS,
>>> +				  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
>>> +				  NULL, rte_strerror(ENOSYS));
>>> +}  
>>
>> Should API validate user provided input "FILE *file" ?
> 
> None of the other DPDK dump routines do.
> 

You are right, a few samples I checked doesn't validating it, I wonder if this
is intentional decision or just missed the user input validation.
For me, APIs should validate user input.

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 10:14 [dpdk-dev] [PATCH 0/5] " Xiaoyu Min
2020-01-16 10:14 ` [dpdk-dev] [PATCH 1/5] " Xiaoyu Min
2020-01-16 10:37   ` Jerin Jacob
2020-01-16 13:29     ` Ori Kam
2020-01-16 20:37   ` Ferruh Yigit
2020-01-16 22:56     ` Stephen Hemminger
2020-01-17  9:20       ` Ferruh Yigit [this message]
2020-01-16 10:14 ` [dpdk-dev] [PATCH 2/5] net/mlx5: support flow dump API Xiaoyu Min
2020-01-16 10:14 ` [dpdk-dev] [PATCH 3/5] app/testpmd: new flow dump CLI Xiaoyu Min
2020-01-16 14:10   ` Ori Kam
2020-01-16 10:14 ` [dpdk-dev] [PATCH 4/5] net/mlx5: add socket server for external tools Xiaoyu Min
2020-01-17  8:47   ` Slava Ovsiienko
2020-01-17  9:01     ` Jack Min
2020-01-16 10:14 ` [dpdk-dev] [PATCH 5/5] doc: update mlx5 document for flow dump feature Xiaoyu Min
2020-01-17 11:55 ` [dpdk-dev] [PATCH v2 0/5] ethdev: add API to dump device internal flow info Xiaoyu Min
2020-01-17 11:55   ` [dpdk-dev] [PATCH v2 1/5] " Xiaoyu Min
2020-01-17 19:26     ` Ferruh Yigit
2020-01-17 11:56   ` [dpdk-dev] [PATCH v2 2/5] net/mlx5: support flow dump API Xiaoyu Min
2020-01-17 11:56   ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: new flow dump CLI Xiaoyu Min
2020-01-17 11:56   ` [dpdk-dev] [PATCH v2 4/5] net/mlx5: add socket server for external tools Xiaoyu Min
2020-01-17 11:56   ` [dpdk-dev] [PATCH v2 5/5] doc: update mlx5 document for flow dump feature Xiaoyu Min
2020-01-17 19:26   ` [dpdk-dev] [PATCH v2 0/5] ethdev: add API to dump device internal flow info Ferruh Yigit
2020-01-19 21:08     ` Thomas Monjalon
2020-01-20  1:40       ` Jack Min

Reply instructions:

You may reply publically 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=816255da-1a15-12ba-1094-1726f4d2fe61@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@mellanox.com \
    --cc=jerinjacobk@gmail.com \
    --cc=matan@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@mellanox.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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git