DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Singh, Aman Deep" <aman.deep.singh@intel.com>
To: Ivan Malov <ivan.malov@oktetlabs.ru>, dev@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ori Kam <orika@nvidia.com>, Ray Kinsella <mdr@ashroe.eu>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [dpdk-dev] [RFC PATCH] ethdev: add support for testpmd-compliant flow rule dumping
Date: Mon, 14 Jun 2021 18:12:23 +0530	[thread overview]
Message-ID: <97d647fc-011a-d99b-4cf6-c2d35350a8bc@intel.com> (raw)
In-Reply-To: <20210527082504.3495-1-ivan.malov@oktetlabs.ru>

Hi Ivan,

As a suggestion, can we add a check for debug log_level in 
"rte_flow_snprint" itself.

So we can avoid CPU time, in cases where we don't want these logs.


On 5/27/2021 1:55 PM, Ivan Malov wrote:
> DPDK applications (for example, OvS) or tests which use RTE
> flow API need to log created or rejected flow rules to help
> to recognise what goes right or wrong. From this standpoint,
> testpmd-compliant format is nice for the purpose because it
> allows to copy-paste the flow rules and debug using testpmd.
>
> Recognisable pattern items:
> VOID, VF, PF, PHY_PORT, PORT_ID, ETH, VLAN, IPV4, IPV6, UDP,
> TCP, VXLAN, NVGRE, GENEVE, MARK, PPPOES, PPPOED.
>
> Recognisable actions:
> VOID, JUMP, MARK, FLAG, QUEUE, DROP, COUNT, RSS, PF, VF, PHY_PORT,
> PORT_ID, OF_POP_VLAN, OF_PUSH_VLAN, OF_SET_VLAN_VID,
> OF_SET_VLAN_PCP, VXLAN_ENCAP, VXLAN_DECAP.
>
> Recognisable RSS types (action RSS):
> IPV4, FRAG_IPV4, NONFRAG_IPV4_TCP, NONFRAG_IPV4_UDP, NONFRAG_IPV4_OTHER,
> IPV6, FRAG_IPV6, NONFRAG_IPV6_TCP, NONFRAG_IPV6_UDP, NONFRAG_IPV6_OTHER,
> IPV6_EX, IPV6_TCP_EX, IPV6_UDP_EX, L3_SRC_ONLY, L3_DST_ONLY,
> L4_SRC_ONLY, L4_DST_ONLY.
>
> Unrecognised parts of the flow specification are represented by
> tokens "{unknown}" and "{unknown bits}". Interested parties are
> welcome to extend this tool to recognise more items and actions.
>
> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
>
> +int
> +rte_flow_snprint(char *buf, size_t buf_size, size_t *nb_chars_total,
> +		 const struct rte_flow_attr *attr,
> +		 const struct rte_flow_item pattern[],
> +		 const struct rte_flow_action actions[])
> +{
> +	int rc;
> +
Like add a check with "rte_log_can_log()" and return from here.
> +	if (buf == NULL && buf_size != 0)
> +		return -EINVAL;
> +
> +	*nb_chars_total = 0;
> +
> +	rc = rte_flow_snprint_attr(buf, buf_size, nb_chars_total, attr);
> +	if (rc != 0)
> +		return rc;
> +
> +	rc = rte_flow_snprint_pattern(buf, buf_size, nb_chars_total, pattern);
> +	if (rc != 0)
> +		return rc;
> +
> +	rc = rte_flow_snprint_actions(buf, buf_size, nb_chars_total, actions);
> +	if (rc != 0)
> +		return rc;
> +
> +	return 0;
> +}

Regards

Aman


  parent reply	other threads:[~2021-06-14 12:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  8:25 Ivan Malov
2021-05-30  7:27 ` Ori Kam
2021-05-31  2:28   ` Stephen Hemminger
2021-06-01 14:17     ` Ivan Malov
2021-06-01 15:10       ` Stephen Hemminger
2021-06-01 14:08   ` Ivan Malov
2021-06-02 13:32     ` Ori Kam
2021-06-02 13:49       ` Andrew Rybchenko
2021-06-03  8:25         ` Ori Kam
2021-06-03  8:43           ` Andrew Rybchenko
2021-06-03  9:27             ` Ori Kam
2023-03-23 12:54               ` Ferruh Yigit
2021-06-02 20:48   ` Stephen Hemminger
2021-06-14 12:42 ` Singh, Aman Deep [this message]
2021-06-17  8:11   ` Singh, Aman Deep
2021-07-02 10:20   ` Andrew Rybchenko

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=97d647fc-011a-d99b-4cf6-c2d35350a8bc@intel.com \
    --to=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=ivan.malov@oktetlabs.ru \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    /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).