Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp196460img; Wed, 27 Feb 2019 20:10:33 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib5Yja1DbIKRr4EdXtTBDWIDREfHx0/EUCfJSrofalI9fb+Wd8GzbtCnk5YbrkWpZfeuAZf X-Received: by 2002:a63:8341:: with SMTP id h62mr6552129pge.254.1551327033914; Wed, 27 Feb 2019 20:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551327033; cv=none; d=google.com; s=arc-20160816; b=rqHYR7tmw98/IscKmsgmrV3xZVxZjBi52S6K/kKHLsOVDFfMJACEymcWxwMUBpVvtb zwU6c7+8VEFP0Qpp9cv/4Ze3EBloVij09tk5XlBBGXya1OSZnVxgAxuT/wmDxr2q65wa fEMWVzaeGUG5ABtVM6BXieZaV0QXHV6Gb7NZJF7MB5VhgIklyfRLVxuZYULy5F60bYD0 3e8wiNizBsuarcOkh/92ujGV6Hv1EmFyLWd+NoVoYZmRH1alhccXlPR3t96Pf/aFisrc /X1+92VFZJ+KKzraz9SV4g4SLxKaZFES0ZkpHGuEO0zPI3SKPdihHIA5Exhuq6nWVhpd sSYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=HJMR2bHZ0CcSiCOhOasow5Wio2+wh4NRvetRfueYSOQ=; b=uDIJTIcmsUdw9J0MY6xOJFA0JxJ3r2EqscNKFplldhKwvLiEK64k1m0ANk/Q8XDzN8 jgwyLVsm22RWBjjgJo4t2YCNAtxIN7lwBY9f9BDcMSBu9Gm9tcmw7Hn8q6cqw45F979f mofOxhpGV64jljvVY53HdSq2xSU0IeEglax90M8Ix60vFIXWhgvdTnyX7+xoC1uy3ctO 2AP+SCSJjKZsQ8nWLxgDKIGhwfQNe0nW+krLnQAsiqAsADsyZG0EDr61590V3uIjukgc pkhsKT1NImi92NRU5XrVihoFAqqKBMB0Ac6KokNaBYqxu12BNVXPIejJ4zhb4TO2tVcd pt4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C4lz47dG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si16593694pgh.98.2019.02.27.20.10.18; Wed, 27 Feb 2019 20:10:33 -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=@gmail.com header.s=20161025 header.b=C4lz47dG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730663AbfB1EJ5 (ORCPT + 99 others); Wed, 27 Feb 2019 23:09:57 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43226 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730131AbfB1EJ5 (ORCPT ); Wed, 27 Feb 2019 23:09:57 -0500 Received: by mail-pl1-f193.google.com with SMTP id m10so9053946plt.10; Wed, 27 Feb 2019 20:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HJMR2bHZ0CcSiCOhOasow5Wio2+wh4NRvetRfueYSOQ=; b=C4lz47dG5tne/TaTyAax/4ebaoHPCORLGc9cWsiwghopGlEHjGtmPrD9KR/tyjtzsg OVOAwOehq/PFYmZHvZ+pcqLKQU3HqCGBquIrdmKElKWpNAux1uodSN4EHCQL5GkF45Uo yyCt51qSMSa/MYqdbbn/Q5jrxnIpkLqkNOk9M4Ht/WsfG7To+p0F1lr8UTgRztLya4HL ufxEtNVzOqb+53SxajHHUSPXLdpcqmEVsbDhyQGWfhyOcWHSP/JcBmSJHguhEyvnyTST s0icaifOMh8vQGm0LuOS3y7yt1ZNpXwyrMVgd3uIu47GZqmcwmu3wqEnq3DhO0QYTI5X yNKw== 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:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=HJMR2bHZ0CcSiCOhOasow5Wio2+wh4NRvetRfueYSOQ=; b=pHEkeOuaI5R62aG3oXXDBUzWy0j7bdtfsBzY3u2sz+A97hGoqt13D23QN3AMHtORa+ ntn2+RPdc08zZqP/BmckUcNzMAFfAhCeUdlLCVEsnsUQrMzpt+Yd+weSUSqVlt3ZfdlJ o5RlkLzR0bgoIv3/5r9yrIxaFhpavK9VFcXMIIOAWgCbyJikFTdj1GnHdjXeWcb40wzt eaVvByMpTwTidRiAKNlFTEsiJV5V6BWfGsEs0rYY+dYOxrAR/KmldxtQDgiIiebrAT9q dFdV2088Y8IDcNnOOaJqRocS9HqMl6ul7AEzBBZvudE1FB2A6QD4P4uve+WHu2qfp11k fECA== X-Gm-Message-State: AHQUAubxSaTIhEKTwDN3H4XYsl4S52TvWXPz6pKyd7aR5doNzwpp07Xs yBUGMrfrUtEE6tPO3wVGqpc= X-Received: by 2002:a17:902:f302:: with SMTP id gb2mr5939803plb.51.1551326995825; Wed, 27 Feb 2019 20:09:55 -0800 (PST) Received: from [10.230.1.150] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id u184sm25184743pgd.13.2019.02.27.20.09.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 20:09:54 -0800 (PST) Subject: Re: [PATCH net-next 2/6] net: 8021q: vlan_dev: add vid tag to addresses of uc and mc lists To: Ivan Khoronzhuk , davem@davemloft.net, grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@mellanox.com, ilias.apalodimas@linaro.org References: <20190226184556.16082-1-ivan.khoronzhuk@linaro.org> <20190226184556.16082-3-ivan.khoronzhuk@linaro.org> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; keydata= mQENBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAG0KEZsb3JpYW4gRmFpbmVsbGkgPGZhaW5lbGxpQGJyb2FkY29tLmNvbT6JAccEEAECALEF AlPAG9YXCgABv0jL/n0t8VEFmtDa8j7qERo7AN0gFAAAAAAAFgABa2V5LXVzYWdlLW1hc2tA cGdwLmNvbY4wFIAAAAAAIAAHcHJlZmVycmVkLWVtYWlsLWVuY29kaW5nQHBncC5jb21wZ3Bt aW1lCAsJCAcDAgEKAhkBBReAAAAAGRhsZGFwOi8va2V5cy5icm9hZGNvbS5jb20FGwMAAAAD FgIBB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KmDD9J9N/ b8IehhWQqrBQjMjn2K2XkvN75HnAMHKFYfHZR3ZHtK52ZP1crV7THtbtrnPXVDq+vO4QPmdC +SEACgkQgTG1xCm8ZqC6BwgAl3kRh7oozpjpG8jpO8en5CBtTl3G+OpKJK9qbQyzdCsuJ0K1 qe1wZPZbP/Y+VtmqSgnExBzjStt9drjFBK8liPQZalp2sMlS9S7csSy6cMLF1auZubAZEqpm tpXagbtgR12YOo57Reb83F5KhtwwiWdoTpXRTx/nM0cHtjjrImONhP8OzVMmjem/B68NY++/ qt0F5XTsP2zjd+tRLrFh3W4XEcLt1lhYmNmbJR/l6+vVbWAKDAtcbQ8SL2feqbPWV6VDyVKh ya/EEq0xtf84qEB+4/+IjCdOzDD3kDZJo+JBkDnU3LBXw4WCw3QhOXY+VnhOn2EcREN7qdAK w0j9Sw== Message-ID: <72ecf925-f818-3d6b-4f96-b01daabd21f2@gmail.com> Date: Wed, 27 Feb 2019 20:09:44 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2 MIME-Version: 1.0 In-Reply-To: <20190226184556.16082-3-ivan.khoronzhuk@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > Update vlan mc and uc addresses with VID tag while propagating > addresses to lower devices, do this only if address is not synced. > It allows at end driver level to distinguish addresses belonging > to vlan devices. > > Signed-off-by: Ivan Khoronzhuk > --- [snip] > > +u16 vlan_dev_get_addr_vid(struct net_device *dev, const u8 *addr) Having some kernel doc comment here would also be nice. > +{ > + u16 vid = 0; > + > + if (dev->vid_len != NET_8021Q_VID_TSIZE) > + return vid; > + > + vid = addr[dev->addr_len]; > + vid |= (addr[dev->addr_len + 1] & 0xf) << 8; This uses knowledge of the maximum VLAN ID is 4095, which is fine, might be a good idea to add a check on VID not exceeding the maximum VLAN ID number instead of doing a silent truncation? [snip] > +static void vlan_dev_align_addr_vid(struct net_device *vlan_dev) > +{ > + struct net_device *real_dev = vlan_dev_real_dev(vlan_dev); > + struct netdev_hw_addr *ha; > + > + if (!real_dev->vid_len) > + return; Should not this check be moved to dev_{mc,uc}_sync? It does not seem to me like this would scale really well across different stacked devices (VLAN, bond, macvlan) as well as underlying drivers (cpsw, dsa, etc.). Or maybe the check should be if vlan_dev->vid_len > real_dev->vid_len -> error, right? -- Florian