From patchwork Thu Nov 15 15:11:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Thibault X-Patchwork-Id: 998400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=navigue.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bAdJNSu9"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="B1DwqM5J"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wlG644lzz9s3Z for ; Fri, 16 Nov 2018 02:12:14 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Date:Message-ID:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/GTJXCzYzFdD3sYjrMr/j5ard/Js6WitxRWzI1Q3SDo=; b=bAdJNSu9XWlGFr QKxFkbhq4vyzHdcXLjE4i03C5gOvrqIjD/XzpxpNdTXfxP5m30ZoINU2Dn8JZXN2uRpylANxJhyc9 +zyOOEVpKpzT7VO+z3/oG700mHHaH2dR8ExX/5j9cOV3cy1Nxj0Zup4kQsS9/0TpBK059MDLECtH3 lFEsrC3FC/b4nuKkzEUGXU4zOfZqoaOVu+P1cVTUM6hk/k0bfAfhOmkjqkuwv9h3wjpMGmwmsRURT DMC/5ihpQtT5r/X9M/k740BlnuxK8lUlP6LFMVGuGEbbvJkn7+uAdtxbDgv1VT97sPwWo3CDI3EW+ 5bmJn6GYANzcOgWeDzcw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNJJT-0006Jf-BX; Thu, 15 Nov 2018 15:12:11 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNJJK-0006BN-WE for openwrt-devel@bombadil.infradead.org; Thu, 15 Nov 2018 15:12:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wBatK7rvzNCr9mbNUdekf6y582LCusSeEPxaA1DvthE=; b=B1DwqM5Jf+LvgeZcAkNLWG/3am aw7FP8AP56W2lKczNKr7B5ILwFJOEKe6FDOjq4f+57tQMRHAfySqWWgC8ec80xnpusB8LdLeDHCnX 85sCv9+HvtH5cl8DaTlw90tSosvtYw5xHFtUciLLiuCJVZ9uTCu6ZyQyKEqW1iPwbYm+Du1GIktEl JGeBh3AhqWuVMD2ZjUo8XLr6m+dZBObMeV/yFoSswNG5CpxVyh07oYIUmbApJcUyI0dsADIQX5Sip 8LtwpihX6JjPq9zLu717NnTKDh6rNbjbMU6LlRfYI3aTAktzjv+oDHruw8rvO6/QIGmDZFttOUT0V 1HJGGhvw==; Received: from mail.navigue.com ([74.117.40.3]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNJJH-0001nS-0l for openwrt-devel@lists.openwrt.org; Thu, 15 Nov 2018 15:12:01 +0000 Received: from [192.168.7.178] (bureau.navigue.com [74.117.40.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.navigue.com (Postfix) with ESMTPSA id 93D631A01DF; Thu, 15 Nov 2018 10:11:46 -0500 (EST) From: Jonathan Thibault To: openwrt-devel@lists.openwrt.org, OpenWrt Development List Message-ID: <1770ecac-58a3-b4f4-2317-5a13053f5143@navigue.com> Date: Thu, 15 Nov 2018 10:11:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_151159_289743_BF28CC44 X-CRM114-Status: GOOD ( 18.52 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.117.40.3 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH] Allow VLAN filtering if needed. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Greetings, I would like to propose enabling CONFIG_BRIDGE_VLAN_FILTERING on OpenWRT releases. This allows us to use the bridge as a managed switch and gracefully handle mixed tagged and untagged frames. Prior to this, the only alternative was creating one bridge per vlan which quickly becomes a nightmare and still won't let you mix both tagged and untagged frames on the physical port without some complex ebtables magic. This is in line with the notion that OpenWRT is the network go-to swiss army knife when you need a nice set-and-forget, low maintenance box to handle a specific task. Current builds of the ip-bridge package already fully support this feature so the only requirement is enabling the kernel config. This is disabled by default so existing bridge configurations will not be affected. This patch only gives the ability to turn it on with an 'ip link' command. If there is interest, I could look into making the feature accessible via uci configuration. It causes about 3.1% hit on raw bridging speed, which is relatively trivial considering that I had to use 300 byte packets to strain the CPU enough to notice a slowdown at all. The ER8 would chug along at wire speed otherwise, and that's using only one core. Since the typical bridge use case on OpenWRT is wireless, I doubt it would be noticeable at all. With BRIDGE_VLAN_FILTERING iperf -u -c 192.168.1.105 -b 1G -l 300 ------------------------------------------------------------ Client connecting to 192.168.1.105, UDP port 5001 Sending 300 byte datagrams, IPG target: 2.24 us (kalman adjust) UDP buffer size: 208 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.12 port 58045 connected with 192.168.1.105 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 977 MBytes 820 Mbits/sec [ 3] Sent 3414986 datagrams [ 3] Server Report: [ 3] 0.0-10.0 sec 811 MBytes 680 Mbits/sec 0.000 ms 581210/3414986 (0%) Without BRIDGE_VLAN_FILTERING iperf -u -c 192.168.1.105 -b 1G -l 300 ------------------------------------------------------------ Client connecting to 192.168.1.105, UDP port 5001 Sending 300 byte datagrams, IPG target: 2.24 us (kalman adjust) UDP buffer size: 208 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.1.12 port 36645 connected with 192.168.1.105 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 977 MBytes 820 Mbits/sec [ 3] Sent 3414990 datagrams [ 3] Server Report: [ 3] 0.0-10.0 sec 836 MBytes 701 Mbits/sec 0.000 ms 493950/3414990 (0%) In terms of kernel size, it uses 16KB (6753K vs 6737K on ER8) so a 0.002% hit. The exact 16KB is probably just due to how the kernel is compressed. diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index aa227ec6bf..a385fe3f24 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -623,7 +623,7 @@ CONFIG_BRIDGE=y # CONFIG_BRIDGE_EBT_STP is not set # CONFIG_BRIDGE_EBT_T_FILTER is not set # CONFIG_BRIDGE_EBT_T_NAT is not set -# CONFIG_BRIDGE_EBT_VLAN is not set +CONFIG_BRIDGE_EBT_VLAN=y CONFIG_BRIDGE_IGMP_SNOOPING=y # CONFIG_BRIDGE_NETFILTER is not set # CONFIG_BRIDGE_NF_EBTABLES is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 83abfdc8ff..6bcb82adec 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -598,7 +598,7 @@ CONFIG_BRIDGE=y CONFIG_BRIDGE_IGMP_SNOOPING=y # CONFIG_BRIDGE_NETFILTER is not set # CONFIG_BRIDGE_NF_EBTABLES is not set -# CONFIG_BRIDGE_VLAN_FILTERING is not set +CONFIG_BRIDGE_VLAN_FILTERING=y # CONFIG_BROADCOM_PHY is not set CONFIG_BROKEN_ON_SMP=y # CONFIG_BSD_DISKLABEL is not set