From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 4062B2C54 for ; Mon, 18 Mar 2019 14:45:13 +0100 (CET) Received: by mail-qk1-f193.google.com with SMTP id z76so9609258qkb.12 for ; Mon, 18 Mar 2019 06:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ilVP3+8fRAZmZL0SyGidVXfG/w2Ig6bQqLVtHigjdWo=; b=t/IH6rkmul3sjsI/rrUjHb9O+F6bIvNGWVPwiNvP/dyP7wVCz/YuV1YQd+i4g08fmE Zx8bT+hWyHdsdMFrZZME4p37aQ6pHpVxrSABP4o1oxs7fQqScCeb6I4KycnmNSXi/5WK g8dJdyd+qVUlSluFy+1kwUxwB/UHp1ZxRy/axW5zNPADSC0GNg8Ke6oNOZ80M5UE1iqv RWszhwzWOEJ4phR9FT4PD1ImPwhopcBoV+rFBW8t/z+gfsO77mKhFqDimvtCNgJK9tlQ Wfa6ZkxSwHq+faoMZIZp/ygLXapo50tjCQCyYeGPoSCHwoIuJCCrYcQYmYxxVaiLj08s SJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ilVP3+8fRAZmZL0SyGidVXfG/w2Ig6bQqLVtHigjdWo=; b=Iqs9AhyhuIWopVj6p6n3dF2ni7+sNLVjmDkTYpQMYvyangT+0iSVSJSgMStbpI+DGJ IaP5RuCPu3Kw1uutJkNWJFp3d1/4es9oj5GBTodxsGsnSEYf5U+oY2yciJq6OpwIWYBl Gqp6QxaMTx7RAVHGIOrGeRDHYjCtQZ3oUA/q0Ay/EzoYgND+5JjohHGEQ5j8A2HV2w8C OGFME6DuSIZVyqyGI/ArxWUzhY+nOj5XaanxGW2MQO6zJ+4Jqw9773XuuC5n25oSRr+c E5+Nf7zSqh4bGLnOpKRLeO+xhzdksVWQwCo6C4pfJcJ2SxFO2sdzng1hWawfCdn08Agi pDCA== X-Gm-Message-State: APjAAAXJOayHEuG1pbLoDVDIqobeQPcnZAzErMBIs2Ze3w5yPynbzNqn fKj13aKJ9Lk+TkHuZVeVN8UXuYGL X-Google-Smtp-Source: APXvYqzUrcV3NDoPH9p3X+/pHTQ9d+7exmQ49D4Mi5y31ZnyNzfv9dETUdHuzPUVY2FdxXQdu5rEUg== X-Received: by 2002:a37:d285:: with SMTP id f127mr12982829qkj.147.1552916712390; Mon, 18 Mar 2019 06:45:12 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id m9sm1698183qkl.2.2019.03.18.06.45.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 06:45:11 -0700 (PDT) To: Liang Zhang , dev@dpdk.org References: <1552640761-16834-1-git-send-email-zhangliang@bigo.sg> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Mon, 18 Mar 2019 09:45:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1552640761-16834-1-git-send-email-zhangliang@bigo.sg> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] bonding: fix lacp negotiation failed 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: , X-List-Received-Date: Mon, 18 Mar 2019 13:45:13 -0000 On 3/15/19 5:06 AM, Liang Zhang wrote: > When monitor(port-mirroring) traffic from other lacp port-channel, > rx_machine_update may recieving other lacp negotiation packets. > Thus bond mode 4 will negotiation failed. > > Signed-off-by: Liang Zhang Acked-by: Chas Williams > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 12 ++++++++++-- > drivers/net/bonding/rte_eth_bond_8023ad_private.h | 1 + > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index dd847c6..dac23ac 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -784,13 +784,20 @@ static void > rx_machine_update(struct bond_dev_private *internals, uint8_t slave_id, > struct rte_mbuf *lacp_pkt) { > struct lacpdu_header *lacp; > + struct lacpdu_actor_partner_params *partner; > > if (lacp_pkt != NULL) { > lacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *); > RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); > > - /* This is LACP frame so pass it to rx_machine */ > - rx_machine(internals, slave_id, &lacp->lacpdu); > + partner = &lacp->lacpdu.partner; > + if (is_same_ether_addr(&partner->port_params.system, > + &internals->mode4.mac_addr)) { > + /* This LACP frame is sending to the bonding port > + * so pass it to rx_machine. > + */ > + rx_machine(internals, slave_id, &lacp->lacpdu); > + } > rte_pktmbuf_free(lacp_pkt); > } else > rx_machine(internals, slave_id, NULL); > @@ -1165,6 +1172,7 @@ bond_mode_8023ad_start(struct rte_eth_dev *bond_dev) > struct mode8023ad_private *mode4 = &internals->mode4; > static const uint64_t us = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS * 1000; > > + rte_eth_macaddr_get(internals->port_id, &mode4->mac_addr); > if (mode4->slowrx_cb) > return rte_eal_alarm_set(us, &bond_mode_8023ad_ext_periodic_cb, > bond_dev); > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h > index c51426b..f91902e 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h > +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h > @@ -150,6 +150,7 @@ struct mode8023ad_private { > uint64_t update_timeout_us; > rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb; > uint8_t external_sm; > + struct ether_addr mac_addr; > > struct rte_eth_link slave_link; > /***< slave link properties */ > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A9686A05FE for ; Mon, 18 Mar 2019 14:45:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 984DF378B; Mon, 18 Mar 2019 14:45:14 +0100 (CET) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 4062B2C54 for ; Mon, 18 Mar 2019 14:45:13 +0100 (CET) Received: by mail-qk1-f193.google.com with SMTP id z76so9609258qkb.12 for ; Mon, 18 Mar 2019 06:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ilVP3+8fRAZmZL0SyGidVXfG/w2Ig6bQqLVtHigjdWo=; b=t/IH6rkmul3sjsI/rrUjHb9O+F6bIvNGWVPwiNvP/dyP7wVCz/YuV1YQd+i4g08fmE Zx8bT+hWyHdsdMFrZZME4p37aQ6pHpVxrSABP4o1oxs7fQqScCeb6I4KycnmNSXi/5WK g8dJdyd+qVUlSluFy+1kwUxwB/UHp1ZxRy/axW5zNPADSC0GNg8Ke6oNOZ80M5UE1iqv RWszhwzWOEJ4phR9FT4PD1ImPwhopcBoV+rFBW8t/z+gfsO77mKhFqDimvtCNgJK9tlQ Wfa6ZkxSwHq+faoMZIZp/ygLXapo50tjCQCyYeGPoSCHwoIuJCCrYcQYmYxxVaiLj08s SJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ilVP3+8fRAZmZL0SyGidVXfG/w2Ig6bQqLVtHigjdWo=; b=Iqs9AhyhuIWopVj6p6n3dF2ni7+sNLVjmDkTYpQMYvyangT+0iSVSJSgMStbpI+DGJ IaP5RuCPu3Kw1uutJkNWJFp3d1/4es9oj5GBTodxsGsnSEYf5U+oY2yciJq6OpwIWYBl Gqp6QxaMTx7RAVHGIOrGeRDHYjCtQZ3oUA/q0Ay/EzoYgND+5JjohHGEQ5j8A2HV2w8C OGFME6DuSIZVyqyGI/ArxWUzhY+nOj5XaanxGW2MQO6zJ+4Jqw9773XuuC5n25oSRr+c E5+Nf7zSqh4bGLnOpKRLeO+xhzdksVWQwCo6C4pfJcJ2SxFO2sdzng1hWawfCdn08Agi pDCA== X-Gm-Message-State: APjAAAXJOayHEuG1pbLoDVDIqobeQPcnZAzErMBIs2Ze3w5yPynbzNqn fKj13aKJ9Lk+TkHuZVeVN8UXuYGL X-Google-Smtp-Source: APXvYqzUrcV3NDoPH9p3X+/pHTQ9d+7exmQ49D4Mi5y31ZnyNzfv9dETUdHuzPUVY2FdxXQdu5rEUg== X-Received: by 2002:a37:d285:: with SMTP id f127mr12982829qkj.147.1552916712390; Mon, 18 Mar 2019 06:45:12 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id m9sm1698183qkl.2.2019.03.18.06.45.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 06:45:11 -0700 (PDT) To: Liang Zhang , dev@dpdk.org References: <1552640761-16834-1-git-send-email-zhangliang@bigo.sg> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Mon, 18 Mar 2019 09:45:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1552640761-16834-1-git-send-email-zhangliang@bigo.sg> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] bonding: fix lacp negotiation failed 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" Message-ID: <20190318134510.I35EP3KM6URVN5rzLVVP2g41wR5PXRLyDqGEKyQBLXQ@z> On 3/15/19 5:06 AM, Liang Zhang wrote: > When monitor(port-mirroring) traffic from other lacp port-channel, > rx_machine_update may recieving other lacp negotiation packets. > Thus bond mode 4 will negotiation failed. > > Signed-off-by: Liang Zhang Acked-by: Chas Williams > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 12 ++++++++++-- > drivers/net/bonding/rte_eth_bond_8023ad_private.h | 1 + > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index dd847c6..dac23ac 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -784,13 +784,20 @@ static void > rx_machine_update(struct bond_dev_private *internals, uint8_t slave_id, > struct rte_mbuf *lacp_pkt) { > struct lacpdu_header *lacp; > + struct lacpdu_actor_partner_params *partner; > > if (lacp_pkt != NULL) { > lacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *); > RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); > > - /* This is LACP frame so pass it to rx_machine */ > - rx_machine(internals, slave_id, &lacp->lacpdu); > + partner = &lacp->lacpdu.partner; > + if (is_same_ether_addr(&partner->port_params.system, > + &internals->mode4.mac_addr)) { > + /* This LACP frame is sending to the bonding port > + * so pass it to rx_machine. > + */ > + rx_machine(internals, slave_id, &lacp->lacpdu); > + } > rte_pktmbuf_free(lacp_pkt); > } else > rx_machine(internals, slave_id, NULL); > @@ -1165,6 +1172,7 @@ bond_mode_8023ad_start(struct rte_eth_dev *bond_dev) > struct mode8023ad_private *mode4 = &internals->mode4; > static const uint64_t us = BOND_MODE_8023AX_UPDATE_TIMEOUT_MS * 1000; > > + rte_eth_macaddr_get(internals->port_id, &mode4->mac_addr); > if (mode4->slowrx_cb) > return rte_eal_alarm_set(us, &bond_mode_8023ad_ext_periodic_cb, > bond_dev); > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h > index c51426b..f91902e 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h > +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h > @@ -150,6 +150,7 @@ struct mode8023ad_private { > uint64_t update_timeout_us; > rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb; > uint8_t external_sm; > + struct ether_addr mac_addr; > > struct rte_eth_link slave_link; > /***< slave link properties */ >