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 645A0C43381 for ; Tue, 26 Mar 2019 22:04:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AFDD2075D for ; Tue, 26 Mar 2019 22:04:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a94NibtP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731644AbfCZWEE (ORCPT ); Tue, 26 Mar 2019 18:04:04 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42901 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731491AbfCZWED (ORCPT ); Tue, 26 Mar 2019 18:04:03 -0400 Received: by mail-wr1-f65.google.com with SMTP id g3so12689691wrx.9 for ; Tue, 26 Mar 2019 15:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zQ70p5jLOZQ8iH/qfQQnze2l93HwDU2WrbGe/17i5v4=; b=a94NibtPs6xIjMr9f2FB45aij6N44kIbVJqB/HqS89coBiotBBkfvX0mA0BCX1NyMy lctRFGLdNJFE22IbZ7q/I5fS7t3L0M3jegmcw7VoXXRpjFAwRnwo4Yg7AQE8JtfzPoRi AEfkv1s5BPAoSsIbDNw9rLtnkKAIHvV5jeSlAczMeBdNsq7XbEkdlbzxFBPYxwsfkvJt LUsGqVWlAXCkfAkPwFsPBrYaRx+IfXLzElnx+hLdO0v1etwPosuvWMdRGYpWJ9chbHfE dq2JG2rqBMw0mONMJ63VZVHVRD3VGb51Ic1XjGYKW4mP9GlmGWOmLJRC5qVYm55WgNGc 87bA== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zQ70p5jLOZQ8iH/qfQQnze2l93HwDU2WrbGe/17i5v4=; b=RY9fr0+BgxjQEfm8Ws+eUgXNoAvbr7JbD/YlCUPiqKaqPdWsYd6vXJgSTV5GRIUpNd EOCb4Ru9CQNUmL6C3xNtwi+Xmm1n/GxxNe/xcFqrj/7KGQML6IGJ000j+Kn6TimbYG84 2tUNBa0YnZFqrDfd7AsJSzxTotJhz378bitWHldAns4rIdAGNqKVK5KJA7oO2yl2lIw4 V8a/7dA+bBQpWI6Lg3BZ9XSDU1VYaDATu6IWJc1pv9JqY+tBvtdbsyxBtxOOKOABHL9E yfjIB1ZDD+UPMMnDdbsh6LCtt/Mm9yQgCRuShJrZaYaROgy+ptdV2UXBQai28XXerrki c9og== X-Gm-Message-State: APjAAAUw9oiTC68gnOkfm3gzGFY3tc/Z6g0goUwndZnf6yEqSYgEL0nH hWuYhNLgzEpyVbW6b9A6jNE= X-Google-Smtp-Source: APXvYqxENsOwF4xLeXN7+M9sdw68QTPLI/EZqADUyhdU1oInVPSymYDdrBjl5gX5nLqmVKVxEVSupw== X-Received: by 2002:a5d:6887:: with SMTP id h7mr22422918wru.122.1553637841922; Tue, 26 Mar 2019 15:04:01 -0700 (PDT) Received: from [192.168.1.2] ([188.26.228.227]) by smtp.gmail.com with ESMTPSA id 7sm69304305wrc.81.2019.03.26.15.04.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 15:04:00 -0700 (PDT) Subject: Re: [RFC PATCH net-next 10/13] net: dsa: sja1105: Add support for traffic through standalone ports To: Florian Fainelli , 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> <2612a31e-ddde-d19d-40a0-80f1be5ac919@gmail.com> From: Vladimir Oltean Message-ID: Date: Wed, 27 Mar 2019 00:03:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <2612a31e-ddde-d19d-40a0-80f1be5ac919@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed 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/26/19 4:31 AM, Florian Fainelli wrote: > > > 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? > Actually I was thinking about leveraging the multiqueue support that you added in 55199df6d2af ("net: dsa: Allow switch drivers to indicate number of TX queues") and expose the slave netdev .ndo_select_queue callback towards DSA ports. There I would return queue #0 if sja1105_is_link_local(skb), and queue #1 otherwise. Are there any complications that I'm missing? Thanks, -Vladimir