Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5483025rwd; Wed, 24 May 2023 02:23:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GeSTNYwweoia9BPfDDBkve8TwbErUvc93D+ekrJs2U/xpn3rq4/2AAKtD6KTMuScm0djp X-Received: by 2002:a05:6a20:2455:b0:103:7b89:d70a with SMTP id t21-20020a056a20245500b001037b89d70amr16918531pzc.54.1684920183518; Wed, 24 May 2023 02:23:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684920183; cv=pass; d=google.com; s=arc-20160816; b=SR/VXZLyDV/fnU1aZ166KDIk5gdF9bSfJtKgJmH6y2hi1jgFNRRx+fYIPhMOuTZXOZ OZFnwBSjrtHrKMZ4vVCDTQa+qTRZSliHDiFXQl7+31BF7oQOc8UtCYS9KXHlLgsmGPTX RxzfDptT5JbF3LptUQ4/TGa5gbg45XY44IdrKX3uRD5lGMUQQaUpmBLUM/9Mq4o9ffbA 7miKJKY7qO1K6ueie3NQm7IQUuyx+dHMb3/u5FNvQSkheHSZUwj5k5gCdcMgFJS4VzK/ IKgvpCB+5FGTbvDCLwGu/fDWnI+43JxVNTOHC/FkMXVFQspTqJeEb3sm444ZcPnX2ZAk ewnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EjysrcvpIysM4nTXMnOYFhEOXkbaTSCVxp780VDwaqo=; b=J1q8LAyYlFTajKq8RSSnmIdDszBbrlSG5EEDQ31hsfk9T7v5sntpGSndSTG58zN7et 8KUDz/ifRuBbKEUfI8JTvXL20D0xb11ofJLVRtCX35R6VJXB/mMLihHCWLQz1kuDgAvR j0IA4EQofs2Dq2wOD4R/XvC7S1RlCb1RQIEkcMc2CdaL64fTKoq7eRnpUvH04oeldVNO oHPOhzxRi+ea5MU0EFKwIdexe8OxSlyyqcHaAFWzOxiVSdGlYv632LfLAFxxWbO/b8Kv LGmGrCAVWRBZEvT4PVPqUqQadhjacd+hLGJFoTY20sL3GO6E3J+xsW87TNhXjp0mmJCA xi8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=QZMz7gXH; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 198-20020a6302cf000000b0052d7238ad5asi214076pgc.721.2023.05.24.02.22.50; Wed, 24 May 2023 02:23:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=QZMz7gXH; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240335AbjEXJUK (ORCPT + 99 others); Wed, 24 May 2023 05:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240312AbjEXJTt (ORCPT ); Wed, 24 May 2023 05:19:49 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2096.outbound.protection.outlook.com [40.107.237.96]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB5A8E; Wed, 24 May 2023 02:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VI+k664UPmFfIZapjp+PnZey4ZulwOAuXwcaicd4MnhrZkdRdX4V7Eg672pPWzZTdmHLs6m7XUFvEImdAAIDjky2yXqaCs6QIZRlQ0KlW54GlkehqiYam3QxPrA+fmnFm3oO8iFZ5N3LuRezi3+6caokPXo0pBYZ9MI5lgQhYWyyElbGU28JGJVACzs52EUsPXrMrbyQv2jrES5gixL90PjPiIp+RDU47K5Zo7zEMiYJtOtHxh0E/HJ2v5WhFvqzn4+SF5XLNKAiHQBER4OTN0mUztGemMagv5UkwZRzbwpG4M81Arptv+DdCmYcqffhe57CfnwElU27veCw8U0lNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EjysrcvpIysM4nTXMnOYFhEOXkbaTSCVxp780VDwaqo=; b=GLa3PF9kGJ4kzaKKYunFRXaQz2LEJMKzRBoXh32qLvOatDvI6aA6Cx5YqufmTRR+G/EsiEL6UJZKnsS9dAvLIDaBdPFJMeJuPae+BlbosXMJH6L+UqrqtiqS4Lh+BHfz66cbbSS4vqN0ZA1OQN4CRrDn59Xqil8yDFFCc8cKSaPZh0E8thveObPJEIwoh4xJWcvv7YGy+0hQvLqvAHtWw6YeG8jYoRUTsRGKfJr/R1+zzO8I1wxjcKx1YEvb0MhcssJ396WcjFy7vwtUZUFqTH7CEsoXpNoelylFwafOSLc4cg/tRg6JcbIteq2OJLgs9Oy3oJ50bExkoosnmh2c2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EjysrcvpIysM4nTXMnOYFhEOXkbaTSCVxp780VDwaqo=; b=QZMz7gXH/Y1CIW0Gsf9SH1tcomfJIKNBtJ/qO6vLRO8v+ZuBoe2YPQceTvqwsdDBVAFN6ihc3P9FzXSTAvrlcmtyS4UJs5XMCmyO4XZsuwQXuv0z3dKDz8KlWMuFETKqsovIhqLCMd5xosHc2jWKAzK7IQnSRHJTYCuX007MGoo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by DM6PR13MB3642.namprd13.prod.outlook.com (2603:10b6:5:24b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 09:19:44 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6411.029; Wed, 24 May 2023 09:19:44 +0000 Date: Wed, 24 May 2023 11:19:35 +0200 From: Simon Horman To: Justin Chen Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, justinpopo6@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, opendmb@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, richardcochran@gmail.com, sumit.semwal@linaro.org, christian.koenig@amd.com, conor@kernel.org, Florian Fainelli Subject: Re: [PATCH net-next v4 3/6] net: bcmasp: Add support for ASP2.0 Ethernet controller Message-ID: References: <1684878827-40672-1-git-send-email-justin.chen@broadcom.com> <1684878827-40672-4-git-send-email-justin.chen@broadcom.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1684878827-40672-4-git-send-email-justin.chen@broadcom.com> X-ClientProxiedBy: AS4P251CA0004.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::6) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|DM6PR13MB3642:EE_ X-MS-Office365-Filtering-Correlation-Id: a532a5fb-dbac-47c3-dd71-08db5c3802df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/HDXRdXjeRT+BBZWHeNgMXJCPnRcox2BM9mOWKfPTC75+SplE/4QNvAGn7X04p4c6ebHitDZV+naqXcDlbmgQ3x2GoJawkZw+CCYpvwz7acTc4UmgWidJ8eZHqGbDc32S2aDoMPOLJ+aN2Oe3K8eYOBBhPbxw1pmrOZ71rjc4O8DcRFo3x8txKUXHMhKsANeTcnSvUWNr+u3msCTCy+KbqickewMjSPzoFDItHFIHCE56cjEqX1tqkqDJWJ69N4ZGxrp2/+7xMG++YR73OXyAZj1XodSbcuX5TTstUHrfbcK7GTzDLr6Emw2yAUujcv5hWfgNEnLyNyT4XnJshKSrOmjufLSm8M8ZnaYYMFIVK094kMwcPNi8Phj+miiEZq/qQ0fngGWsZuTBt1mMvGFLpsgGudhO/asuedk0k3J6xJLEy70WqVOZ8qCPQv2eAyozV76KJMaOYlT5ILsuCxGIVuQnhGVWJjPxuhmR6vs7AxT4GrSpMTpUE/cKoklKDZauNFIqpJZ8enxtaGF339x62v1fQJBeXLTPbgINFV1YNhFupkiah7MKXz/Ji1VEq630Fve/B297iFqgOGO7iGSxp4RbPHrjB2+cb8DsUQ574= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(376002)(346002)(136003)(39830400003)(451199021)(83380400001)(8676002)(8936002)(7416002)(44832011)(5660300002)(6506007)(6512007)(86362001)(186003)(2616005)(38100700002)(6916009)(478600001)(6486002)(66946007)(66556008)(6666004)(41300700001)(4326008)(316002)(36756003)(66476007)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ghITYONGQeCr9IMo/JR/w6i+oJ+spMJrn0Ha6W6Muo7JsrNl/7ih8gSIu1o5?= =?us-ascii?Q?uKu8MIexmnYD+6ZSMu8J6gqO4saX7+KgHY6nrMcHEReOHVotIvPgKQQQOpH6?= =?us-ascii?Q?LzBH1yx292ShVnd996UuZT7bBY0/J+z02keQl58jq3DXckFIOS5Gs3KJg899?= =?us-ascii?Q?VR5JMH65Bh6b+r4+H8TaCFBIEL474VglctFCYttgwpXy8hMT2taTVSq18FIR?= =?us-ascii?Q?QegWYYYut/G3nhH88MU96xL8kiHXnl/fUiOApu3bWTeZAdN+LGIQqU8ck/vD?= =?us-ascii?Q?Z9OWyTOAUvAA4J8JO//u3h676Unq0e16S0TwOF9DNevpnjcnisRHacD4eD7E?= =?us-ascii?Q?aE9KtzcTGamwxP1sbkIp8nLbpUGUYEPxTDEqxgWdEJSaAk7/G+4kyh9g21f5?= =?us-ascii?Q?nV4eDu5dvwJpfW5jUphBrxki6bt6whefVH85pVG3R8kgzyc1nuw3rC7DfR/X?= =?us-ascii?Q?b86P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uEYG8nkh?= =?us-ascii?Q?bjs3gFKzCo6ADnqBA/zbqiwETToI4IWrMpyOY6kQdBw/ShpBTNsqS/4Ttau9?= =?us-ascii?Q?KYyRm6GqxBKn25Oj9ngjweTj12ISbEsBYAsBbzDhKkGXcUntvjkc/5VuPke3?= =?us-ascii?Q?5Fpi0wCNBXUqpoTKZlVHVwxMZWQfRpmMxlgDFjgeOJX9LWAEX7yinvdK+3rC?= =?us-ascii?Q?EajnnbIVy6loy4Qm4wgwD0K6mRMPMpMn9ISYqDMTLrO5+4caO9kd2vt289NZ?= =?us-ascii?Q?ow7j6D53F6U26pK3yygoiByQbGtVCJxSS+m4O7lZwav8sUuXuArMQvcWXTJN?= =?us-ascii?Q?lA8PQA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a532a5fb-dbac-47c3-dd71-08db5c3802df X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 09:19:44.1080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j+UKJ4CfP4AVH2osVxIu4zUsZcxVUyY3HDmnTWatGC5jT3E5IIPqN3Yu1Ztek6fBvMTzoMDDAdkHwC6JpGlCdG8gvMcKtAxJmt+EPoC/vz0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3642 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23, 2023 at 02:53:44PM -0700, Justin Chen wrote: > Add support for the Broadcom ASP 2.0 Ethernet controller which is first > introduced with 72165. This controller features two distinct Ethernet > ports that can be independently operated. > > This patch supports: > > - Wake-on-LAN using magic packets > - basic ethtool operations (link, counters, message level) > - MAC destination address filtering (promiscuous, ALL_MULTI, etc.) > > Signed-off-by: Florian Fainelli > Signed-off-by: Justin Chen Hi Justin, Reviewed-by: Simon Horman As I see there will be a v5 I have added a few nits from my side. Feel free to ignore them as you see fit. ... > +int bcmasp_netfilt_check_dup(struct bcmasp_intf *intf, > + struct ethtool_rx_flow_spec *fs) nit: the return type of this function could be bool > +{ > + struct bcmasp_priv *priv = intf->parent; > + struct ethtool_rx_flow_spec *cur; > + size_t fs_size = 0; > + int i; > + > + for (i = 0; i < NUM_NET_FILTERS; i++) { > + if (!priv->net_filters[i].claimed || > + priv->net_filters[i].port != intf->port) > + continue; > + > + cur = &priv->net_filters[i].fs; > + > + if (cur->flow_type != fs->flow_type || > + cur->ring_cookie != fs->ring_cookie) > + continue; > + > + switch (fs->flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) { > + case ETHER_FLOW: > + fs_size = sizeof(struct ethhdr); > + break; > + case IP_USER_FLOW: > + fs_size = sizeof(struct ethtool_usrip4_spec); > + break; > + case TCP_V6_FLOW: > + case UDP_V6_FLOW: > + fs_size = sizeof(struct ethtool_tcpip6_spec); > + break; > + case TCP_V4_FLOW: > + case UDP_V4_FLOW: > + fs_size = sizeof(struct ethtool_tcpip4_spec); > + break; > + default: > + continue; > + } > + > + if (memcmp(&cur->h_u, &fs->h_u, fs_size) || > + memcmp(&cur->m_u, &fs->m_u, fs_size)) > + continue; > + > + if (cur->flow_type & FLOW_EXT) { > + if (cur->h_ext.vlan_etype != fs->h_ext.vlan_etype || > + cur->m_ext.vlan_etype != fs->m_ext.vlan_etype || > + cur->h_ext.vlan_tci != fs->h_ext.vlan_tci || > + cur->m_ext.vlan_tci != fs->m_ext.vlan_tci || > + cur->h_ext.data[0] != fs->h_ext.data[0]) > + continue; > + } > + if (cur->flow_type & FLOW_MAC_EXT) { > + if (memcmp(&cur->h_ext.h_dest, > + &fs->h_ext.h_dest, ETH_ALEN) || > + memcmp(&cur->m_ext.h_dest, > + &fs->m_ext.h_dest, ETH_ALEN)) > + continue; > + } > + > + return 1; > + } > + > + return 0; > +} ... > +static int bcmasp_is_port_valid(struct bcmasp_priv *priv, int port) > +{ > + /* Quick sanity check > + * Ports 0/1 reserved for unimac > + * Max supported ports is 2 > + */ > + return (port == 0 || port == 1); nit: unnecessary parentheses > +} ...