DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Eli Britstein <elibr@nvidia.com>, dev@dpdk.org
Cc: asafp@nvidia.com, Thomas Monjalon <thomas@monjalon.net>,
	Ori Kam <orika@nvidia.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>
Subject: Re: [PATCH 1/2] app/testpmd: change rule type
Date: Wed, 1 Mar 2023 01:00:55 +0000	[thread overview]
Message-ID: <47c87597-92a9-8708-c7ca-3c8a6c1bc0b9@amd.com> (raw)
In-Reply-To: <20230222141139.3233715-1-elibr@nvidia.com>

On 2/22/2023 2:11 PM, Eli Britstein wrote:
> Change rule type to be uintptr_t (instead of currently uint32_t) to be
> able to accomodate larger IDs, as a pre-step towards allowing user-id
> to flows.
> 

No objection to extend id storage type, but I am not clear why allowing
user-id justifies this, will user insert id more than uint32_max, or is
there some intention to partition variable for user provided ids etc?
Can you please elaborate?

> Signed-off-by: Eli Britstein <elibr@nvidia.com>
> ---
>  app/test-pmd/cmdline_flow.c | 12 ++++++------
>  app/test-pmd/config.c       | 34 ++++++++++++++++++----------------
>  app/test-pmd/testpmd.h      | 10 +++++-----
>  3 files changed, 29 insertions(+), 27 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 9309607f11..a2709e8aa9 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -1085,16 +1085,16 @@ struct buffer {
>  			uint8_t *data;
>  		} vc; /**< Validate/create arguments. */
>  		struct {
> -			uint32_t *rule;
> -			uint32_t rule_n;
> +			uintptr_t *rule;

Why not using 'uint64_t'?

As far as I know 'uintptr_t' is logically to hold pointer values, it is
good for usage like:
``
void *val;
uintptr_t ptr = (uintptr_t)val;
``

Having 'uintptr_t' as type for pointer looks confusing to me.

> +			uintptr_t rule_n;

Similarly, why not 'uint64_t' or 'size_t'?

Variable name suggest it is storing a count, if so 'size_t' is more
suitable logically (functionally I guess both are same).

Same comments apply for all below type changes.


      parent reply	other threads:[~2023-03-01  1:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 14:11 Eli Britstein
2023-02-22 14:11 ` [PATCH 2/2] app/testpmd: user assigned flow ID to flows Eli Britstein
2023-02-22 16:50   ` Thomas Monjalon
2023-03-16 14:19   ` [PATCH V2 1/2] app/testpmd: change flow rule type Gregory Etelson
2023-03-16 14:19     ` [PATCH V2 2/2] app/testpmd: assign custom ID to flow rules Gregory Etelson
2023-06-02 20:19       ` Ferruh Yigit
2023-06-30 10:21         ` Ferruh Yigit
2023-07-04  8:25       ` Ori Kam
2023-07-04 14:40         ` Ferruh Yigit
2023-06-02 20:19     ` [PATCH V2 1/2] app/testpmd: change flow rule type Ferruh Yigit
2023-03-01  1:00 ` Ferruh Yigit [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=47c87597-92a9-8708-c7ca-3c8a6c1bc0b9@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=aman.deep.singh@intel.com \
    --cc=asafp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=elibr@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=yuying.zhang@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).