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 C3DBBA04C2; Mon, 25 Nov 2019 19:01:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 029794C90; Mon, 25 Nov 2019 19:01:42 +0100 (CET) Received: from mail2.protei.ru (mail2.protei.ru [62.152.87.202]) by dpdk.org (Postfix) with ESMTP id AEBD628EE for ; Mon, 25 Nov 2019 14:13:39 +0100 (CET) Received: from smtp.protei.ru (imap.protei.ru [10.0.0.6]) by mail2.protei.ru (Postfix) with ESMTP id 95D244001D97; Mon, 25 Nov 2019 16:13:38 +0300 (MSK) Received: from localhost (unknown [127.0.0.1]) by smtp.protei.ru (Postfix) with ESMTP id 65F8E10903F0; Mon, 25 Nov 2019 13:13:38 +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 9QWatqH_aXjP; Mon, 25 Nov 2019 16:13:38 +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 4DC8C10903E2; Mon, 25 Nov 2019 16:13:38 +0300 (MSK) From: Vadim To: chas3@att.com Cc: dev@dpdk.org, podovinnikov Date: Mon, 25 Nov 2019 16:13:26 +0300 Message-Id: <20191125131326.28111-1-podovinnikov@protei.ru> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 25 Nov 2019 19:01:39 +0100 Subject: [dpdk-dev] [PATCH] 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" From: podovinnikov --- drivers/net/bonding/rte_eth_bond_8023ad.c | 22 +++++++++++++++++++++- 1 file changed, 21 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..132ff74a1 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -792,18 +792,38 @@ 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 { + MODE4_DEBUG("prefered partner system %02x:%02x:%02x:%02x:%02x:%02x " + "not equal self system: %02x:%02x:%02x:%02x:%02x:%02x\n", + partner->port_params.system.addr_bytes[0], + partner->port_params.system.addr_bytes[1], + partner->port_params.system.addr_bytes[2], + partner->port_params.system.addr_bytes[3], + partner->port_params.system.addr_bytes[4], + partner->port_params.system.addr_bytes[5], + + agg->actor.system.addr_bytes[0], + agg->actor.system.addr_bytes[1], + agg->actor.system.addr_bytes[2], + agg->actor.system.addr_bytes[3], + agg->actor.system.addr_bytes[4], + agg->actor.system.addr_bytes[5]); } rte_pktmbuf_free(lacp_pkt); } else -- 2.17.1