[1/2,net-next,v2] bonding: Extending LACP MUX State Machine to include a Collecting State.

Message ID 20240105000632.2484182-1-aahila@google.com
State New
Headers
Series [1/2,net-next,v2] bonding: Extending LACP MUX State Machine to include a Collecting State. |

Commit Message

Aahil Awatramani Jan. 5, 2024, 12:06 a.m. UTC
  Introduces two new states, AD_MUX_COLLECTING and AD_MUX_DISTRIBUTING in
the LACP MUX state machine for separated handling of an initial
Collecting state before the Collecting and Distributing state. This
enables a port to be in a state where it can receive incoming packets
while not still distributing. This is useful for reducing packet loss when
a port begins distributing before its partner is able to collect.
Additionally this also brings the 802.3ad bonding driver's implementation
closer to the LACP specification which already predefined this behaviour,
that is currently the implementation only supports coupled control.

Added new functions such as bond_set_slave_tx_disabled_flags and
bond_set_slave_rx_enabled_flags to precisely manage the port's collecting
and distributing states. Previously, there was no dedicated method to
disable TX while keeping RX enabled, which this patch addresses.

Note that the regular flow process in the kernel's bonding driver remains
unaffected by this patch. The extension requires explicit opt-in by the
user (in order to ensure no disruptions for existing setups) via netlink
support using the new bonding parameter coupled_control. The default value
for coupled_control is set to 1 so as to preserve existing behaviour.

Signed-off-by: Aahil Awatramani <aahila@google.com>
---
 Documentation/networking/bonding.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Jay Vosburgh Jan. 5, 2024, 1:38 a.m. UTC | #1
Aahil Awatramani <aahila@google.com> wrote:

>Introduces two new states, AD_MUX_COLLECTING and AD_MUX_DISTRIBUTING in
>the LACP MUX state machine for separated handling of an initial
>Collecting state before the Collecting and Distributing state. This
>enables a port to be in a state where it can receive incoming packets
>while not still distributing. This is useful for reducing packet loss when
>a port begins distributing before its partner is able to collect.
>Additionally this also brings the 802.3ad bonding driver's implementation
>closer to the LACP specification which already predefined this behaviour,
>that is currently the implementation only supports coupled control.
>
>Added new functions such as bond_set_slave_tx_disabled_flags and
>bond_set_slave_rx_enabled_flags to precisely manage the port's collecting
>and distributing states. Previously, there was no dedicated method to
>disable TX while keeping RX enabled, which this patch addresses.
>
>Note that the regular flow process in the kernel's bonding driver remains
>unaffected by this patch. The extension requires explicit opt-in by the
>user (in order to ensure no disruptions for existing setups) via netlink
>support using the new bonding parameter coupled_control. The default value
>for coupled_control is set to 1 so as to preserve existing behaviour.
>
>Signed-off-by: Aahil Awatramani <aahila@google.com>
>---
> Documentation/networking/bonding.rst | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst
>index f7a73421eb76..cb3e6013605d 100644
>--- a/Documentation/networking/bonding.rst
>+++ b/Documentation/networking/bonding.rst
>@@ -444,6 +444,14 @@ arp_missed_max
> 
> 	The default value is 2, and the allowable range is 1 - 255.
> 
>+coupled_control
>+
>+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
>+    should have separate Collecting and Distributing states.
>+
>+    The default value is 1. This setting does not separate the Collecting
>+    and Distributing states, maintaining the bond in coupled control.
>+

	Please reference the standard in the description; this is
implementing the independent control state machine per IEEE 802.1AX-2008
5.4.15 in addition to the existing coupled control state machine.

	-J

> downdelay
> 
> 	Specifies the time, in milliseconds, to wait before disabling
>-- 
>2.43.0.472.g3155946c3a-goog
>
>

---
	-Jay Vosburgh, jay.vosburgh@canonical.com
  
Hangbin Liu Jan. 8, 2024, 3:46 a.m. UTC | #2
On Thu, Jan 04, 2024 at 05:38:52PM -0800, Jay Vosburgh wrote:
> >+coupled_control
> >+
> >+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
> >+    should have separate Collecting and Distributing states.
> >+
> >+    The default value is 1. This setting does not separate the Collecting
> >+    and Distributing states, maintaining the bond in coupled control.
> >+
> 
> 	Please reference the standard in the description; this is
> implementing the independent control state machine per IEEE 802.1AX-2008
> 5.4.15 in addition to the existing coupled control state machine.

The status of IEEE 802.1AX-2008[1] is "Superseded Standard". Maybe we should
use IEEE 802.1AX-2020[2].

[1] https://standards.ieee.org/ieee/802.1AX/4176/
[2] https://standards.ieee.org/ieee/802.1AX/6768/

Thanks
Hangbin
  
Aahil Awatramani Jan. 9, 2024, 7:06 p.m. UTC | #3
Thank you folk for your feedback.

Currently due to travelling reasons there will be a slight delay in my updates
but this should be resolved soon and I should be able to provide quicker
iterative feedback.

Thank you again for your reviews,
Aahil

On Sun, Jan 7, 2024 at 7:46 PM Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> On Thu, Jan 04, 2024 at 05:38:52PM -0800, Jay Vosburgh wrote:
> > >+coupled_control
> > >+
> > >+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
> > >+    should have separate Collecting and Distributing states.
> > >+
> > >+    The default value is 1. This setting does not separate the Collecting
> > >+    and Distributing states, maintaining the bond in coupled control.
> > >+
> >
> >       Please reference the standard in the description; this is
> > implementing the independent control state machine per IEEE 802.1AX-2008
> > 5.4.15 in addition to the existing coupled control state machine.
>
> The status of IEEE 802.1AX-2008[1] is "Superseded Standard". Maybe we should
> use IEEE 802.1AX-2020[2].
>
> [1] https://standards.ieee.org/ieee/802.1AX/4176/
> [2] https://standards.ieee.org/ieee/802.1AX/6768/
>
> Thanks
> Hangbin
  
Jay Vosburgh Jan. 9, 2024, 7:53 p.m. UTC | #4
Hangbin Liu <liuhangbin@gmail.com> wrote:

>On Thu, Jan 04, 2024 at 05:38:52PM -0800, Jay Vosburgh wrote:
>> >+coupled_control
>> >+
>> >+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
>> >+    should have separate Collecting and Distributing states.
>> >+
>> >+    The default value is 1. This setting does not separate the Collecting
>> >+    and Distributing states, maintaining the bond in coupled control.
>> >+
>> 
>> 	Please reference the standard in the description; this is
>> implementing the independent control state machine per IEEE 802.1AX-2008
>> 5.4.15 in addition to the existing coupled control state machine.
>
>The status of IEEE 802.1AX-2008[1] is "Superseded Standard". Maybe we should
>use IEEE 802.1AX-2020[2].
>
>[1] https://standards.ieee.org/ieee/802.1AX/4176/
>[2] https://standards.ieee.org/ieee/802.1AX/6768/

	I'm fine to still reference the 2008 (or 2014) standard even
though it's superseded; the 2020 standard is much more complicated, and
I find it harder to follow (particularly for the coupled / independent
control sections, the older standard explains them more clearly in my
reading).  Bonding does not implement any of the new things added for
the 2020 version, so we're not really missing anything.

	That said, as long as the citations are for the correct section
(the numbering is not consistent between versions) any version is
acceptable.

	-J

---
	-Jay Vosburgh, jay.vosburgh@canonical.com
  
Aahil Awatramani Jan. 11, 2024, 8:31 p.m. UTC | #5
> > >>    Please reference the standard in the description; this is
> > >> implementing the independent control state machine per IEEE 802.1AX-2008
> > >> 5.4.15 in addition to the existing coupled control state machine.
> > >
> > >The status of IEEE 802.1AX-2008[1] is "Superseded Standard". Maybe we should
> > >use IEEE 802.1AX-2020[2].
> > >
> > >[1] https://standards.ieee.org/ieee/802.1AX/4176/
> > >[2] https://standards.ieee.org/ieee/802.1AX/6768/
> >
> >       I'm fine to still reference the 2008 (or 2014) standard even
> > though it's superseded; the 2020 standard is much more complicated, and
> > I find it harder to follow (particularly for the coupled / independent
> > control sections, the older standard explains them more clearly in my
> > reading).  Bonding does not implement any of the new things added for
> > the 2020 version, so we're not really missing anything.
> >
> >       That said, as long as the citations are for the correct section
> > (the numbering is not consistent between versions) any version is
> > acceptable.

I have gone ahead and referenced 2008 in the documentation.


On Tue, Jan 9, 2024 at 11:53 AM Jay Vosburgh <jay.vosburgh@canonical.com> wrote:
>
> Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> >On Thu, Jan 04, 2024 at 05:38:52PM -0800, Jay Vosburgh wrote:
> >> >+coupled_control
> >> >+
> >> >+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
> >> >+    should have separate Collecting and Distributing states.
> >> >+
> >> >+    The default value is 1. This setting does not separate the Collecting
> >> >+    and Distributing states, maintaining the bond in coupled control.
> >> >+
> >>
> >>      Please reference the standard in the description; this is
> >> implementing the independent control state machine per IEEE 802.1AX-2008
> >> 5.4.15 in addition to the existing coupled control state machine.
> >
> >The status of IEEE 802.1AX-2008[1] is "Superseded Standard". Maybe we should
> >use IEEE 802.1AX-2020[2].
> >
> >[1] https://standards.ieee.org/ieee/802.1AX/4176/
> >[2] https://standards.ieee.org/ieee/802.1AX/6768/
>
>         I'm fine to still reference the 2008 (or 2014) standard even
> though it's superseded; the 2020 standard is much more complicated, and
> I find it harder to follow (particularly for the coupled / independent
> control sections, the older standard explains them more clearly in my
> reading).  Bonding does not implement any of the new things added for
> the 2020 version, so we're not really missing anything.
>
>         That said, as long as the citations are for the correct section
> (the numbering is not consistent between versions) any version is
> acceptable.
>
>         -J
>
> ---
>         -Jay Vosburgh, jay.vosburgh@canonical.com
  

Patch

diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst
index f7a73421eb76..cb3e6013605d 100644
--- a/Documentation/networking/bonding.rst
+++ b/Documentation/networking/bonding.rst
@@ -444,6 +444,14 @@  arp_missed_max
 
 	The default value is 2, and the allowable range is 1 - 255.
 
+coupled_control
+
+    Specifies whether the LACP state machine's MUX in the 802.3ad mode
+    should have separate Collecting and Distributing states.
+
+    The default value is 1. This setting does not separate the Collecting
+    and Distributing states, maintaining the bond in coupled control.
+
 downdelay
 
 	Specifies the time, in milliseconds, to wait before disabling