netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Mateusz Palczewski <mateusz.palczewski@intel.com>
Cc: andy@greyhouse.net, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, dbanerje@akamai.com,
	netdev@vger.kernel.org,
	Sebastian Basierski <sebastianx.basierski@intel.com>
Subject: Re: [PATCH iwl-net v1 1/2] drivers/net/bonding/bond_3ad: Use updated MAC address for lacpdu packets
Date: Tue, 16 May 2023 08:02:56 -0700	[thread overview]
Message-ID: <31753.1684249376@famine> (raw)
In-Reply-To: <20230516134447.193511-2-mateusz.palczewski@intel.com>

Mateusz Palczewski <mateusz.palczewski@intel.com> wrote:

>From: Sebastian Basierski <sebastianx.basierski@intel.com>
>
>After changing VFs MAC address, bonding driver shouldn't use
>the old address. Otherwise lapcdu packets will have set wrong
>source MAC address.

	This patch is incorrect, the existing code is behaving
correctly.

	Bonding uses the original device MAC address deliberately, as
IEEE 802.1AX-2014 6.2.1.i requires that each port utilize a MAC address
that is "unique over the LAG" as the source address for LACPDUs.

	As bonding sets all ports of the bond to the same MAC (so that
non-control traffic uses the same source MAC per 802.1AX 6.2.1.j), this
change would cause every port of the bond to use a single MAC address
for the LACPDU source address, thus violating 802.1AX.

	-J

>Fixes: ada0f8633c5b ("bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)")
>Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
>Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
>---
> drivers/net/bonding/bond_3ad.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index c99ffe6c683a..b5202af79f20 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -869,10 +869,10 @@ static int ad_lacpdu_send(struct port *port)
> 	lacpdu_header = skb_put(skb, length);
> 
> 	ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
>-	/* Note: source address is set to be the member's PERMANENT address,
>+	/* Note: source address is set to be the member's CURRENT address,
> 	 * because we use it to identify loopback lacpdus in receive.
> 	 */
>-	ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
>+	ether_addr_copy(lacpdu_header->hdr.h_source, slave->dev->dev_addr);
> 	lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
> 
> 	lacpdu_header->lacpdu = port->lacpdu;
>-- 
>2.31.1

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

  reply	other threads:[~2023-05-16 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 13:44 [PATCH iwl-net v1 0/2] Fix for bond 802.3ad mode with VFs Mateusz Palczewski
2023-05-16 13:44 ` [PATCH iwl-net v1 1/2] drivers/net/bonding/bond_3ad: Use updated MAC address for lacpdu packets Mateusz Palczewski
2023-05-16 15:02   ` Jay Vosburgh [this message]
2023-05-16 13:44 ` [PATCH iwl-net v1 2/2] drivers/net/bonding: Added some delay while checking for VFs link Mateusz Palczewski
2023-05-16 15:15   ` Jay Vosburgh

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=31753.1684249376@famine \
    --to=jay.vosburgh@canonical.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dbanerje@akamai.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=mateusz.palczewski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sebastianx.basierski@intel.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).