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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 E5B74C43381 for ; Tue, 26 Mar 2019 02:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8B152083D for ; Tue, 26 Mar 2019 02:31:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AAltYvGV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730239AbfCZCbF (ORCPT ); Mon, 25 Mar 2019 22:31:05 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36855 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbfCZCbF (ORCPT ); Mon, 25 Mar 2019 22:31:05 -0400 Received: by mail-pg1-f194.google.com with SMTP id r124so7513761pgr.3 for ; Mon, 25 Mar 2019 19:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oionl0BaknE/NcN/cE9rKzNpX7mebX8Ja71HiMPT66U=; b=AAltYvGVA+LEcnzGSa2dgjC8ZzONyk1oxSW8FfpkEF5dOvwlub8ESlsHbP5Ic9UWVE 7RLIPq4xCPVI/R+A0H77HeRJ0Pshl9skolV23aHlwKerHvXvX1kHQ9UJhE7MhSY8VM9N qmmjI7Y+r1vp0pXs0VDDLX6Q02x3aSfTFTEqCQzcZRM0wXTdxwNdeMfZOF4ZdrqN9KTg qqVoUZBq1pT6Sw7W4zoRXXYBwPfw8jaBzok22fGhusHYoFJr+jiy/amypggO0kUqNh5Y ZOFKeC1PbfqMA1vvGbftWLw73Tovr8cPXg81bKUjpJv7PHtJHbVx4Wg/Ld6BIsFaoRYx 7w3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oionl0BaknE/NcN/cE9rKzNpX7mebX8Ja71HiMPT66U=; b=VJpdsC0496SSexzddZvPQLpCrOh/U6blwduteWdZ0ly0Q2v69Dc73N7+ooWNfjJFVq HXnSyVQXf5BSmgakEPLpYzjoMr54CMt6RhwpU3iqJykX5WFX3xpWte9vvqV2WQ5w2onJ 5/nWDrc7H3eDkDf6VdYTT/y/7eT4D8FlDkbGck7fh0rPX1eL2p8dfbYhnH+UMj/+bs1X DCp6jfP7wN0WWmIS+5Bp0bI/ATJo8PgeuBBu1P5I57eHFk/UBKTW17Cp28gPbdNGj9Xw rC6GEy/IFvcg6u70vgWXAHyMG2S9OioQ2AdwkxMlcqghDRK1+DMRD3Pu6oy55N5uRZES Egeg== X-Gm-Message-State: APjAAAXH3ksrC6pSzD19aJvBdUaLn43AF0uIipoX28j27Vqxlxi9i9uq XbLvf+Pso/Wk+BLijW5aeL0= X-Google-Smtp-Source: APXvYqyahDlFX+j6zDJ78s2J4FV48xJRpGD5UbMo4wUEHWA69Zv8msYj55G+aIhsZyg11MXxWqJjWg== X-Received: by 2002:a63:3dc8:: with SMTP id k191mr9892692pga.286.1553567464314; Mon, 25 Mar 2019 19:31:04 -0700 (PDT) Received: from [192.168.1.3] (ip68-101-123-102.oc.oc.cox.net. [68.101.123.102]) by smtp.gmail.com with ESMTPSA id h11sm19024267pgq.57.2019.03.25.19.31.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 19:31:03 -0700 (PDT) Subject: Re: [RFC PATCH net-next 10/13] net: dsa: sja1105: Add support for traffic through standalone ports To: Vladimir Oltean , davem@davemloft.net, netdev@vger.kernel.org Cc: andrew@lunn.ch, vivien.didelot@gmail.com, linus.walleij@linaro.org References: <20190324032346.32394-1-olteanv@gmail.com> <20190324032346.32394-11-olteanv@gmail.com> From: Florian Fainelli Openpgp: preference=signencrypt Message-ID: <2612a31e-ddde-d19d-40a0-80f1be5ac919@gmail.com> Date: Mon, 25 Mar 2019 19:31:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190324032346.32394-11-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 3/23/2019 8:23 PM, Vladimir Oltean wrote: > In order to support this, we are creating a make-shift switch tag out of > a VLAN trunk configured on the CPU port. Termination on switch ports > only works when not under a vlan_filtering bridge. We are making use of > the generic CONFIG_NET_DSA_TAG_8021Q code and leveraging it from our own > CONFIG_NET_DSA_TAG_SJA1105. > > There are two types of traffic: regular and link-local. > The link-local traffic received on the CPU port is trapped from the > switch's regular forwarding decisions because it matched one of the two > DMAC filters for management traffic. > On transmission, the switch requires special massaging for these > link-local frames. Due to a weird implementation of the switching IP, by > default it drops link-local frames that originate on the CPU port. It > needs to be told where to forward them to, through an SPI command > ("management route") that is valid for only a single frame. > So when we're sending link-local traffic, we need to clone skb's from > DSA and send them in our custom xmit worker that also performs SPI access. > > For that purpose, the DSA xmit handler and the xmit worker communicate > through a per-port "skb ring" software structure, with a producer and a > consumer index. At the moment this structure is rather fragile > (ping-flooding to a link-local DMAC would cause most of the frames to > get dropped). I would like to move the management traffic on a separate > netdev queue that I can stop when the skb ring got full and hardware is > busy processing, so that we are not forced to drop traffic. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli I do like the idea of setting up specific management queue later on, although it is not clear to me how you would go about integrating it as a network device, given the DSA slave and master devices, do you know roughly how you would proceed? -- Florian