Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp25164pxb; Tue, 12 Apr 2022 15:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm8VBGUO07MNukobJRyriHKsbdg5g0YiFIS0lvjr1VvJNBKt1Yq2HAsOlovTAgAScpM+EF X-Received: by 2002:a17:902:a613:b0:156:b53d:c137 with SMTP id u19-20020a170902a61300b00156b53dc137mr40189423plq.73.1649803597144; Tue, 12 Apr 2022 15:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803597; cv=none; d=google.com; s=arc-20160816; b=XHrF0DGXfxBT9i6njUJ7iAQMsTVGEqY8XFpQwLwhjyIZmCj/zPoDHUxJohfMe04tCH GkvoDX3oCq2bQaxSEUkwHCK3uJymwhroLpMbV9gjVVE0teAWHbU31cON3U2Qn7amfNdo vrS8+2HJEY+7A4SgkAFn+0Gj1gvd0J7QPRffdx6XEJzT9nOWd1Gz5k0lbSHxR5QvXQqw UBvZoZ9MCWUUQMbG4txquSmff7zwokQXHmcJAcUgE1p1luRI5MM1oIjJUTR1/0xL1SfN exC2HYxc45fRzji0CLBDOVYSU8pa7wTkRxR2ObDtYDSqWalZEbO8+S0bHZhqnDTpAa6I DO5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hpGCLbrOzXS09YNJzkrxH5woyVIGrdo/h+bTCZ2VPog=; b=jamVQlpiHfbr+r2/reFIPJt59gH8h8BEhvV+kCyOSiqJrJafk8O5tMvNppVNB8MgZf pYprjKDdEMmZmzubSIm+pnUoL5GEKksEArGLJQw4rzqOn0xM4V8B+JMkIQ1fGMHI+ji+ pOhO11jwfL00wylzuNu94ASU438vhAc2PCKD2UIA6rREwyAd3qDg8j2Q8erH+zQcpCvq U68bATFLfkfh1HIInUG8VFO7isOfmw0F6HkXguXS7LOHKiz+3B0XlWnUHZ1mv/lV9s+d LJVg4SWi39fuUSodQ+pNxwOaYm8WrvjcwWZVvdhIkOcRqPp+vk5ZWZmwTlM4O8uPVItM g/Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=A8Q15kXm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p6-20020a17090a868600b001cb9071a897si7170976pjn.40.2022.04.12.15.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:46:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=A8Q15kXm; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2FA7D1B84C0; Tue, 12 Apr 2022 14:27:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355580AbiDLNUO (ORCPT + 99 others); Tue, 12 Apr 2022 09:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357115AbiDLNTR (ORCPT ); Tue, 12 Apr 2022 09:19:17 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96E1B35DE3; Tue, 12 Apr 2022 06:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=hpGCLbrOzXS09YNJzkrxH5woyVIGrdo/h+bTCZ2VPog=; b=A8Q15kXmugOYdyZuQhnZ7fYmpc jIA0/p9MCphVCHBxqqjjHVwPkEp2RiAZMcydJDZ34X/6/EC49NevaOkS6zcx+x8GGG4Y8geFneRBl 1yRpOymkqZRNNwRKUH7X1uXsHdhLSzgd7BXzRAq+n+GTF9lQf4hgKnd4Kyxnfq5VgJM4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1neGEu-00FSH7-Ux; Tue, 12 Apr 2022 15:07:24 +0200 Date: Tue, 12 Apr 2022 15:07:24 +0200 From: Andrew Lunn To: Felix Fietkau Cc: netdev@vger.kernel.org, John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Jiri Pirko , Ido Schimmel , Florian Fainelli , Vladimir Oltean Subject: Re: [PATCH v2 14/14] net: ethernet: mtk_eth_soc: support creating mac address based offload entries Message-ID: References: <20220405195755.10817-1-nbd@nbd.name> <20220405195755.10817-15-nbd@nbd.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > I'm trying to understand the architecture here. > > > > > We have an Ethernet interface and a Wireless interface. The slow > > > path > > > > is that frames ingress from one of these interfaces, Linux decides > > > > what to do with them, either L2 or L3, and they then egress probably > > > > out the other interface. > > > > > The hardware will look at the frames and try to spot flows? It > > > will > > > > then report any it finds. You can then add an offload, telling it for > > > > a flow it needs to perform L2 or L3 processing, and egress out a > > > > specific port? Linux then no longer sees the frame, the hardware > > > > handles it, until the flow times out? > > > Yes, the hw handles it until either the flow times out, or the corresponding > > > offload entry is removed. > > > > > > For OpenWrt I also wrote a daemon that uses tc classifier BPF to accelerate > > > the software bridge and create hardware offload entries as well via hardware > > > TC flower rules: https://github.com/nbd168/bridger > > > It works in combination with these changes. > > > > What about the bridge? In Linux, it is the software bridge which > > controls all this at L2, and it should be offloading the flows, via > > switchdev. The egress port you derive here is from the software bridge > > FDB? > My code uses netlink to fetch and monitor the bridge configuration, > including fdb, port state, vlans, etc. and it uses that for the offload path > - no extra configuration needed. So this is where we get into architecture issues. Do we really want Linux to have two ways for setting up L2 networking? It was decided that users should not need to know about how to use an accelerator, they should not use additional tools, it should just look like linux. The user should just add the WiFi netdev to the bridge and switchdev will do the rest to offload L2 switching to the hardware. You appear to be saying you need a daemon in userspace. That is not how every other accelerate works in Linux networking. We the Linux network community need to decided if we want this? Andrew