Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp581444pxk; Wed, 2 Sep 2020 09:16:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRyoQKzVl2zBdCGv4QePry1hfQikRGPp5DOn6DxMNsd+iMTws3B7u9YrzwVhFzD03xqB4P X-Received: by 2002:a50:99d6:: with SMTP id n22mr812634edb.265.1599063414532; Wed, 02 Sep 2020 09:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599063414; cv=none; d=google.com; s=arc-20160816; b=U53jAQB4uwMsSPRzIZhMcRyLwii58JbD5s5MBhK9oNIplZZQMNQBjj5VjoBNIE2Zjt xK239V9jLc4cxqKuzu4F0HmLuPW/h9YPFzjCO2qzCDYYtcVM5hycaLznx4myFoEL9q2B +yNBwY5lvwPvKfHmyd37VD8ZrwvoHhe5Jl6ClIzCPAdEX+NBZ6e52QCcxFQdS/Ea/leo SYnOrcaBkiN892+PgdlFCeo+g2+tB/3q5SZcpynX8ai/TIAzGS0Et3tCNPnqoqRTjPGO qdnBIX0chRJpUmPlH2lWbKCtQP7xk+PsbSxtWe1G2/18BhWWKkK1uWeJvu8ZaL/LKaXj FrYQ== 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:references:to:from:subject:dkim-signature; bh=4U7Tu8S2YkBMp3KG+c8+MCT2MzCWjUpLKKMSrOYYYxM=; b=Fva4M/RKGqn9WTaMUlD8fsAjMteIJNOk/460OmFqGVripY3aWgPsPlOQ6qvfbHiLv0 YT+RFuW+GUNSDlqp5ApLfqVA8CtsoXtRXzYS2vJooKeBCeeRGxHSKGVYKqoJQb4099kL AvcX/ri921Y8LFQoilhPHin2VDyp7/R5V5gNe7qcNHaQWD2+6pi2nr3IqlOu9tZJvQQn UX6Qs7PCTnl8bb5MOOA2r1tDL0AFZ5QK+8BuQ6EkfpsmxgZDV+KuSqdre0HAl1uL+oGQ 5VAwWXSPtjg7EVhFJqjj9vRTLgBH7sCCgWpYvg6mr6epjCH2QQdWQasJhV0s57AhBR+h 9peA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QTo5QbZD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si2878110edw.144.2020.09.02.09.16.30; Wed, 02 Sep 2020 09:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QTo5QbZD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgIBQPK (ORCPT + 99 others); Wed, 2 Sep 2020 12:15:10 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58366 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728787AbgIBQOa (ORCPT ); Wed, 2 Sep 2020 12:14:30 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 082GEPQr073331; Wed, 2 Sep 2020 11:14:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599063265; bh=4U7Tu8S2YkBMp3KG+c8+MCT2MzCWjUpLKKMSrOYYYxM=; h=Subject:From:To:References:Date:In-Reply-To; b=QTo5QbZDftQm6jP/nsTVN6ecuOH/jU5c7msRq3f8CHmxu7ImZHH/9hxWYMmHxP2nO MSa3rts5Pg8HV+/3xzzmUzshu41/d/9VcwAG63IVoMY/OwxGGuZ+2WONZXgmXD7602 KTBArZFsQw64bNvTHb7ic4UFemiOdmcty6kqY1Qk= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 082GEOT0004597; Wed, 2 Sep 2020 11:14:25 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 2 Sep 2020 11:14:24 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 2 Sep 2020 11:14:24 -0500 Received: from [10.250.53.226] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 082GENJk010402; Wed, 2 Sep 2020 11:14:23 -0500 Subject: Re: [PATCH net-next 0/1] Support for VLAN interface over HSR/PRP From: Murali Karicheri To: , , , , , References: <20200901195415.4840-1-m-karicheri2@ti.com> Message-ID: Date: Wed, 2 Sep 2020 12:14:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200901195415.4840-1-m-karicheri2@ti.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All, On 9/1/20 3:54 PM, Murali Karicheri wrote: > This series add support for creating VLAN interface over HSR or > PRP interface. Typically industrial networks uses VLAN in > deployment and this capability is needed to support these > networks. > > This is tested using two TI AM572x IDK boards connected back > to back over CPSW ports (eth0 and eth1). > > Following is the setup > > Physical Setup > ++++++++++++++ > > _______________ (CPSW) _______________ > | |----eth0-----| | > |TI AM572x IDK1| | TI AM572x IDK2| > |______________|----eth1-----|_______________| > > > Network Topolgy > +++++++++++++++ > > TI AM571x IDK TI AM572x IDK > > > 192.168.100.10 CPSW ports 192.168.100.20 > IDK-1 IDK-2 > hsr0/prp0.100--| 192.168.2.10 |--eth0--| 192.168.2.20 |--hsr0/prp0.100 > |----hsr0/prp0--| |---hsr0/prp0--| > hsr0/prp0.101--| |--eth1--| |--hsr0/prp0/101 > > 192.168.101.10 192.168.101.20 > > Following tests:- > - create hsr or prp interface and ping the interface IP address > and verify ping is successful. > - Create 2 VLANs over hsr or prp interface on both IDKs (VID 100 and > 101). Ping between the IP address of the VLAN interfaces > - Do iperf UDP traffic test with server on one IDK and client on the > other. Do this using 100 and 101 subnet IP addresses > - Dump /proc/net/vlan/{hsr|prp}0.100 and verify frames are transmitted > and received at these interfaces. > - Delete the vlan and hsr/prp interface and verify interfaces are > removed cleanly. > > Logs for IDK-1 at https://pastebin.ubuntu.com/p/NxF83yZFDX/ > Logs for IDK-2 at https://pastebin.ubuntu.com/p/YBXBcsPgVK/ > > Murali Karicheri (1): > net: hsr/prp: add vlan support > > net/hsr/hsr_device.c | 4 ---- > net/hsr/hsr_forward.c | 16 +++++++++++++--- > 2 files changed, 13 insertions(+), 7 deletions(-) > I am not sure if the packet flow is right for this? VLAN over HSR frame format is like this. My ifconfig stats shows both hsr and hsr0.100 interfaces receiving frames. So I did a WARN_ON() in HSR driver before frame is forwarded to upper layer. a0868495local@uda0868495:~/Projects/upstream-kernel$ git diff diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index de21df30b0d9..545a3cd8c71b 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -415,9 +415,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame) } skb->dev = port->dev; - if (port->type == HSR_PT_MASTER) + if (port->type == HSR_PT_MASTER) { + if (skb_vlan_tag_present(skb)) + WARN_ON(1); hsr_deliver_master(skb, port->dev, frame->node_src); - else + } else hsr_xmit(skb, port, frame); } } And I get the trace shown below. [ 275.125431] WARNING: CPU: 0 PID: 0 at net/hsr/hsr_forward.c:420 hsr_forward_skb+0x460/0x564 [ 275.133822] Modules linked in: snd_soc_omap_hdmi snd_soc_ti_sdma snd_soc_core snd_pcm_dmaengine snd_pcm snd_time4 [ 275.199705] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.9.0-rc1-00658-g473e463812c2-dirty #8 [ 275.209573] Hardware name: Generic DRA74X (Flattened Device Tree) [ 275.215703] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 275.223487] [] (show_stack) from [] (dump_stack+0xc4/0xe4) [ 275.230747] [] (dump_stack) from [] (__warn+0xc0/0xf4) [ 275.237656] [] (__warn) from [] (warn_slowpath_fmt+0x58/0xb8) [ 275.245177] [] (warn_slowpath_fmt) from [] (hsr_forward_skb+0x460/0x564) [ 275.253657] [] (hsr_forward_skb) from [] (hsr_handle_frame+0x15c/0x190) [ 275.262047] [] (hsr_handle_frame) from [] (__netif_receive_skb_core+0x23c/0xc88) [ 275.271223] [] (__netif_receive_skb_core) from [] (__netif_receive_skb_one_core+0x30/0x74) [ 275.281266] [] (__netif_receive_skb_one_core) from [] (netif_receive_skb+0x50/0x1c4) [ 275.290793] [] (netif_receive_skb) from [] (cpsw_rx_handler+0x230/0x308) [ 275.299272] [] (cpsw_rx_handler) from [] (__cpdma_chan_process+0xf4/0x188) [ 275.307925] [] (__cpdma_chan_process) from [] (cpdma_chan_process+0x3c/0x5c) [ 275.316754] [] (cpdma_chan_process) from [] (cpsw_rx_mq_poll+0x44/0x98) [ 275.325145] [] (cpsw_rx_mq_poll) from [] (net_rx_action+0xf0/0x400) [ 275.333185] [] (net_rx_action) from [] (__do_softirq+0xf0/0x3ac) [ 275.340965] [] (__do_softirq) from [] (irq_exit+0xa8/0xe4) [ 275.348224] [] (irq_exit) from [] (__handle_domain_irq+0x6c/0xe0) [ 275.356093] [] (__handle_domain_irq) from [] (gic_handle_irq+0x4c/0xa8) [ 275.364481] [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x90) [ 275.371996] Exception stack(0xc0e01f18 to 0xc0e01f60) Shouldn't it show vlan_do_receive() ? if (skb_vlan_tag_present(skb)) { if (pt_prev) { ret = deliver_skb(skb, pt_prev, orig_dev); pt_prev = NULL; } if (vlan_do_receive(&skb)) goto another_round; else if (unlikely(!skb)) goto out; } Thanks -- Murali Karicheri Texas Instruments