From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BA60C3A59E for ; Sat, 24 Aug 2019 15:24:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D6CE206DD for ; Sat, 24 Aug 2019 15:24:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="j0fnZKEe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbfHXPYJ (ORCPT ); Sat, 24 Aug 2019 11:24:09 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57098 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727514AbfHXPYI (ORCPT ); Sat, 24 Aug 2019 11:24:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=G18D+dPwxL8gEYiQX/xlXCUBOq3K36GOclJ88+8s6ls=; b=j0fnZKEeNdbGm/lbDlayNaPzwv CYZslIJp2OQF+Zn8n7daGNWodiCBNnzzFmYbCRYiQYmqgbakPXqb2Hz5cLUVfu9FreH9WNa4mrt+q b8HiryaCRRX3bphqTdrQxml8Lrw+uDDBc7//E21EmNz3NxGYgkr/o5MkTKCMvCIeYSLc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1i1Xtf-0002PP-3f; Sat, 24 Aug 2019 17:24:07 +0200 Date: Sat, 24 Aug 2019 17:24:07 +0200 From: Andrew Lunn To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: netdev@vger.kernel.org, Vivien Didelot , Florian Fainelli , David Ahern , Stephen Hemminger Subject: Re: [PATCH RFC net-next 0/3] Multi-CPU DSA support Message-ID: <20190824152407.GA8251@lunn.ch> References: <20190824024251.4542-1-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190824024251.4542-1-marek.behun@nic.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Aug 24, 2019 at 04:42:47AM +0200, Marek Behún wrote: > Hi, > this is my attempt to solve the multi-CPU port issue for DSA. > > Patch 1 adds code for handling multiple CPU ports in a DSA switch tree. > If more than one CPU port is found in a tree, the code assigns CPU ports > to user/DSA ports in a round robin way. So for the simplest case where > we have one switch with N ports, 2 of them of type CPU connected to eth0 > and eth1, and the other ports labels being lan1, lan2, ..., the code > assigns them to CPU ports this way: > lan1 <-> eth0 > lan2 <-> eth1 > lan3 <-> eth0 > lan4 <-> eth1 > lan5 <-> eth0 Hi Marek That is what i've always argued is a good default. So i'm happy with this. > Patch 2 adds a new operation to the net device operations structure. > Currently we use the iflink property of a net device to report to which > CPU port a given switch port si connected to. The ip link utility from > iproute2 reports this as "lan1@eth0". We add a new net device operation, > ndo_set_iflink, which can be used to set this property. We call this > function from the netlink handlers. That is a new idea. Interesting. I would like to look around and see what else uses this "lan1@eth0" concept. We need to ensure it is not counter intuitive in general, when you consider all possible users. > Patch 3 implements this new ndo_set_iflink operation for DSA slave > device. Thus the userspace can request a change of CPU port of a given > port. So this is all about transmit from the host out the switch. What about receive? How do you tell the switch which CPU interface it should use for a port? Thanks Andrew