From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1D46A04DD; Tue, 26 Nov 2019 12:55:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06E1B2A5D; Tue, 26 Nov 2019 12:55:12 +0100 (CET) Received: from mail2.protei.ru (mail2.protei.ru [62.152.87.202]) by dpdk.org (Postfix) with ESMTP id E201DCF3 for ; Tue, 26 Nov 2019 12:55:10 +0100 (CET) Received: from smtp.protei.ru (imap.protei.ru [10.0.0.6]) by mail2.protei.ru (Postfix) with ESMTP id 6B5ED4001D97; Tue, 26 Nov 2019 14:55:06 +0300 (MSK) Received: from localhost (unknown [127.0.0.1]) by smtp.protei.ru (Postfix) with ESMTP id 63279111AE7F; Tue, 26 Nov 2019 11:55:06 +0000 (UTC) Received: from smtp.protei.ru ([127.0.0.1]) by localhost (imap.protei.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id q1HRsD5SUNdQ; Tue, 26 Nov 2019 14:55:06 +0300 (MSK) Received: from localhost.localdomain (podovinnikov.protei [192.168.100.231]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.protei.ru (Postfix) with ESMTPSA id D8AF3111AE2C; Tue, 26 Nov 2019 14:55:05 +0300 (MSK) From: Vadim To: linville@tuxdriver.com Cc: dev@dpdk.org, Vadim Date: Tue, 26 Nov 2019 14:55:08 +0300 Message-Id: <20191126115508.11138-1-podovinnikov@protei.ru> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191125180323.E0B174C90@dpdk.org> References: <20191125180323.E0B174C90@dpdk.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] fix lacp check system address X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Vadim fix lacp check system address --- drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index b77a37ddb..d4dda790a 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -792,18 +792,33 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct lacpdu_header *lacp; struct lacpdu_actor_partner_params *partner; + struct port *port, *agg; if (lacp_pkt != NULL) { lacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *); RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); partner = &lacp->lacpdu.partner; + port = &bond_mode_8023ad_ports[slave_id]; + agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; + if (rte_is_same_ether_addr(&partner->port_params.system, - &internals->mode4.mac_addr)) { + &agg->actor.system)) { /* This LACP frame is sending to the bonding port * so pass it to rx_machine. */ rx_machine(internals, slave_id, &lacp->lacpdu); + } else { + char preferred_system_name[RTE_ETHER_ADDR_FMT_SIZE]; + char self_system_name[RTE_ETHER_ADDR_FMT_SIZE]; + rte_ether_format_addr(preferred_system_name, + RTE_ETHER_ADDR_FMT_SIZE, + &partner->port_params.system); + rte_ether_format_addr(self_system_name, + RTE_ETHER_ADDR_FMT_SIZE, &agg->actor.system); + MODE4_DEBUG("preferred partner system %s not equal " + "self system: %s\n", + preferred_system_name, self_system_name); } rte_pktmbuf_free(lacp_pkt); } else -- 2.24.0