DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Ori Kam <orika@mellanox.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Cc: dev@dpdk.org, viacheslavo@mellanox.com, matan@mellanox.com
Subject: Re: [dpdk-dev] [PATCH 1/2] app/testpmd: add dynamic flag support
Date: Wed, 15 Jan 2020 13:31:31 +0000	[thread overview]
Message-ID: <59d472f3-261c-f110-b613-a65adb7c614c@intel.com> (raw)
In-Reply-To: <1578907777-194921-2-git-send-email-orika@mellanox.com>

On 1/13/2020 9:29 AM, Ori Kam wrote:
> DPDK now supports registration of dynamic flags (dynf) to the mbuf.
> dynf can be given any name, and can be used with a supporting PMD or
> supporting application.
> 
> Due to the generic concept of the dynf, it is impossible and meaningless,
> to define register set/get function for each flag.
> This commit introduce a generic way to register and set/clear such flags.
> 
> The basic syntax:
> port config <port id> dynf <name> <set|clear>

+1 to command

> 
> The first step the new flag is registered. Regardless if the action is
> set or clear.
> There is no way to unregister the flag, after registring it.
> 
> The second step, if the action is set then we set the requested flag.
> If this is the first flag that is enabled we also register a call back
> for the Tx. In this call back we set the flag.
> If the action is clear the requested flag is cleared, and if there
> are no more flags that are set, the call back is removed.
> 
> The reason that the set is only applied in Tx is that in case of Rx
> it is assumed that the value comes from the PMD.
> 
> If log is enabled the name of the flag, and value will be printed
> in the packet info.
> In order for the log to work correcly the registration of the flag
> must be done before setting verbose.
> 
> Signed-off-by: Ori Kam <orika@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

<...>

> +++ b/app/test-pmd/cmdline.c
> @@ -40,6 +40,7 @@
>  #include <rte_devargs.h>
>  #include <rte_flow.h>
>  #include <rte_gro.h>
> +#include <rte_mbuf_dyn.h>
>  
>  #include <cmdline_rdline.h>
>  #include <cmdline_parse.h>
> @@ -70,6 +71,8 @@
>  #include "cmdline_tm.h"
>  #include "bpf_cmd.h"
>  
> +char dynf_names[64][RTE_MBUF_DYN_NAMESIZE];
> +

I don't think 'cmdline.c' is good place for this global variable, can you please
move it to 'testpmd.c' among other global variables and can you please add some
comment as others do in that same file.

<...>

> +static void
> +cmd_config_dynf_specific_parsed(void *parsed_result,
> +				__attribute__((unused)) struct cmdline *cl,
> +				__attribute__((unused)) void *data)
> +{
> +	struct cmd_config_tx_dynf_specific_result *res = parsed_result;
> +	struct rte_mbuf_dynflag desc_flag;
> +	int flag;
> +	uint64_t old_port_flags;
> +
> +	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
> +		return;
> +	flag = rte_mbuf_dynflag_lookup(res->name, NULL);
> +	if (flag <= 0) {
> +		strcpy(desc_flag.name, res->name);
> +		desc_flag.flags = 0;
> +		flag = rte_mbuf_dynflag_register(&desc_flag);
> +		if (flag < 0) {
> +			printf("Can't register flag");

"\n" is missing, which prevents the io buffer to be flushed and the log
displayed (at least for a long time).

<...>

> @@ -193,6 +200,9 @@ struct rte_port {
>  	/**< metadata value to insert in Tx packets. */
>  	uint32_t		tx_metadata;
>  	const struct rte_eth_rxtx_callback *tx_set_md_cb[RTE_MAX_QUEUES_PER_PORT+1];
> +	/**< dynamic flags. */
> +	uint64_t		dynf;

Everywhe in this patch, variables/descriptions referred as 'dynf' or "dynamic
flags", I think it would be better to prefix 'mbuf' to it, in case in the fure
we throw more dynamic stuff, just "dynamic flags" missing context. Yes, it will
make variable names longer but I think it will be more clear.

Not sure on the testpmd command though, no strong optinion but there I think
context is clear enough to continue with 'dynf' ("port config <port id> dynf
<name> set|clear").

<...>


  reply	other threads:[~2020-01-15 13:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  9:29 [dpdk-dev] [PATCH 0/2] net/mlx5: add PMD dynf Ori Kam
2020-01-13  9:29 ` [dpdk-dev] [PATCH 1/2] app/testpmd: add dynamic flag support Ori Kam
2020-01-15 13:31   ` Ferruh Yigit [this message]
2020-01-16  8:07     ` Ori Kam
2020-01-13  9:29 ` [dpdk-dev] [PATCH 2/2] net/mlx5: add fine grain " Ori Kam
2020-01-15 14:01   ` Ferruh Yigit
2020-01-16 12:05     ` Ori Kam
2020-01-16 12:24       ` Ferruh Yigit
2020-01-16 12:37         ` Ori Kam
2020-01-16 12:53 ` [dpdk-dev] [PATCH v2] app/testpmd: add " Ori Kam
2020-01-16 19:59   ` Ferruh Yigit
2020-01-29 12:21 ` [dpdk-dev] [PATCH v2 0/2] mlx5/net: hint PMD not to inline packet Viacheslav Ovsiienko
2020-01-29 12:21   ` [dpdk-dev] [PATCH v2 1/2] net/mlx5: add fine grain dynamic flag support Viacheslav Ovsiienko
2020-01-29 12:21   ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: update Tx datapath to support no inline hint Viacheslav Ovsiienko
2020-01-30 13:52   ` [dpdk-dev] [PATCH v2 0/2] mlx5/net: hint PMD not to inline packet Raslan Darawsheh

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=59d472f3-261c-f110-b613-a65adb7c614c@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=matan@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=viacheslavo@mellanox.com \
    --cc=wenzhuo.lu@intel.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).