Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp950827pxb; Wed, 3 Nov 2021 15:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaNpJiAlty+RtUvSXy95YJJmDFjOOOI5LkmRqRgpLite7roB05DBehPKSqlmg+dPjieBva X-Received: by 2002:a05:6402:40d0:: with SMTP id z16mr34914827edb.340.1635978323275; Wed, 03 Nov 2021 15:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635978323; cv=none; d=google.com; s=arc-20160816; b=rgMaJClPd6ZMqDDkTtNF8Jnu3x5xMbMEbw1zKyXBmhyH90+Ia1nzAuALQ7sPOpxdLO vqwFMNDzAzUFOBgwNsZxBx2Bz7QlzEN23ElnIKqHBW8nywl1dVchkxpV0yobgcNG3dCZ FtNEjS7aho4lkpsbW/xrGPEnyp6OQG02bviMOImjcF2jCgo4FrApJtLk8Gcg5RNToue3 DxnO9pEYi4EX+Cim5Pd7PgSZ+sQNALJEgrj7vr9iseoeVlU+5yVUqD9AV4HyWvJMr8PQ OU1yDQ7jSmfDhpm+pcahNhZ5H10fdnAwFJ4izq1qeTHhzQrBx+MO7oQZInYzXOjfllvz qtOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=nPRWGwf0M5iXxJZ1q+xhIqLjuZmGolgtAVobYVmw5cY=; b=JLhUFmfbw3Z5OXqKW6cMLjhqsnSBzF3sikGrl68TODOyTb10BQ2lMQOFxrL2szFlPY cBlMDonn1Wym2eZm77NmYZM3Xyba2gw4XBeUVeAbQoEsz6Hk3l5yNOzK8y2zMGudLFjP CwimKsybDvKq5iIvcKboo9U84z8sQCOIgsMo1EMOUyRE9W0Rxit3W2VveLq00SYMn72c hTZGMk0/yP237DYmClCeWQ91eZVNHfnbE+qIMcRoa2zcBgUoLlWDGJFeuhVFVIlE3fw4 Nlc11Quhyw0EWd7GSmDTke12jWekZMd7RI17fQFGC6H/XUcZYrC6IHwdztPMQ149hxYy Ma8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kEn0LCl7; 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 qa41si6755838ejc.612.2021.11.03.15.24.58; Wed, 03 Nov 2021 15:25:23 -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=kEn0LCl7; 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 S230229AbhKCWXi (ORCPT + 99 others); Wed, 3 Nov 2021 18:23:38 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:58944 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbhKCWXh (ORCPT ); Wed, 3 Nov 2021 18:23:37 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 1A3MKkL0051391; Wed, 3 Nov 2021 17:20:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1635978046; bh=nPRWGwf0M5iXxJZ1q+xhIqLjuZmGolgtAVobYVmw5cY=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=kEn0LCl7vY9bkeWj74VZ4GAhwrhpeS6IAcpXAskAKqO3a3npyMNXKL+nAKRVtm3+w ciO4jcHfXfKc2aoSTm6qqNBiJAXc6xI6U8czsJu7mnukgkUsY9L3sdautyj/EFhoXb wcmfeBN66p4pevQz3qGYyqnyokvsTQ9HY44boXk4= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 1A3MKkQj028821 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 3 Nov 2021 17:20:46 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 3 Nov 2021 17:20:45 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Wed, 3 Nov 2021 17:20:45 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 1A3MKgiX122125; Wed, 3 Nov 2021 17:20:43 -0500 Subject: Re: [PATCH net-next v2 2/3] net: ethernet: ti: am65-cpsw: enable bc/mc storm prevention support To: Jakub Kicinski CC: "David S. Miller" , , , Kishon Vijay Abraham I , Vignesh Raghavendra , , Tony Lindgren , Andrew Lunn , Vladimir Oltean References: <20211101170122.19160-1-grygorii.strashko@ti.com> <20211101170122.19160-3-grygorii.strashko@ti.com> <20211102173840.01f464ec@kicinski-fedora-PC1C0HJN> From: Grygorii Strashko Message-ID: <81a427a1-b969-4039-0c3f-567b3073abc1@ti.com> Date: Thu, 4 Nov 2021 00:20:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211102173840.01f464ec@kicinski-fedora-PC1C0HJN> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi Jakub, On 03/11/2021 02:38, Jakub Kicinski wrote: > On Mon, 1 Nov 2021 19:01:21 +0200 Grygorii Strashko wrote: >> - 01:00:00:00:00:00 fixed value has to be used for MC packets rate >> limiting (exact match) > > This looks like a stretch, why not use a mask? You can require users to > always install both BC and MC rules if you want to make sure the masked > rule does not match BC. > Those matching rules are hard coded in HW for packet rate limiting and SW only enables them and sets requested pps limit. - 1:BC: HW does exact match on BC MAC address - 2:MC: HW does match on MC bit (the least-significant bit of the first octet) Therefore the exact match done in this patch for above dst_mac's with is_broadcast_ether_addr() and ether_addr_equal(). The K3 cpsw also supports number configurable policiers (bit rate limit) in ALE for which supports is to be added, and for them MC mask (sort of, it uses number of ignored bits, like FF-FF-FF-00-00-00) can be used. -- Best regards, grygorii