diff mbox

[net-next,v2,4/5] bonding: fix LACP PDU not sent on slave port sometimes

Message ID 1422253021-3798-5-git-send-email-jtoppins@cumulusnetworks.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jonathan Toppins Jan. 26, 2015, 6:17 a.m. UTC
From: Satish Ashok <sashok@cumulusnetworks.com>

When a slave is added to a bond and it is not in full duplex mode,
AD_PORT_LACP_ENABLED flag is cleared, due to this LACP PDU is not sent
on slave. When the duplex is changed to full, the flag needs to be set
to send LACP PDU.

Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
---
 drivers/net/bonding/bond_3ad.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Sergei Shtylyov Jan. 26, 2015, 12:04 p.m. UTC | #1
Hello.

On 1/26/2015 9:17 AM, Jonathan Toppins wrote:

> From: Satish Ashok <sashok@cumulusnetworks.com>

> When a slave is added to a bond and it is not in full duplex mode,
> AD_PORT_LACP_ENABLED flag is cleared, due to this LACP PDU is not sent

    s/is not/not being/.

> on slave. When the duplex is changed to full, the flag needs to be set
> to send LACP PDU.

> Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
> Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
> Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
> ---
>   drivers/net/bonding/bond_3ad.c |   11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index e3c96b2..cfc4a9c 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -2219,8 +2219,10 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
>   		switch (lacpdu->subtype) {
>   		case AD_TYPE_LACPDU:
>   			ret = RX_HANDLER_CONSUMED;
> -			netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n",
> -				   port->actor_port_number);
> +			netdev_dbg(slave->bond->dev,
> +				   "Received LACPDU on port %d slave %s\n",
> +				   port->actor_port_number,
> +				   slave->dev->name);
>   			/* Protect against concurrent state machines */
>   			spin_lock(&slave->bond->mode_lock);
>   			ad_rx_machine(lacpdu, port);
> @@ -2312,7 +2314,10 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
>   	port->actor_admin_port_key &= ~AD_DUPLEX_KEY_MASKS;
>   	port->actor_oper_port_key = port->actor_admin_port_key |=
>   		__get_duplex(port);
> -	netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number);
> +	netdev_dbg(slave->bond->dev, "Port %d slave %s changed duplex\n",
> +		   port->actor_port_number, slave->dev->name);

    The above 2 changes seem unrelated/undocumented in the change log...

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jay Vosburgh Jan. 27, 2015, 12:45 a.m. UTC | #2
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:

>Hello.
>
>On 1/26/2015 9:17 AM, Jonathan Toppins wrote:
>
>> From: Satish Ashok <sashok@cumulusnetworks.com>
>
>> When a slave is added to a bond and it is not in full duplex mode,
>> AD_PORT_LACP_ENABLED flag is cleared, due to this LACP PDU is not sent
>
>   s/is not/not being/.

	I don't have an issue with the original text, or the updating of
nearby debug messages to include the device name (below).  Worst case
would be to respin and add a mention of this to the commit message.

	-J

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>> on slave. When the duplex is changed to full, the flag needs to be set
>> to send LACP PDU.
>
>> Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
>> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
>> Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
>> Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
>> ---
>>   drivers/net/bonding/bond_3ad.c |   11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>> index e3c96b2..cfc4a9c 100644
>> --- a/drivers/net/bonding/bond_3ad.c
>> +++ b/drivers/net/bonding/bond_3ad.c
>> @@ -2219,8 +2219,10 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
>>   		switch (lacpdu->subtype) {
>>   		case AD_TYPE_LACPDU:
>>   			ret = RX_HANDLER_CONSUMED;
>> -			netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n",
>> -				   port->actor_port_number);
>> +			netdev_dbg(slave->bond->dev,
>> +				   "Received LACPDU on port %d slave %s\n",
>> +				   port->actor_port_number,
>> +				   slave->dev->name);
>>   			/* Protect against concurrent state machines */
>>   			spin_lock(&slave->bond->mode_lock);
>>   			ad_rx_machine(lacpdu, port);
>> @@ -2312,7 +2314,10 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
>>   	port->actor_admin_port_key &= ~AD_DUPLEX_KEY_MASKS;
>>   	port->actor_oper_port_key = port->actor_admin_port_key |=
>>   		__get_duplex(port);
>> -	netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number);
>> +	netdev_dbg(slave->bond->dev, "Port %d slave %s changed duplex\n",
>> +		   port->actor_port_number, slave->dev->name);
>
>   The above 2 changes seem unrelated/undocumented in the change log...
>
>[...]
>
>WBR, Sergei
>

---
	-Jay Vosburgh, jay.vosburgh@canonical.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index e3c96b2..cfc4a9c 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2219,8 +2219,10 @@  static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
 		switch (lacpdu->subtype) {
 		case AD_TYPE_LACPDU:
 			ret = RX_HANDLER_CONSUMED;
-			netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n",
-				   port->actor_port_number);
+			netdev_dbg(slave->bond->dev,
+				   "Received LACPDU on port %d slave %s\n",
+				   port->actor_port_number,
+				   slave->dev->name);
 			/* Protect against concurrent state machines */
 			spin_lock(&slave->bond->mode_lock);
 			ad_rx_machine(lacpdu, port);
@@ -2312,7 +2314,10 @@  void bond_3ad_adapter_duplex_changed(struct slave *slave)
 	port->actor_admin_port_key &= ~AD_DUPLEX_KEY_MASKS;
 	port->actor_oper_port_key = port->actor_admin_port_key |=
 		__get_duplex(port);
-	netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number);
+	netdev_dbg(slave->bond->dev, "Port %d slave %s changed duplex\n",
+		   port->actor_port_number, slave->dev->name);
+	if (port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS)
+		port->sm_vars |= AD_PORT_LACP_ENABLED;
 	/* there is no need to reselect a new aggregator, just signal the
 	 * state machines to reinitialize
 	 */