Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp830429ybg; Thu, 19 Mar 2020 09:29:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkYIXcomOusOr+4IgAGaaYweqknScfMH+PW3TCRtni9XNZULJe0bfbCtrDsW3sR75u4Ojf X-Received: by 2002:a9d:171e:: with SMTP id i30mr3074570ota.327.1584635356238; Thu, 19 Mar 2020 09:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584635356; cv=none; d=google.com; s=arc-20160816; b=tOEOo+pI1JuXVrXCqT1TU1E99thOkSmL+INEhTVcL8FUzJeyW6dIhq1xmSsZViPfym HRsXmcJpV/AZ4VXZlUF48ElcYn40ujNy1HhToCPVQ6yirDWpTuC5CRM0Q4JR3prc7tTA NgzOkFPQcCmKiD8zNQWdG02sugiNIe+j1LQihiEfpPSIE76w5P2JxWnxo4djQ/PhWhdO zd2GbiSbVQfYJPiqYHmZ9BU487YbvAL+pnwfmDSBB3XLbJFzY5wn7eidYgksY8BZfX13 5sXR1XGG7RPR8Ot+6I1b5If+wYwqlDEqBdrCtQ0ysPa1cwlcPAb8jzkkU7VUE+A28Eko 1awQ== 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=mJfV+9tsEYG5ukC8EERFrenHi+vk4PG18uXOS8eIBcs=; b=i1vGRbnXR+Oe5Q8ENY73vqfYTDrGDlUBKZ3jIqDQw4c2O4FyCNqDYnJ+N5dyhZw5aq eK5Lps4hM9DRyD86oQNxhehZl1aRPA+ohc/FbiS8aA6HqZ4K+E4CS1L15kdSIZiWsPtI 9KTRYVj5OmYbzqfiOXqydCiuEqt0h5rVQjjykEk8QnOX0Y86oLnN+4UIcFE0BsjlFpBW c9DoWQ/1/taHV13IrYmNA3ryS6uDP8RwVtW3aRWDdGUqJw//yFVQ5zpCHOZzeb1635ZC 1RyQa6gxIraBDhg45CfjaWhORueTVOQZpDkpOU+NODiwLWy6GSOv7GvaeRPhQv3Ktp8t hvKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lQRDan5A; 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 m185si937747oib.102.2020.03.19.09.29.03; Thu, 19 Mar 2020 09:29:16 -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=lQRDan5A; 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 S1728222AbgCSQ2d (ORCPT + 99 others); Thu, 19 Mar 2020 12:28:33 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54194 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728181AbgCSQ2b (ORCPT ); Thu, 19 Mar 2020 12:28:31 -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 02JGSLD3085347; Thu, 19 Mar 2020 11:28:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1584635301; bh=mJfV+9tsEYG5ukC8EERFrenHi+vk4PG18uXOS8eIBcs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lQRDan5AFT2Ck1yz6GSh+DX2n4RRgv3aAQXSaq94B87oXiGEHIP5e4e4lJyNCI91T yN6JrHUBNxm+nOaH24fzncFb7EUWXX46t5jJBOx+MH7y025lu9sG1Hb57Zf4UmdSrN 9o/YuISnsEVR5zRxa3jo+Pygx+iBlntnKKh4ZsC8= 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 02JGSLXk110729 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Mar 2020 11:28:21 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) 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.1847.3; Thu, 19 Mar 2020 11:28:21 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) 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; Thu, 19 Mar 2020 11:28:20 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 02JGSJQX047620; Thu, 19 Mar 2020 11:28:20 -0500 From: Grygorii Strashko To: Peter Ujfalusi , Rob Herring , Tero Kristo , "David S . Miller" , netdev , Roger Quadros , , Jakub Kicinski CC: Murali Karicheri , Sekhar Nori , Kishon Vijay Abraham I , , , Grygorii Strashko Subject: [PATCH net-next v5 03/11] net: ethernet: ti: ale: add support for mac-only mode Date: Thu, 19 Mar 2020 18:27:58 +0200 Message-ID: <20200319162806.25705-4-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319162806.25705-1-grygorii.strashko@ti.com> References: <20200319162806.25705-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 Tested-by: Murali Karicheri --- 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