From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ehkinzie@gmail.com>
Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com
 [209.85.220.49]) by dpdk.org (Postfix) with ESMTP id 5F9DBC344
 for <dev@dpdk.org>; Mon,  6 Apr 2015 19:01:48 +0200 (CEST)
Received: by pacyx8 with SMTP id yx8so49458218pac.1
 for <dev@dpdk.org>; Mon, 06 Apr 2015 10:01:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:in-reply-to:references;
 bh=L4IkxcVPA/62144hUXLllrc2xFjw+pxnZTqsWXI63Mc=;
 b=G+p2clBc1TXgwHoXVm5LKJFc8ebduRZT7P73jBpWmDhMJBBYCCjsrRq5W+xwGrKXXr
 WmHD1i8LRlfGIickiJdxZ4BkpcRXYy2ysXu3pM7TQPNuP8/1D2xx9yiZ0I1OqKK/RvAU
 cXW/rC5TOLdmS53G1yUVOi149QltIpjbOUHWmgUiaD8uu96xMIOMP3ZPNSmgDIZh3MkG
 yppu0YjR83ZfINV9DWJCsez7rhPaYpvGUATkZ0iGoIcXEJ/btf6+rFsydlM/EkQeIZBW
 kAxLS7eU5TrNF1Ku+M4gfZdP5GuvclWoboM1J3Sfr6Ic587vSfREYGu3qPpkAg2gdTYI
 uu7g==
X-Received: by 10.66.102.65 with SMTP id fm1mr28919947pab.115.1428339707007;
 Mon, 06 Apr 2015 10:01:47 -0700 (PDT)
Received: from buildhost2.vyatta.com. ([144.49.132.22])
 by mx.google.com with ESMTPSA id o6sm5253698pds.38.2015.04.06.10.01.44
 for <dev@dpdk.org>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 06 Apr 2015 10:01:45 -0700 (PDT)
From: Eric Kinzie <ehkinzie@gmail.com>
To: dev@dpdk.org
Date: Mon,  6 Apr 2015 10:01:23 -0700
Message-Id: <1428339685-27686-4-git-send-email-ehkinzie@gmail.com>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1428339685-27686-1-git-send-email-ehkinzie@gmail.com>
References: <1428339685-27686-1-git-send-email-ehkinzie@gmail.com>
Subject: [dpdk-dev] [PATCH 3/5] bond mode 4: do not ignore multicast
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Apr 2015 17:01:48 -0000

The bonding PMD in mode 4 puts all enslaved interfaces into promiscuous
mode in order to receive LACPDUs and must filter unwanted packets
after the traffic has been "collected".  Allow broadcast and multicast
through so that ARP and IPv6 neighbor discovery continue to work.

Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
---
 app/test/test_link_bonding_mode4.c     |    7 +++++--
 lib/librte_pmd_bond/rte_eth_bond_pmd.c |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 02380f9..5a726af 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -755,8 +755,11 @@ test_mode4_rx(void)
 	rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
 	ether_addr_copy(&bonded_mac, &dst_mac);
 
-	/* Assert that dst address is not bonding address */
-	dst_mac.addr_bytes[0]++;
+	/* Assert that dst address is not bonding address.  Do not set the
+	 * least significant bit of the zero byte as this would create a
+	 * multicast address.
+	 */
+	dst_mac.addr_bytes[0] += 2;
 
 	/* First try with promiscuous mode enabled.
 	 * Add 2 packets to each slave. First with bonding MAC address, second with
diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index 4fd7d97..8631e12 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -170,7 +170,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 			 * mode and packet address does not match. */
 			if (unlikely(hdr->ether_type == ether_type_slow_be ||
 				!collecting || (!promisc &&
-					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
+					(!is_multicast_ether_addr(&hdr->d_addr) &&
+					 !is_same_ether_addr(&bond_mac, &hdr->d_addr))))) {
 
 				if (hdr->ether_type == ether_type_slow_be) {
 					bond_mode_8023ad_handle_slow_pkt(internals, slaves[i],
-- 
1.7.10.4