From: Hangbin Liu <liuhangbin@gmail.com>
To: "Jones Syue 薛懷宗" <jonessyue@qnap.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"j.vosburgh@gmail.com" <j.vosburgh@gmail.com>,
"andy@greyhouse.net" <andy@greyhouse.net>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"corbet@lwn.net" <corbet@lwn.net>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v2] bonding: 802.3ad replace MAC_ADDRESS_EQUAL with __agg_has_partner
Date: Fri, 23 Feb 2024 15:48:21 +0800 [thread overview]
Message-ID: <ZdhNxWivTVixYRFK@Laptop-X1> (raw)
In-Reply-To: <SI2PR04MB5097AA23EE6799B3E56C0762DC552@SI2PR04MB5097.apcprd04.prod.outlook.com>
Hi Jones,
On Fri, Feb 23, 2024 at 04:12:00AM +0000, Jones Syue 薛懷宗 wrote:
> They are verifying the same thing: if aggregator has a partner or not.
> Replaces macro with inline function would look more clear to understand.
MAC_ADDRESS_EQUAL and __agg_has_partner are not the same thing.
MAC_ADDRESS_EQUAL() is only same with __agg_has_partner() when verifying
agg partner mac addr with null_mac_addr. The description could be more
accurate.
Since you want to replace the null_mac_addr checking for MAC_ADDRESS_EQUAL().
Maybe we can also replace the null_mac_addr checking in
ad_port_selection_logic(). This should be safe as the
aggregator->partner_system and port->partner_oper.system has been compared.
e.g.
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index f2942e8c6c91..bd46dcb4013c 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1588,7 +1588,7 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
(aggregator->partner_system_priority == port->partner_oper.system_priority) &&
(aggregator->partner_oper_aggregator_key == port->partner_oper.key)
) &&
- ((!MAC_ADDRESS_EQUAL(&(port->partner_oper.system), &(null_mac_addr)) && /* partner answers */
+ ((__agg_has_partner(aggregator) && /* partner answers */
!aggregator->is_individual) /* but is not individual OR */
)
) {
With this the null_mac_addr definition could be removed.
Thanks
Hangbin
next prev parent reply other threads:[~2024-02-23 7:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 4:12 [PATCH net-next v2] bonding: 802.3ad replace MAC_ADDRESS_EQUAL with __agg_has_partner Jones Syue 薛懷宗
2024-02-23 7:48 ` Hangbin Liu [this message]
2024-02-23 10:03 ` Jones Syue 薛懷宗
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=ZdhNxWivTVixYRFK@Laptop-X1 \
--to=liuhangbin@gmail.com \
--cc=andy@greyhouse.net \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=j.vosburgh@gmail.com \
--cc=jonessyue@qnap.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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