DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ori Kam <orika@nvidia.com>
To: Suanming Mou <suanmingm@nvidia.com>,
	"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@amd.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] ethdev: fix indirect action convert
Date: Mon, 29 May 2023 06:12:23 +0000	[thread overview]
Message-ID: <MW2PR12MB4666AC3C150831D5253427BAD64A9@MW2PR12MB4666.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230526031800.913744-1-suanmingm@nvidia.com>

Hi Suanming,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Friday, May 26, 2023 6:18 AM
> 
> As indirect action conf fills the indirect action handler, while
> converting indirect action, the action conf(action handler) should
> be copied from original indirect action conf instead of duplicating
> the action handler memory.
> 
> Fixes: 4b61b8774be9 ("ethdev: introduce indirect flow action")
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> ---
>  lib/ethdev/rte_flow.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
> index 69e6e749f7..ff740f19a4 100644
> --- a/lib/ethdev/rte_flow.c
> +++ b/lib/ethdev/rte_flow.c
> @@ -889,7 +889,15 @@ rte_flow_conv_actions(struct rte_flow_action *dst,
>  	src -= num;
>  	dst -= num;
>  	do {
> -		if (src->conf) {
> +		if (src->type == RTE_FLOW_ACTION_TYPE_INDIRECT) {
> +			/*
> +			 * Indirect action conf fills the indirect action
> +			 * handler. Copy the action handle directly instead
> +			 * of duplicating the pointer memory.
> +			 */
> +			if (size)
> +				dst->conf = src->conf;
> +		} else if (src->conf) {
>  			off = RTE_ALIGN_CEIL(off, sizeof(double));
>  			ret = rte_flow_conv_action_conf
>  				((void *)(data + off),
> --
> 2.25.1

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

  reply	other threads:[~2023-05-29  6:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  3:18 Suanming Mou
2023-05-29  6:12 ` Ori Kam [this message]
2023-05-31 13:57   ` Ferruh Yigit

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=MW2PR12MB4666AC3C150831D5253427BAD64A9@MW2PR12MB4666.namprd12.prod.outlook.com \
    --to=orika@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=suanmingm@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).