Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2380263pxb; Mon, 12 Apr 2021 23:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE0g/aT6J7+nOPJVDTqc81x+YNSBUYg6Y02q2/asfdhyKg41/NdNUdYOlpZQDEf+Z3R4kL X-Received: by 2002:a17:90b:33c7:: with SMTP id lk7mr3326205pjb.95.1618297077978; Mon, 12 Apr 2021 23:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618297077; cv=none; d=google.com; s=arc-20160816; b=tHRY+OeUAe0uGHgdG/zcJY24e6H3dxv9XgfDcO+nmPw4ZGm9sUQ5u+FPDtpJ819odc x1/3SnSFKY2/rvPlrigeaBmbhlSOPE2nGTMelK7Tz1TdyoO/n9lvx0IYgy1GO97wNjhw uIk7LRfrkc7TuXy6AGQWJrQjA5t0989lTic5CdH0kyqYpDQwo0dyn8oW8pH6SWWHYJbR 4GubG1VUAKCO02A4sAMwOVU2LwFkvdI9iLw00/Op18y7m8zActFthQ6ySyEB2wrGmnip UUSD29qZ3ybiWaK0BAQ54GF1aL7xiE9OZeeIBIsZ84J1OljBLdtoNntedd+2Mcs2+mf7 S8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=h4KIpaZqOsbuKY2z0Qhl59IIbVSSu09HrM8OexfFJWI=; b=BhDg8GOKTif5YBAJ/fCIxX+N4K9iqcBW9xEGoTtdbD3yjs40/hEOYq3MZbDy9SKtN6 WEaq58SJyLq945MFzbJNNmJQcpOe+0VdQduP3kO5nEcOxcssmT9iP2oQkS6EZba/q3QI w234M9qH+SD7JDT49uLJ3q2WgLM7Q3AL93p+bJ36wujQcOJwsWbtLAaSrCS6B7xIIQk+ CmjjWq06nWkT2jQ2BErU6+cZlhozl7Kr8Xjahjl/NtvlU9AZcvI/nHCPWbwYRB9al7kQ Fu3o2XURoC5ciNBmt4RjaaXPQN9kmEGlVw8ArOGvAulpbxGsv4jrwtnyc3bVR41XMMKp fMfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i66si5723003pfg.314.2021.04.12.23.57.46; Mon, 12 Apr 2021 23:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243486AbhDLTbH (ORCPT + 99 others); Mon, 12 Apr 2021 15:31:07 -0400 Received: from lists.nic.cz ([217.31.204.67]:55112 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236935AbhDLTbG (ORCPT ); Mon, 12 Apr 2021 15:31:06 -0400 Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 05A541409D7; Mon, 12 Apr 2021 21:30:46 +0200 (CEST) Date: Mon, 12 Apr 2021 21:30:45 +0200 From: Marek Behun To: Tobias Waldekranz Cc: Vladimir Oltean , Ansuel Smith , netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Andrew Lunn , Vivien Didelot , Florian Fainelli , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eric Dumazet , Wei Wang , Cong Wang , Taehee Yoo , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , zhang kai , Weilong Chen , Roopa Prabhu , Di Zhu , Francis Laniel , linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC net-next 0/3] Multi-CPU DSA support Message-ID: <20210412213045.4277a598@thinkpad> In-Reply-To: <878s5nllgs.fsf@waldekranz.com> References: <20210410133454.4768-1-ansuelsmth@gmail.com> <20210411200135.35fb5985@thinkpad> <20210411185017.3xf7kxzzq2vefpwu@skbuf> <878s5nllgs.fsf@waldekranz.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Apr 2021 14:46:11 +0200 Tobias Waldekranz wrote: > I agree. Unless you only have a few really wideband flows, a LAG will > typically do a great job with balancing. This will happen without the > user having to do any configuration at all. It would also perform well > in "router-on-a-stick"-setups where the incoming and outgoing port is > the same. TLDR: The problem with LAGs how they are currently implemented is that for Turris Omnia, basically in 1/16 of configurations the traffic would go via one CPU port anyway. One potencial problem that I see with using LAGs for aggregating CPU ports on mv88e6xxx is how these switches determine the port for a packet: only the src and dst MAC address is used for the hash that chooses the port. The most common scenario for Turris Omnia, for example, where we have 2 CPU ports and 5 user ports, is that into these 5 user ports the user plugs 5 simple devices (no switches, so only one peer MAC address for port). So we have only 5 pairs of src + dst MAC addresses. If we simply fill the LAG table as it is done now, then there is 2 * 0.5^5 = 1/16 chance that all packets would go through one CPU port. In order to have real load balancing in this scenario, we would either have to recompute the LAG mask table depending on the MAC addresses, or rewrite the LAG mask table somewhat randomly periodically. (This could be in theory offloaded onto the Z80 internal CPU for some of the switches of the mv88e6xxx family, but not for Omnia.) Marek