Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp587028imu; Thu, 8 Nov 2018 12:33:11 -0800 (PST) X-Google-Smtp-Source: AJdET5cdRR4iteqegBUd3S4TWUv2YBBXt2+ruL6rFely9VtjxG4Du9BRVifM+iP/S4E5sGj5Xijx X-Received: by 2002:a17:902:a587:: with SMTP id az7-v6mr6147201plb.151.1541709190974; Thu, 08 Nov 2018 12:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541709190; cv=none; d=google.com; s=arc-20160816; b=LvCRIwj30gt5k/wIlS0fME9Xti0dor2jKbKYdRrpdoSSrN+hdZ63HLm3LTF+jJyE1U mrPFqwdCmolumbbmGCGN1QO2oeQm7SEvFyOzUHMB083RPM4zYpJXJ3LIvzBsKUxLKW4f irmo2WlQGm114OFiQg9YcodNZr9lyx8/1Ba9KTOvtnu3k/UDXCadJPInrNZGnghbvld0 Zy4fFxIiWLriLWaRtL4qj1EI3HG2/jRQeGWAmeaUivBcJnb1366tJREQ+tnX/DsXf75I Fdg8GrzB3TzEXrcbGvYzfl7dpz6i1z9/M318X4qtlYeAyXDa6Lgk6Fd0TVcQStW4F321 Vnrw== 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=13fmXxWmftXhEDSnWFmDK5Up8/fCtI/KaeACOLnShgU=; b=tFwL/483ljjBl0fBk/fpxPI2axx+UxgYjMADZhQO3Y57U6VKGJOKqfSyh5VpD8psM3 XamDZ4j7x71mY++NrfjoDMSfgy4hBJH5Iq/ATRAtxhZ5ES1ypLulU15X4dVQ7bYz5tZ3 i2Eo35oXMXKJ2kH8sI9HZR5Elqcfo111rzfoATaSC2YXmRIwvMcaXzTEfWEG5d0UssM7 pepUBwCmb4QOXlzf8E4lq93MSL51hDZ7RXVU6yEe8FfyeRsm/P5DFlTSBlD8WZ+/3Vpe O/Ji1cR6MhqrnKidqHKz9OYczXg75drSQtGamaXI0sbVQjwm795fJqQpk3OMihUbV1Ss 1SaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="f4qP/MHY"; 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 v66-v6si4912851pgv.289.2018.11.08.12.32.55; Thu, 08 Nov 2018 12:33:10 -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="f4qP/MHY"; 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 S1727244AbeKIGIG (ORCPT + 99 others); Fri, 9 Nov 2018 01:08:06 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41238 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725723AbeKIGIG (ORCPT ); Fri, 9 Nov 2018 01:08:06 -0500 Received: by mail-lj1-f196.google.com with SMTP id z80-v6so19194718ljb.8 for ; Thu, 08 Nov 2018 12:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=13fmXxWmftXhEDSnWFmDK5Up8/fCtI/KaeACOLnShgU=; b=f4qP/MHYRZeGIZvc4O6WKahXitIihqJx61HfnKdELNwcRlCytmEHdzaHPiE5ASiZPf E9j5maiv2z1YYa2EWN5N79clqCjkjVeU/pWORCZu+YwNyhtwD4uXIwUME8M2u98HpRKG TNKcVTSzU+E6EO+XPZ/I+0mvEodw3xuwlDDkA= 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=13fmXxWmftXhEDSnWFmDK5Up8/fCtI/KaeACOLnShgU=; b=EfIGaxBL9Uzr8C+eIYe8lMppZxsW8vITNnT6REkTFBrlSB6Auw+oMfcUsDPiHxvpiG Fv4+rfaMFfFGKyPAqKBifyZUn+X2FIJFH4ijjwP5wKRlW/YMe462+CJBb5GJ0Y/yMqB8 p51hYfy0kicZyuN0YWTIh2pvTP5F5OD9wjrmNds32rL/5kglwPmW+z1HjbvFldYiJ4Xa RdthAgNBsUEF9Xrze96kUOEPpsl49S2ukWimUBM2H9sA/vqMsO0QazGkhue8hbmfoTxl 5flwoqVWxZw6JhKMqaCa33RhofvWlZ7ABVauS0lAz1H5k8XCSZdwxi+u11q+I1KCW3Hf Xykg== X-Gm-Message-State: AGRZ1gKL3GNzkmq0hSXTIlC9+5r0OTL2drRQHPCHGlmwrEc7Zx5otBAe HrNxuDAH4293mSgREKcVqH0wNg== X-Received: by 2002:a2e:59ca:: with SMTP id g71-v6mr3857856ljf.79.1541709056566; Thu, 08 Nov 2018 12:30:56 -0800 (PST) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id w9sm809250lfc.66.2018.11.08.12.30.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 12:30:55 -0800 (PST) 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, bjorn@mork.no, Ivan Khoronzhuk Subject: [PATCH v2 net-next 0/4] net: ethernet: ti: cpsw: fix vlan mcast Date: Thu, 8 Nov 2018 22:27:53 +0200 Message-Id: <20181108202757.30110-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 v2..v1: net: ethernet: ti: cpsw: fix vlan mcast - removed limit for legacy switch cpsw mode 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 | 186 +++++++++++++++++++++++++++------ include/linux/if_vlan.h | 11 ++ include/linux/netdevice.h | 10 ++ net/8021q/vlan_core.c | 27 +++++ net/core/dev_addr_lists.c | 97 +++++++++++++++++ 5 files changed, 300 insertions(+), 31 deletions(-) -- 2.17.1