From patchwork Tue Sep 1 19:54:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 248951 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4550248ilg; Tue, 1 Sep 2020 12:54:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJDK3Fjyl/UA7Tl2h6ZsiefPxqyizrY1Vl3JH/en32HiNYl7hArsRmxFCsgfoC5ExLD6g2 X-Received: by 2002:a17:906:69d5:: with SMTP id g21mr2942052ejs.461.1598990076984; Tue, 01 Sep 2020 12:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598990076; cv=none; d=google.com; s=arc-20160816; b=kXfvAMGyY/BjcL2rvKfatdy62WsnP3e6ZX2yUDjutM8VHlQYmkimUaInwPlwMmcInk kL6r+VS3NHslO+hykQZ4D0bX6AerXTtilpbBme1AlD/n+xUWzYEohvneym3t59WdSWWO a5tahyXLhsgg5tPkQBfYRWKy4oqtDsy4ZxjtcsIv+6Nd3jTxbjyFh03EZXT0GXBYXWuJ /HvEmzhQINgLB0WbR/Vn4pJjH9o/W52ZOrz/bE0oJO4mz7Wh7K21fmRsxwABN45YRpGa JEf5uUYt2GQUukyaBzE27uvKhUqYAFPe4ww3BGtjIVxw90LuTu10BZt0+aI6izXRjAWU ScIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Lu82WDTZtjgRfPM+Iobl8OMuRMAy5grVMfYKmRhJHkc=; b=YguttAW+r2iTPUftKRcmOh2YtAterncLGEkqaTvjj/5yg2KHvgkLMk6fVwvZd84YTz LGq286//DiILD+YuL4XJiKmK+ViNVik79tZfReQHxlEGfl7HvwRDX6ifib12mFlayoPw sRzNJvLghGwk4QFa7rlQjL6KeIdVc0XClodHeebdxoyL4QSwaK8VeVDLCpk3jdZRpuX1 mZhNVCKmjO4q3sxtO9390yCbR8EKYSky/0Z5CVoqL4agYqOtLDth8LZyOcXJUyLcpGaY A13z+cSofHDT5A42eEei5911D6nEfrPhoQkpXAHk4cNMC2fsL3lw3qc21pnUYRqvSzl0 tBaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Qy/69CR4"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 u2si1204091edt.17.2020.09.01.12.54.36; Tue, 01 Sep 2020 12:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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="Qy/69CR4"; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S1732776AbgIATyc (ORCPT + 9 others); Tue, 1 Sep 2020 15:54:32 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:55216 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731958AbgIATy1 (ORCPT ); Tue, 1 Sep 2020 15:54:27 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 081JsIOa023999; Tue, 1 Sep 2020 14:54:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1598990058; bh=Lu82WDTZtjgRfPM+Iobl8OMuRMAy5grVMfYKmRhJHkc=; h=From:To:Subject:Date:In-Reply-To:References; b=Qy/69CR4Lnh5s2BRaQCJZadpJEDdCF81X+g3R2ZmnXHHjOaSobDTJyzZ/6X5xnABf iPAXTqSbX+RqJbLKlqaB7rizAUdmPZjp7UZyYoksCQb5u9ttaE7jjY9knewy6x8iYN zHSrWAhj+P96bperfKPRA9le0EcaeYrCw0P8TQeA= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 081JsIEg079055 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Sep 2020 14:54:18 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 1 Sep 2020 14:54:18 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE104.ent.ti.com (157.170.170.34) 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; Tue, 1 Sep 2020 14:54:18 -0500 Received: from uda0868495.fios-router.home (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 081JsFZl093195; Tue, 1 Sep 2020 14:54:17 -0500 From: Murali Karicheri To: , , , , , Subject: [PATCH net-next 1/1] net: hsr/prp: add vlan support Date: Tue, 1 Sep 2020 15:54:15 -0400 Message-ID: <20200901195415.4840-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901195415.4840-1-m-karicheri2@ti.com> References: <20200901195415.4840-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch add support for creating vlan interfaces over hsr/prp interface. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 4 ---- net/hsr/hsr_forward.c | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index ab953a1a0d6c..e1951579a3ad 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -477,10 +477,6 @@ void hsr_dev_setup(struct net_device *dev) /* Prevent recursive tx locking */ dev->features |= NETIF_F_LLTX; - /* VLAN on top of HSR needs testing and probably some work on - * hsr_header_create() etc. - */ - dev->features |= NETIF_F_VLAN_CHALLENGED; /* Not sure about this. Taken from bridge code. netdev_features.h says * it means "Does not change network namespaces". */ diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index cadfccd7876e..de21df30b0d9 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -208,6 +208,7 @@ static struct sk_buff *hsr_fill_tag(struct sk_buff *skb, struct hsr_port *port, u8 proto_version) { struct hsr_ethhdr *hsr_ethhdr; + unsigned char *pc; int lsdu_size; /* pad to minimum packet size which is 60 + 6 (HSR tag) */ @@ -218,7 +219,18 @@ static struct sk_buff *hsr_fill_tag(struct sk_buff *skb, if (frame->is_vlan) lsdu_size -= 4; - hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb); + pc = skb_mac_header(skb); + if (frame->is_vlan) + /* This 4-byte shift (size of a vlan tag) does not + * mean that the ethhdr starts there. But rather it + * provides the proper environment for accessing + * the fields, such as hsr_tag etc., just like + * when the vlan tag is not there. This is because + * the hsr tag is after the vlan tag. + */ + hsr_ethhdr = (struct hsr_ethhdr *)(pc + VLAN_HLEN); + else + hsr_ethhdr = (struct hsr_ethhdr *)pc; hsr_set_path_id(hsr_ethhdr, port); set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size); @@ -511,8 +523,6 @@ static int fill_frame_info(struct hsr_frame_info *frame, if (frame->is_vlan) { vlan_hdr = (struct hsr_vlan_ethhdr *)ethhdr; proto = vlan_hdr->vlanhdr.h_vlan_encapsulated_proto; - /* FIXME: */ - netdev_warn_once(skb->dev, "VLAN not yet supported"); } frame->is_from_san = false;