DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>
Cc: Ori Kam <orika@nvidia.com>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC] ethdev: introduce action context APIs
Date: Tue, 6 Apr 2021 09:05:46 +0000
Message-ID: <MN2PR12MB29097FE55676D5D389D86C46D0769@MN2PR12MB2909.namprd12.prod.outlook.com> (raw)
In-Reply-To: <7101c740-84d4-3da4-61a3-d45aa9168ba1@oktetlabs.ru>

Hi Andrew,

Thanks for your comments.

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Monday, March 22, 2021 11:00 PM
> To: Bing Zhao <bingz@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>
> Cc: Ori Kam <orika@nvidia.com>; ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [RFC] ethdev: introduce action context APIs
> 
> External email: Use caution opening links or attachments
> 
> 
> On 3/17/21 7:10 PM, Bing Zhao wrote:
> > Hi Thomas,
> >
> >> -----Original Message-----
> >> From: Thomas Monjalon <thomas@monjalon.net>
> >> Sent: Wednesday, March 17, 2021 4:29 PM
> >> To: Bing Zhao <bingz@nvidia.com>
> >> Cc: Ori Kam <orika@nvidia.com>; ferruh.yigit@intel.com;
> >> andrew.rybchenko@oktetlabs.ru; dev@dpdk.org
> >> Subject: Re: [RFC] ethdev: introduce action context APIs
> >>
> >> External email: Use caution opening links or attachments
> >>
> >>
> >> 17/03/2021 08:59, Bing Zhao:
> >>> The new functions rte_flow_action_ctx* that were added will
> >> replace
> >>> the curret shared functions rte_flow_shared_action_*.
> >>>   - rte_flow_shared_action_create
> >>>   - rte_flow_shared_action_destroy
> >>>   - rte_flow_shared_action_update
> >>>   - rte_flow_shared_action_query
> >>>   + rte_flow_action_ctx_create
> >>>   + rte_flow_action_ctx_destroy
> >>>   + rte_flow_action_ctx_update
> >>>   + rte_flow_action_ctx_query
> >>>
> >>> When creating a action context, it could be shared among
> different
> >>> flows or different ports. Or it could also be used by a single
> >> flow.
> >>> The name "shared" is improper in a sense.
> >>
> >> Is it the only reason for the change?
> >> I better understand "shared" even if it is sometimes not shared.
> >
> > Another reason is as written in the description of commit message,
> currently the update interface use the rte_flow_action as the input
> parameter. It would limit the ability of updating, since
> rte_flow_action only have the "conf" w/o any mask or flag bits.
> >
> > If only part of the fields need to be updated, it couldn't meet
> the needs.
> 
> Sorry, it is too vague. Context in the RFC looks insufficient to
> understand it. Please, provide more details and real-life examples.

Take the next RFC of "conntrack" for example, in the actions structure definition, there are more than a dozen of fields to define the action itself. When an updating is required, sometimes, only part of these fields need to be updated.
__rte_experimental
int
rte_flow_shared_action_update(uint16_t port_id,
			      struct rte_flow_shared_action *action,
			      const struct rte_flow_action *update,
			      struct rte_flow_error *error);
In the current API, the 3rd input parameter "update" has the same struct type "rte_flow_action", and unlike the "rte_flow_item", no "mask" field is contained in the action struct, only "conf". When doing a update, the software has to take all the information pointed by the "conf" and do a whole update. The partial update couldn't be supported with the current update interface definition.
By changing the pointer type from "const struct rte_flow_action *" to the " const void *", it would be much more flexible.
1. For the current implementation that "update" interface has already been used, only a minor change in the PMD is needed, to cast the generic pointer to the action pointer before getting the new "conf".
2. For the new actions implementation that will use the "update" interface, the pointer type will be depends on the need. If no partial is required, it could be the same as before, a action pointer. Or else, a wrapper structure pointer will be used to indicate which field(s) inside to update.
I hope this description would be a bit more detailed about the purpose of this change.

And since the "update" interface needs to be updated, we could change the other 3 interfaces with proper names. What do you think?

BR. Bing

  reply	other threads:[~2021-04-06  9:05 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1615967952-228321-1-git-send-email-bingz@nvidia.com>
2021-03-17  8:28 ` Thomas Monjalon
2021-03-17 16:10   ` Bing Zhao
2021-03-22 14:59     ` Andrew Rybchenko
2021-04-06  9:05       ` Bing Zhao [this message]
2021-03-22 14:54   ` Andrew Rybchenko
2021-04-06  9:07     ` Bing Zhao
2021-04-06  9:48       ` Thomas Monjalon
2021-04-06 11:02         ` Bing Zhao
2021-04-06 12:18           ` Thomas Monjalon
2021-04-07  3:16         ` Ajit Khaparde
2021-04-07  6:11           ` Bing Zhao
2021-04-08 14:46 ` [dpdk-dev] [RFC PATCH v2] ethdev: introduce indirect action APIs Bing Zhao
2021-04-09  3:54 ` [dpdk-dev] [PATCH] " Bing Zhao
2021-04-10 14:03   ` [dpdk-dev] [PATCH v2 0/4] Change shared action API to action handle API Bing Zhao
2021-04-10 14:03     ` [dpdk-dev] [PATCH v2 1/4] ethdev: introduce indirect action APIs Bing Zhao
2021-04-12 19:42       ` Ferruh Yigit
2021-04-13  1:26         ` Bing Zhao
2021-04-13 14:00           ` Ori Kam
2021-04-13 12:36       ` Andrey Vesnovaty
2021-04-15 13:55       ` Andrew Rybchenko
2021-04-15 14:10         ` Thomas Monjalon
2021-04-15 16:02           ` Andrew Rybchenko
2021-04-10 14:03     ` [dpdk-dev] [PATCH v2 2/4] app/test-pmd: change to indirect action command Bing Zhao
2021-04-10 14:03     ` [dpdk-dev] [PATCH v2 3/4] doc: update user guide for indirect action Bing Zhao
2021-04-10 14:03     ` [dpdk-dev] [PATCH v2 4/4] net/mlx5: adaption to indirect action API Bing Zhao
2021-04-12 19:40     ` [dpdk-dev] [PATCH v2 0/4] Change shared action API to action handle API Ferruh Yigit
2021-04-13  1:22       ` Bing Zhao
2021-04-13  7:23         ` Thomas Monjalon
2021-04-13  7:24           ` Bing Zhao
2021-04-15 15:51   ` [dpdk-dev] [PATCH v3 0/1] " Bing Zhao
2021-04-15 15:51     ` [dpdk-dev] [PATCH v3 1/1] ethdev: introduce indirect action APIs Bing Zhao
2021-04-15 15:56       ` Ori Kam
2021-04-15 17:59       ` Ajit Khaparde
2021-04-16  6:58         ` Bing Zhao
2021-04-16  7:03         ` Thomas Monjalon
2021-04-16 15:00           ` Ajit Khaparde
2021-04-16 17:33   ` [dpdk-dev] [PATCH v4 0/1] Change shared action API to action handle API Bing Zhao
2021-04-16 17:33     ` [dpdk-dev] [PATCH v4 1/1] ethdev: introduce indirect action APIs Bing Zhao
2021-04-19 12:26       ` Thomas Monjalon
2021-04-19 15:05         ` Bing Zhao
2021-04-19 14:28   ` [dpdk-dev] [PATCH v5] Change shared action API to action handle API Bing Zhao
2021-04-19 14:28     ` [dpdk-dev] [PATCH v5] ethdev: introduce indirect action APIs Bing Zhao
2021-04-19 14:38   ` [dpdk-dev] [PATCH v5 0/1] Change shared action API to action handle API Bing Zhao
2021-04-19 14:38     ` [dpdk-dev] [PATCH v5 1/1] ethdev: introduce indirect action APIs Bing Zhao
2021-04-19 14:50       ` Thomas Monjalon
2021-04-19 15:09         ` 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=MN2PR12MB29097FE55676D5D389D86C46D0769@MN2PR12MB2909.namprd12.prod.outlook.com \
    --to=bingz@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 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 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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