DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Rongwei Liu <rongweil@nvidia.com>
Cc: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
	<thomas@monjalon.net>, Ferruh Yigit <ferruh.yigit@amd.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, <dev@dpdk.org>,
	<rasland@nvidia.com>
Subject: Re: [RFC 2/2] ethdev: add API to set process to primary or secondary
Date: Thu, 1 Dec 2022 07:10:11 -0800	[thread overview]
Message-ID: <20221201071011.1fd30f68@hermes.local> (raw)
In-Reply-To: <20221201082005.732252-3-rongweil@nvidia.com>

On Thu, 1 Dec 2022 10:20:05 +0200
Rongwei Liu <rongweil@nvidia.com> wrote:

> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Set the rte_eth process to the primary or secondary role which affects
> + * the flow rules offloading. It doesn't allow multiple processes to be the
> + * same role unless no offload rules are set.
> + * The primary process's flow rules are effective immediately while the secondary
> + * process's rules will be queued in hardware until it becomes primary or no
> + * primary process is alive.
> + * The primary application will always receive traffic while the secondary
> + * application will receive traffic when no matching rules are present from
> + * the primary application.
> + *
> + * The application is primary by default if this API is not called.
> + *
> + * When a process transforms from a secondary to a primary role, all preceding
> + * flow rules which are queued by hardware will be effective immediately.
> + * Before role transition, all the rules set by the primary process should be
> + * flushed first.
> + *
> + * When role flag "RTE_ETH_PROCESS_NIC_DUP_WITH_SECONDARY" is set, NIC domain
> + * flow rules are effective immediately even if a process is secondary.
> + *
> + * @param active
> + *   Process primary (role) or not (secondary).
> + * @param flag
> + *   The role flag.
> + * @return
> + *   - (>=0) Number of rte devices which have been switched successfully.
> + *   - (-EINVAL) if bad parameter.
> + */
> +__rte_experimental
> +int rte_eth_process_set_primary(bool primary, uint32_t flag);

The state of the devices and the system is really unstable if
this fails. There is no rollback here.

I think this should have a PMD capability flag so that application
can check that device supports doing this. And it would have to
be opt-in so that existing devices would always fail.


  reply	other threads:[~2022-12-01 15:10 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  8:20 [RFC 0/2] " Rongwei Liu
2022-12-01  8:20 ` [RFC 1/2] ethdev: add group description Rongwei Liu
2022-12-01  8:20 ` [RFC 2/2] ethdev: add API to set process to primary or secondary Rongwei Liu
2022-12-01 15:10   ` Stephen Hemminger [this message]
2022-12-02  3:27     ` Rongwei Liu
2022-12-05 16:08       ` Stephen Hemminger
2022-12-06  3:47         ` Rongwei Liu
2022-12-06  5:54           ` Stephen Hemminger
2022-12-21  9:00             ` [RFC v3 0/2] add API to set process to active or standby Rongwei Liu
2022-12-21  9:00               ` [RFC v3 1/2] ethdev: add group description Rongwei Liu
2023-01-18 15:44                 ` [PATCH v4 0/3] add API for live migration Rongwei Liu
2023-01-18 15:44                   ` [PATCH v4 1/3] ethdev: add flow rule group description Rongwei Liu
2023-01-31 11:53                     ` Ori Kam
2023-02-06 12:15                       ` Rongwei Liu
2023-02-07  2:57                     ` [PATCH v5] " Rongwei Liu
2023-02-08 20:28                       ` Ferruh Yigit
2023-02-09  2:06                         ` Rongwei Liu
2023-02-09  7:32                         ` [PATCH v6] " Rongwei Liu
2023-02-09  8:01                           ` Ori Kam
2023-02-09 11:26                             ` Ferruh Yigit
2023-01-18 15:44                   ` [PATCH v4 2/3] ethdev: add standby state for live migration Rongwei Liu
2023-01-31 13:50                     ` Ori Kam
2023-01-31 18:14                     ` Jerin Jacob
2023-01-31 22:55                       ` Thomas Monjalon
2023-02-01  7:32                         ` Andrew Rybchenko
2023-02-01  8:31                           ` Thomas Monjalon
2023-02-01  8:40                           ` Jerin Jacob
2023-02-01  8:46                             ` Thomas Monjalon
2023-02-02 10:23                               ` Rongwei Liu
2023-02-01  7:52                     ` Andrew Rybchenko
2023-02-01  8:27                       ` Thomas Monjalon
2023-02-01  8:40                         ` Andrew Rybchenko
2023-01-18 15:44                   ` [PATCH v4 3/3] ethdev: add standby flags " Rongwei Liu
2023-01-23 13:20                     ` Jerin Jacob
2023-01-30  2:47                       ` Rongwei Liu
2023-01-30 17:10                         ` Jerin Jacob
2023-01-31  2:53                           ` Rongwei Liu
2023-01-31  8:45                             ` Jerin Jacob
2023-01-31  9:01                               ` Rongwei Liu
2023-01-31 14:37                                 ` Jerin Jacob
2023-01-31 14:45                                   ` Ori Kam
2023-01-31 17:50                                     ` Thomas Monjalon
2023-01-31 18:10                                       ` Jerin Jacob
2022-12-21  9:00               ` [RFC v3 2/2] ethdev: add API to set process to active or standby Rongwei Liu
2022-12-21  9:12                 ` Jerin Jacob
2022-12-21  9:32                   ` Rongwei Liu
2022-12-21 10:59                     ` Jerin Jacob
2022-12-21 12:05                       ` Rongwei Liu
2022-12-21 12:44                         ` Jerin Jacob
2022-12-21 12:50                           ` Rongwei Liu
2022-12-21 13:12                             ` Jerin Jacob
2022-12-21 14:33                               ` Rongwei Liu
2022-12-26 16:44                                 ` Ori Kam
2023-01-15 22:46                                   ` Thomas Monjalon

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=20221201071011.1fd30f68@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=rongweil@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.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).