DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Weijun Pan <wpan3636@gmail.com>
Cc: Chas Williams <3chas3@gmail.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	dev@dpdk.org
Subject: Re: [RFC PATCH v4 2/2] net/bonding: restrict secondary control operations
Date: Sat, 29 Aug 2026 21:29:57 -0700	[thread overview]
Message-ID: <20260829212957.23395a9f@phoenix.local> (raw)
In-Reply-To: <20260830011445.168073-2-wpan3636@gmail.com>

On Sat, 29 Aug 2026 20:14:45 -0500
Weijun Pan <wpan3636@gmail.com> wrote:

> diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> index 2fa1ac4028..a3f197c8b5 100644
> --- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> +++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> @@ -254,6 +254,36 @@ Like all other PMD, all functions exported by a PMD are lock-free functions
>  that are assumed not to be invoked in parallel on different logical cores to
>  work on the same target object.
>  
> +Bonding device configuration and LACP runtime state are owned by the primary
> +process. Secondary processes may attach to an existing bonding device for
> +detach and supported query operations only.
> +
> +Supported secondary-process queries include device information, statistics,
> +link status, RETA query, RSS hash configuration, bonding mode, member list,
> +primary member, transmit policy, link monitoring configuration, and LACP
> +configuration. Private dump is limited to shared bonding information and skips
> +LACP runtime state in a secondary process.
> +
> +Control operations are restricted to the primary process. This includes
> +configuring, starting or stopping the device, setting up queues, changing
> +members, changing the bonding mode, selecting the primary member, changing the
> +transmit policy, changing link monitoring or propagation delays, updating RSS,
> +changing MAC addresses, changing MTU, configuring VLAN filters, changing
> +promiscuous or all-multicast mode, resetting statistics, configuring
> +``rte_flow`` rules, and changing 802.3ad settings, including aggregation
> +selection, external collect/distribute/slow-Tx controls, and dedicated queue
> +enable or disable.
> +
> +LACP runtime state queries, including ``rte_eth_bond_8023ad_member_info()``,
> +``rte_eth_bond_8023ad_ext_collect_get()``, and
> +``rte_eth_bond_8023ad_ext_distrib_get()``, are also restricted to the primary
> +process.
> +
> +Rx and Tx are not supported on a bonding device in a secondary process;
> +receive returns no packets and transmit drops packets. In a secondary process,
> +``rte_eth_dev_stop()`` returns ``-ENOTSUP`` and ``rte_eth_dev_close()`` is the
> +detach operation.
> +

That is way too long an explanation (thanks AI). Should just be short summary here.

> +* **Restricted bonding device control to the primary process.**
> +
> +  Bonding device configuration and LACP runtime state operations are now
> +  rejected in secondary processes. Secondary processes may detach and use
> +  supported query operations only.
> +

Once again, AI is being too wordy. It was always true that bonding control
did not work for secondary. And it is not really an API change.
Should be under Added items, like "Bonding allow data operations in secondary process"

> +static inline int
> +bond_check_primary(const char *op, int err)
> +{
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
> +		return 0;
> +
> +	RTE_BOND_LOG(ERR, "%s not supported in non-primary process", op);
> +	return err;
> +}

When ever possible avoid using negatives in English speech.
Should just say "%s not supported in secondary process.
And returning different errors is awkward way to handle.
Just make helper that returns true/false and if false put that error code at
that location in caller.

Then you can eliminate lots of "int ret" in the calling code as well.



  reply	other threads:[~2026-08-30  4:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 17:42 [RFC PATCH] net/bonding: reject control operations in secondary Weijun Pan
2026-07-22 23:10 ` Stephen Hemminger
2026-07-26 17:32 ` Stephen Hemminger
2026-08-23 15:16 ` [RFC PATCH v2] net/bonding: restrict secondary control operations Weijun Pan
2026-08-23 15:43   ` Stephen Hemminger
2026-08-24  2:39     ` Weijun Pan
2026-08-24 16:15   ` Stephen Hemminger
2026-08-26 16:10   ` [RFC PATCH v3] " Weijun Pan
2026-08-26 17:53     ` Stephen Hemminger
2026-08-30  1:14     ` [RFC PATCH v4 1/2] net/bonding: skip unavailable member stats Weijun Pan
2026-08-30  1:14       ` [RFC PATCH v4 2/2] net/bonding: restrict secondary control operations Weijun Pan
2026-08-30  4:29         ` Stephen Hemminger [this message]
2026-08-30  4:22       ` [RFC PATCH v4 1/2] net/bonding: skip unavailable member stats Stephen Hemminger
2026-08-30 16:35       ` [RFC PATCH v5 " Weijun Pan
2026-08-30 16:35         ` [RFC PATCH v5 2/2] net/bonding: restrict secondary control operations Weijun Pan
2026-08-30 20:23 ` [PATCH 0/8] net/bonding: fixes and per-member statistics Stephen Hemminger
2026-08-30 20:23   ` [PATCH 1/8] net/bonding: fix TLB member ordering with unusable member Stephen Hemminger
2026-08-30 20:23   ` [PATCH 2/8] net/bonding: skip unavailable member stats Stephen Hemminger
2026-08-30 20:23   ` [PATCH 3/8] net/bonding: skip unavailable members in device info Stephen Hemminger
2026-08-30 20:23   ` [PATCH 4/8] net/bonding: use atomic link status accessors Stephen Hemminger
2026-08-30 20:23   ` [PATCH 5/8] net/bonding: restrict control operations in secondary process Stephen Hemminger
2026-08-30 20:23   ` [PATCH 6/8] net/bonding: add extended statistics Stephen Hemminger
2026-08-30 20:23   ` [PATCH 7/8] test/bonding: add extended statistics test Stephen Hemminger
2026-08-30 20:23   ` [PATCH 8/8] doc: add bonding features matrix Stephen Hemminger
2026-08-31 16:06 ` [PATCH v2 0/8] net/bonding: fixes and per-member stats Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 1/8] net/bonding: fix TLB member ordering with unusable member Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 2/8] net/bonding: skip unavailable member stats Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 3/8] net/bonding: skip unavailable members in device info Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 4/8] net/bonding: use atomic link status accessors Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 5/8] net/bonding: restrict control ops in secondary process Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 6/8] net/bonding: add extended statistics Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 7/8] test/bonding: add extended statistics test Stephen Hemminger
2026-08-31 16:06   ` [PATCH v2 8/8] doc: add bonding features matrix Stephen Hemminger

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=20260829212957.23395a9f@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=3chas3@gmail.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    --cc=wpan3636@gmail.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