Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3474540ybh; Tue, 17 Mar 2020 00:29:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuhWwMZ5oXKmQWbqPWfvndbgZUDivpCpsQkQ4IaqTCoSsYJhhn+u1LqlvnCghQZh95twnk9 X-Received: by 2002:a05:6808:8cd:: with SMTP id k13mr2657144oij.34.1584430145781; Tue, 17 Mar 2020 00:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584430145; cv=none; d=google.com; s=arc-20160816; b=uhfb2b35QVMTHtbdYTu3oxV2p6w6IDgQUpYrhaAgagvjwfkabwAUY9MERi49DC9aVI DFtY0VzCRYxc4Q3X28wpM33mbXRZufHIJ72Xb5v/fIOxBwrsoCDWn7q2/wVByJvHensD sfHK3Szc9TDMr0DVZPzCOyTgKvLUmeAbOHmtzDt6QgPYiVtNjiavLyoqMM3AXCJX8qcF iKjzrxeGC6MQDetLbAXngXQQO7pIMyKKJH6wgizA02nBgw6SpiwyWmZQxIyhP9P9Gs9E i9MobdNMhpWDsIA1qU4gMt1HeTHAK/OYfEAg3O1t9Pt8VOTuNe4NAU11SO15T7fEr1by FyOg== 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:cc:to:from:dkim-signature; bh=Xzf0pl4I+GiIsTovME8OTFIU5DSaFYgw7dndhzZDk6Y=; b=SNT9DtI3EFpEp7+da4EHZghumKSxugULKyWS3s/xF2cv+B3D/Ozo9sykCsoWcxLgzS BPr4aAfjOky8M+lpiyLiuxy3IrN+f5yb/KR4+m/sdZm4q/NWhXFYgb0g89tldPMDZ1RJ CRKuRm+4+s2bAp3QgEpRZeCORNgY1r0VBu7uf7xbd1V1VP/mmT8WJovGHMeNZdeWhIZ8 UAQjfjF99ad2lXBGedoTPEHHPYy59gy7gxOhqD9YzZpIz9Ab4/fNo8OdP66NiW3VzZyC bvy6bGhAuvmywRoFE0qGqMZ4zWZiD7Bi2glSaVkh5PppjzUZtM2ViZ15a5BHpFjIcj8h a1IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="RR/mLZ22"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si1496964ots.325.2020.03.17.00.28.53; Tue, 17 Mar 2020 00:29:05 -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=@ti.com header.s=ti-com-17Q1 header.b="RR/mLZ22"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbgCQH2T (ORCPT + 99 others); Tue, 17 Mar 2020 03:28:19 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:55500 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgCQH2T (ORCPT ); Tue, 17 Mar 2020 03:28:19 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 02H7S9cY063115; Tue, 17 Mar 2020 02:28:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1584430089; bh=Xzf0pl4I+GiIsTovME8OTFIU5DSaFYgw7dndhzZDk6Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RR/mLZ22sc0Cai5h3htETIMeaUUekEf1X3VLVirGQG0/U62AGtNzsVVjuIIyV+NTs VXV/M43IVceeEVH7qZsxyO8oXcWhbdZHXtIodvLopVAjDZanEtPnKbsIUB0jK2Z8eP JV8dreUihz7LatuUkj4jk1wEvOVdhDYwYjxUiWtU= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 02H7S99D056701 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Mar 2020 02:28:09 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 17 Mar 2020 02:28:09 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Tue, 17 Mar 2020 02:28:09 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 02H7S86s069060; Tue, 17 Mar 2020 02:28:08 -0500 From: Grygorii Strashko To: Rob Herring , Kishon Vijay Abraham I , Tero Kristo , "David S . Miller" , netdev , Roger Quadros , , Jakub Kicinski CC: Murali Karicheri , Sekhar Nori , Peter Ujfalusi , , , Grygorii Strashko Subject: [PATCH net-next v4 03/11] net: ethernet: ti: ale: add support for mac-only mode Date: Tue, 17 Mar 2020 09:27:31 +0200 Message-ID: <20200317072739.23950-4-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317072739.23950-1-grygorii.strashko@ti.com> References: <20200317072739.23950-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain 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 The new CPSW ALE version, available on TI K3 AM654/J721E SoCs family, allows to switch any external port to MAC only mode. When MAC only mode enabled this port be treated like a MAC port for the host. All traffic received is only sent to the host. The host must direct traffic to this port as the lookup engine will not send traffic to the ports with the p0_maconly bit set and the p0_no_learn also set. If p0_maconly bit is set and the p0_no_learn is not set, the host can send non-directed packets that can be sent to the destination of a MacOnly port. It is also possible that The host can broadcast to all ports including MacOnly ports in this mode. This patch add ALE supprt for MAC only mode. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw_ale.c | 16 ++++++++++++++++ drivers/net/ethernet/ti/cpsw_ale.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 5815225c000c..719e7846127c 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -779,6 +779,22 @@ static struct ale_control_info ale_controls[ALE_NUM_CONTROLS] = { .port_shift = 0, .bits = 1, }, + [ALE_PORT_MACONLY] = { + .name = "mac_only_port_mode", + .offset = ALE_PORTCTL, + .port_offset = 4, + .shift = 11, + .port_shift = 0, + .bits = 1, + }, + [ALE_PORT_MACONLY_CAF] = { + .name = "mac_only_port_caf", + .offset = ALE_PORTCTL, + .port_offset = 4, + .shift = 13, + .port_shift = 0, + .bits = 1, + }, [ALE_PORT_MCAST_LIMIT] = { .name = "mcast_limit", .offset = ALE_PORTCTL, diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h index 70d0955c2652..eaca73c17ae7 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.h +++ b/drivers/net/ethernet/ti/cpsw_ale.h @@ -62,6 +62,8 @@ enum cpsw_ale_control { ALE_PORT_UNKNOWN_MCAST_FLOOD, ALE_PORT_UNKNOWN_REG_MCAST_FLOOD, ALE_PORT_UNTAGGED_EGRESS, + ALE_PORT_MACONLY, + ALE_PORT_MACONLY_CAF, ALE_PORT_BCAST_LIMIT, ALE_PORT_MCAST_LIMIT, ALE_NUM_CONTROLS, -- 2.17.1