On Sat, 29 Aug 2026 20:14:45 -0500
Weijun Pan <[email protected]> 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.