Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7381799imu; Tue, 22 Jan 2019 05:14:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN7FdjP71tw/DUDWdY/i3/0QuZaapZSjXRshFns729PNItsd+/fY7eP5pUcgXZmLtjiTQ7Ar X-Received: by 2002:a63:5026:: with SMTP id e38mr32053562pgb.123.1548162854243; Tue, 22 Jan 2019 05:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548162854; cv=none; d=google.com; s=arc-20160816; b=uIesrwJqT/N0V/CjCB/8xbLY0BplJirzXqCIpYxX72TcpkmBnhP45BGSygHcFiHnh/ fXTGxpE4eIl/f2I2k5ItjysptBPBNCvCdgjX279KQ261XnGg14mGjqkGbiM2eafGdJg0 M5zXCy8O+Vl3LewEgB5aMhXm8FgChQx2J/ILgDuPqGRs7NHkgkP05ygKKcKGyH6okVBd Wn3VeLiIfS4GTbh1sm2mozT67kmL4Ni7yH3nnRqaD0+dnXD9H/rIKcMnFBFF2Gk18kH5 z20tdG1s9jGatK6ii7J14gvtQXltELIBkxzeoaQ5Sc8reSr6pJNcPGPtCkeUHmtIvBf7 8d0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=LJUqJHcsbGiWE7HhG0CtXhAlnDNl7v53BBGEM/ayzlY=; b=X3bEUAGpKECm/cSKFv5+0LOlHsb1YT+1VVp3smpnd/qE6VeaFQBcMeB8+cckw8L/f8 YWFWoPeIt9/6FXo5lHIRgGtehr9gyq3WM+TqcU4LYdTnJ9tTM+ER+eNpZ78gODUp3aJD Uh8BgCdAeV2XCTiHMosqzsXcxj/9iRPRgRVWZcbjwId+YGmyVjdZ3U5+VSQyU2GrkGSl FEj41uz0sdXIfQkOSEW0RdovxYfWlT3Pe7JISacrEZxTlVznvwKWdN9a3O60Xazz7qTu +pO3OOW7mVs7YLoz7qZQHzXbmHX5wQfuJlZ6Cz/Hr0J0NE5hJPpvhlL5jTmivtvKuvGq g58Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6sN8vzn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si5824457pgg.274.2019.01.22.05.13.57; Tue, 22 Jan 2019 05:14:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q6sN8vzn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728520AbfAVNMr (ORCPT + 99 others); Tue, 22 Jan 2019 08:12:47 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42356 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728343AbfAVNMq (ORCPT ); Tue, 22 Jan 2019 08:12:46 -0500 Received: by mail-lj1-f196.google.com with SMTP id l15-v6so20530103lja.9 for ; Tue, 22 Jan 2019 05:12:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LJUqJHcsbGiWE7HhG0CtXhAlnDNl7v53BBGEM/ayzlY=; b=Q6sN8vzn3bJdcwY/5RQ/YzDUxU+AsC2DiDOvEAO0hLBO11OVgrtXpY6RZgYYB6idAy C56mfeensrwPDfNJ3lZBPm+eS6Tf/EDGqfjZzPcCo3Et9vAwuG/8Ps46FqhBA0y+JRoj um9XA7eXajelJlazS6Dhss04aC8ZW+mL2kCCk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=LJUqJHcsbGiWE7HhG0CtXhAlnDNl7v53BBGEM/ayzlY=; b=duAuv/mO2lhnsTGZzdcg/9zHsJSMzJ9d3uD1vmtZrJRVy4pMaR7IqWEf/NF6H4sQ8m pTl12XibrqaKI1OQVj8CROrkHeOct5zsk0/Pb0MwqrrHIS+4dR2MqJMZGqb2HhvXPUEN 0qtJAuW8u570+0vjXXnekJmyWO4amJNQ2RWB2dxBgzs6aSTu8flUwNETRGL3OtWb6IFR CqjgXUTuDHGlz55vPJQG0A9DlPwVBdNI8fjAFHAA00QB3mFmXt9eUBmnw9EDJJNS3lvA O0eFA6LRG/YUODgqJzaJFAIIziEHS2jt5ZIDTsepwLYzOXLtZg0ffp7Db/o7FKyucLvL r83g== X-Gm-Message-State: AJcUukdPUv4F+CyuHU0lV5Nb9ppRFT+n4k8Un12YTYfynUP0PoaOc8Nl ekH+0UAJiBEThlgAUlA+n7Oing== X-Received: by 2002:a2e:1241:: with SMTP id t62-v6mr18396662lje.171.1548162763729; Tue, 22 Jan 2019 05:12:43 -0800 (PST) Received: from khorivan (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id q10-v6sm3023739ljh.72.2019.01.22.05.12.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 05:12:43 -0800 (PST) Date: Tue, 22 Jan 2019 15:12:41 +0200 From: Ivan Khoronzhuk To: Florian Fainelli Cc: davem@davemloft.net, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@mellanox.com, andrew@lunn.ch Subject: Re: [RFC PATCH net-next 2/5] net: 8021q: vlan_dev: add vid tag for uc and mc address lists Message-ID: <20190122131239.GC3125@khorivan> Mail-Followup-To: Florian Fainelli , davem@davemloft.net, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@mellanox.com, andrew@lunn.ch References: <20181203184023.3430-1-ivan.khoronzhuk@linaro.org> <20181203184023.3430-3-ivan.khoronzhuk@linaro.org> <20181203235119.GF23230@khorivan> <35479973-2d2d-d673-f7ab-54d6369ce3d1@gmail.com> <20181204185720.GI23230@khorivan> <756cbb25-3062-91e8-0613-66bb887f937e@gmail.com> <20181204234236.GA3507@khorivan> <4cf42ef9-7136-15ff-1244-1d946acd07ae@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4cf42ef9-7136-15ff-1244-1d946acd07ae@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 21, 2019 at 03:37:41PM -0800, Florian Fainelli wrote: >On 12/4/18 3:42 PM, Ivan Khoronzhuk wrote: >> On Tue, Dec 04, 2018 at 11:49:27AM -0800, Florian Fainelli wrote: [...] > >Ivan, based on the recent submission I copied you on [1], it sounds like >we want to move ahead with your proposal to extend netdev_hw_addr with a >vid member. > >On second thought, your approach is good and if we enclose the vid >member within an #if IS_ENABLED(CONFIG_VLAN)8021Q) we should be good for >most foreseeable use cases, if not, we can always introduce a variable >size/defined context in the future. > >Can you resubmit this patch series as non-RFC in the next few days so I >can also repost mine [1] and take advantage of these changes for >multicast over VLAN when VLAN filtering is globally enabled on the device. > >[1]: https://www.spinics.net/lists/netdev/msg544722.html > >Thanks! Yes, sure. I can start to do that in several days. Just a little busy right now. Just before doing this, maybe some comments could be added as it has more attention now. Meanwhile I can send alternative variant but based on real dev splitting addresses between vlans. In this approach it leaves address space w/o vid extension but requires more changes to vlan core. Drawback here that to change one address alg traverses all related vlan addresses, it can be cpu/time wasteful, if it's done regularly, but saves memory.... Basically it's implemented locally in cpsw and requires more changes to move it as some vlan core auxiliary functions to be reused. But it can work only with vlans directly on top of real dev, which is fixable. Core function here: __hw_addr_ref_sync_dev it is called only for address the link of which was increased/decreased, thus update made only on one address, comparing it for every vlan dev. It was added with this patch: [1] net: core: dev_addr_lists: add auxiliary func to handle reference address update e7946760de5852f32 And used by this patch: [2] net: ethernet: ti: cpsw: fix vlan mcast 15180eca569bfe1d4d So, idea is to move [2] to be vlan core auxiliary function to be reused by NIC drivers. But potentially it can bring a little more changes I assume: 1) add priv_flag |= IFF_IV_FLT (independent vlan filtering). It allows to reuse this flag for farther changes, probably for per vlan allmulti or so. 2) real dev has to have complete list for vlans, not only their vids, but also all vlandevs in device chain above it. So changes in add_vid can be required. Vlan core can assign vlan dev pointer to real device only after it's completely initialized. And for propagation reasons it requires every device in infrastructure to be aware. That seems doable, but depends not only on me. 3) Move code from [2] to be auxiliary vlan core API for setting mc and uc. From this patch only one function is cpsw specific: cpsw_set_mc(). The rest can be applicable on every NIC supporting IFF_IV_FLT. 4) Move code from link below to do the same but for uc addresses: https://git.linaro.org/people/ivan.khoronzhuk/tsn_kernel.git/commit/?h=ucast_vlan_fix&id=ebc88a7d8758759322d9ff88f25f8bac51ce7219 here only one func cpsw specific: cpsw_set_uc() the rest can be generic. As third alternative, we can think about how to reduce memory for addresses by reusing them or else, but this is as continuation of addr+vid approach, and API probably would be the same. Then all this can be compared for proper decision. >-- >Florian -- Regards, Ivan Khoronzhuk