Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5512177imm; Tue, 16 Oct 2018 11:22:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tCWEa/EYPr4RC1R14US4Rgsx4xyHQcFRAmpCM4ib3K+3HI/60sX5c4qkhZnX5hzA+ajlt X-Received: by 2002:a63:f05:: with SMTP id e5-v6mr20334036pgl.84.1539714135649; Tue, 16 Oct 2018 11:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539714135; cv=none; d=google.com; s=arc-20160816; b=JD7pEZbfzu4EPZaRQtk6kc7JyZQMXeVM/PV1JJpcVhJo3AWnjWAjZCsyhO1/T+Bxr0 5nD6fZ+dwe4+RRyhQIiocF+/l1la87aFkqrUbZiu9JhunJQf8JirAocpilx6UtpihmjP P4LjDi3oZnMk3ht4OFDBNnGya6hEffErl1B/kfbVQTqV93u7Q//FFytLIjZ9oZimZmDU BKKN9ePJmumnYb4pGZEtEBJRBquigN5FKL0ao2c4PBLtX78EqySgYNidf2XSCUkdgysG r1RaQnhhxU39HMMek37MZl+buJoNSq/08tbOqan/os9XAjzqhcm+pQm1vYmjuqKHOAzw QLkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=0hJSCJb1LP0ObcdLd4/9veYEjRQvXzCQb4b6QhGgsf0=; b=jO0WA0TdixL0MBr5J6rnLzMS0/ElXEiutfw5/gjHicW6MwyPpIQkA4uxfcEouY2eDS fEdiUQRIi2cVGjf0d+rM1Q/1Rcq8cK/Meo9YjJuWFnWAmeQOb0+3l2wwQo0YVyesp6gy XEDlnZUNzmhNtnjGMBm+pfyUnPPrXSIa6GkAJ2ZFHCfdcXR3f4/BbXTbGFahq0VNNiK6 YLxeYcAkzmNfaAJHGDY17F/2AliBhZuc4SdQplKAK9kJNGrI1VGldCwiZzHEpV+UBnTd x7YHzXQuds50pzvqeah+XgGidYLfWfMauxgubcrLNVPM5FD0LCs8RSmDz8FLBum8Nm2h hjWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IgzpuwVe; 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 a7-v6si16553602pll.38.2018.10.16.11.21.59; Tue, 16 Oct 2018 11:22:15 -0700 (PDT) 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=IgzpuwVe; 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 S1727509AbeJQCMX (ORCPT + 99 others); Tue, 16 Oct 2018 22:12:23 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46644 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbeJQCMW (ORCPT ); Tue, 16 Oct 2018 22:12:22 -0400 Received: by mail-lj1-f193.google.com with SMTP id x3-v6so21824851lji.13 for ; Tue, 16 Oct 2018 11:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0hJSCJb1LP0ObcdLd4/9veYEjRQvXzCQb4b6QhGgsf0=; b=IgzpuwVeZdd//YHzrzdu6mgAuH4UjtyXtRFxHDI+YSMyg+24XxFA0ntztIfAAHEns+ BW93ur3BWEoDJSrbZ/HggdCmgoIcV7kbtbc0lE2RNZM2Q4NYaBztITDsF0mnGMvKermI 19UZRSARhDpcH57qoctDXTnmxhGz2Jf8ZfHcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0hJSCJb1LP0ObcdLd4/9veYEjRQvXzCQb4b6QhGgsf0=; b=HQ0girzT+g/mRVuIc9KeLDc956bsGcTnI+0DdRwPoWShrI8/OPcaDtw+QXosTWdl+n TBLqcNktiDM2W1tGSxTyzgv+dwU3IgKVVRtayMV6zjK5TvxGSRE4KL4hGwJyogLI1+Z1 cU8nwrXg+q3WkBuDCiGJCdViGJmwj3dCy74VRMrNUu0DYSAFIyEaFpwqF2F0qA5XvakR /cetPvA7JYs9cI5QPB4XZbcadNJ8xIkT8SMnH2kaYYqGNh6rriht+i+1ud7Y5/6essHX eqLJo/bznqDAE/MZBSBh89yp7iW3tFl3VfifJF1NkmJ9OBm1y9cgvDOjM1Yt4OHZljAN xU+A== X-Gm-Message-State: ABuFfoiWnoc85tUKYyVeDUvOMuzHIB6r5MSuE96JAQuq+glYtaKvutue TRqUPx8shNXG60sQkR+zPvfbjw== X-Received: by 2002:a2e:9a93:: with SMTP id p19-v6mr14544570lji.87.1539714038483; Tue, 16 Oct 2018 11:20:38 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id i27-v6sm3207844lfc.22.2018.10.16.11.20.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 11:20:37 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alexander.h.duyck@intel.com, Ivan Khoronzhuk Subject: [RFC PATCH net-next 0/4] net: ethernet: ti: cpsw: fix vlan mcast Date: Tue, 16 Oct 2018 21:20:31 +0300 Message-Id: <20181016182035.18234-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpsw holds separate mcast entires for vlan entries. At this moment driver adds only not vlan mcast addresses, omitting vlan/mcast entries. As result mcast for vlans doesn't work. It can be fixed by adding same mcast entries for every created vlan, but this patchseries uses more sophisticated way and allows to create mcast entries only for vlans that really require it. Generic functions from this series can be reused for fixing vlan and macvlan unicast. Simple example of ALE table before and after this series, having same mcast entries as for vlan 100 as for real device (reserved vlan 2), and one mcast address only for vlan 100 - 01:1b:19:00:00:00. <---- Before this patchset ----> vlan , vid = 2, untag_force = 0x5, reg_mcast = 0x5, mem_list = 0x5 mcast, vid = 2, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 ucast, vid = 2, addr = 74:da:ea:47:7d:9d, persistant, port_num = 0x0 vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, mem_list = 0x7 mcast, vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x1 mcast, vid = 2, addr = 01:00:5e:00:00:01, port_mask = 0x1 vlan , vid = 1, untag_force = 0x3, reg_mcast = 0x3, mem_list = 0x3 mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 ucast, vid = 1, addr = 74:da:ea:47:7d:9c, persistant, port_num = 0x0 mcast, vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x1 mcast, vid = 1, addr = 01:00:5e:00:00:01, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:00, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:03, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:0e, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:00, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:03, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:0e, port_mask = 0x1 mcast, vid = 2, addr = 33:33:ff:47:7d:9d, port_mask = 0x1 mcast, vid = 2, addr = 33:33:00:00:00:fb, port_mask = 0x1 mcast, vid = 2, addr = 33:33:00:01:00:03, port_mask = 0x1 mcast, vid = 1, addr = 33:33:ff:47:7d:9c, port_mask = 0x1 mcast, vid = 1, addr = 33:33:00:00:00:fb, port_mask = 0x1 mcast, vid = 1, addr = 33:33:00:01:00:03, port_mask = 0x1 mcast, vid = 1, addr = 01:00:5e:00:00:fb, port_mask = 0x1 mcast, vid = 1, addr = 01:00:5e:00:00:fc, port_mask = 0x1 vlan , vid = 100, untag_force = 0x0, reg_mcast = 0x5, mem_list = 0x5 ucast, vid = 100, addr = 74:da:ea:47:7d:9d, persistant, port_num = 0x0 mcast, vid = 100, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 mcast, vid = 2, addr = 01:1b:19:00:00:00, port_mask = 0x1 ^^^ Here mcast entry (ptpl2), has to be added only for vlan 100 but added for reserved vlan 2...that's not enough. <---- After this patchset ----> vlan , vid = 2, untag_force = 0x5, reg_mcast = 0x5, mem_list = 0x5 mcast, vid = 2, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 ucast, vid = 2, addr = 74:da:ea:47:7d:9d, persistant, port_num = 0x0 vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, mem_list = 0x7 mcast, vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x1 mcast, vid = 2, addr = 01:00:5e:00:00:01, port_mask = 0x1 vlan , vid = 1, untag_force = 0x3, reg_mcast = 0x3, mem_list = 0x3 mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 ucast, vid = 1, addr = 74:da:ea:47:7d:9c, persistant, port_num = 0x0 mcast, vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x1 mcast, vid = 1, addr = 01:00:5e:00:00:01, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:00, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:03, port_mask = 0x1 mcast, vid = 2, addr = 01:80:c2:00:00:0e, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:00, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:03, port_mask = 0x1 mcast, vid = 1, addr = 01:80:c2:00:00:0e, port_mask = 0x1 mcast, vid = 2, addr = 33:33:ff:47:7d:9d, port_mask = 0x1 mcast, vid = 1, addr = 33:33:ff:47:7d:9c, port_mask = 0x1 mcast, vid = 2, addr = 33:33:00:00:00:fb, port_mask = 0x1 mcast, vid = 2, addr = 33:33:00:01:00:03, port_mask = 0x1 mcast, vid = 1, addr = 33:33:00:00:00:fb, port_mask = 0x1 mcast, vid = 1, addr = 33:33:00:01:00:03, port_mask = 0x1 vlan , vid = 100, untag_force = 0x0, reg_mcast = 0x5, mem_list = 0x5 ucast, vid = 100, addr = 74:da:ea:47:7d:9d, persistant, port_num = 0x0 mcast, vid = 100, addr = ff:ff:ff:ff:ff:ff, port_mask = 0x1 mcast, vid = 100, addr = 33:33:00:00:00:01, port_mask = 0x1 mcast, vid = 100, addr = 01:00:5e:00:00:01, port_mask = 0x1 mcast, vid = 100, addr = 33:33:ff:47:7d:9d, port_mask = 0x1 mcast, vid = 100, addr = 01:80:c2:00:00:00, port_mask = 0x1 mcast, vid = 100, addr = 01:80:c2:00:00:03, port_mask = 0x1 mcast, vid = 100, addr = 01:80:c2:00:00:0e, port_mask = 0x1 mcast, vid = 100, addr = 33:33:00:00:00:fb, port_mask = 0x1 mcast, vid = 100, addr = 33:33:00:01:00:03, port_mask = 0x1 mcast, vid = 100, addr = 01:1b:19:00:00:00, port_mask = 0x1 ^^^ Here mcast entry (ptpl2), is added only for vlan 100 as it should be. Based on net-next/master Ivan Khoronzhuk (4): net: core: dev_addr_lists: add auxiliary func to handle reference address updates net: 8021q: vlan_core: allow use list of vlans for real device net: ethernet: ti: cpsw: fix vlan mcast net: ethernet: ti: cpsw: fix vlan configuration while down/up drivers/net/ethernet/ti/cpsw.c | 189 +++++++++++++++++++++++++++------ include/linux/if_vlan.h | 10 ++ include/linux/netdevice.h | 10 ++ net/8021q/vlan_core.c | 27 +++++ net/core/dev_addr_lists.c | 97 +++++++++++++++++ 5 files changed, 303 insertions(+), 30 deletions(-) -- 2.17.1