Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4901259yba; Tue, 30 Apr 2019 06:16:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRhjiw5jr+HwoZyVM23Wj+LEStjlYRtO00aWKADsHWtMHYzP2KrdfshT9X4eZ/EzgWYOGD X-Received: by 2002:a62:1a8b:: with SMTP id a133mr19471800pfa.87.1556630164358; Tue, 30 Apr 2019 06:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556630164; cv=none; d=google.com; s=arc-20160816; b=WjhwKpHSOeY8Vaq1yOAjMdLtE+j3QY1Uj5mzqaAlOy6ZzRrTKWDFogJvcA/3cgxTB2 WD8/7EjLR+4HqBqRis2H0C1S+ue9y2CFJmCTySpncYUtQH6rHesMEo6I7u/OJOEf6hJB +qFGrVLO4xBLLzHZY++jsGuLmPuej8lFksvoq8QWHG6HrTQzt9FqF4EYNiIr5V4Lk1pB /TjRMwcyNvCciIQRPoca5/EvvhY67OW35Z47Z6F/2ihNhGa7BcMwmtjItASK0HiXxXm9 IVIS4Cbi5lxgoIYRv8w8CoZfdkyDkqeImCR1RO9TrAM5IRtu/6xPEXpHOUkSB8yUEy18 6JAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UgbJSbCPjegjjyx6I6tkVwYx1p5/vT69VNcdjVdkb9s=; b=ui7zQOCgyCxzBvSR7jnujhFmWWrqE359t7Htv5cVC+3/kMyXqC57Jddmdkw4W3th2s Ii+i9TkenO2fwqHNIa+ERUIejrXzxJ5P6vrpo9XUCy+QQ1UlR1M0V9nfXXwrdjk9qgXr f/LNqxTULKXcJook4e9NSr2JCLnY2H5X1RxSFM7E+VkQUjPhms1OtINpBg6LWLlGnFZo UQbqUXT0QpAvJQy/2DKgb4O5baDLBo9W6/odbGSTm/bYfgIGL+uvkjVwO8EaqqFxPXOf jkJ1nxbYrXwm68LBYw30F5GoddbwWz/Op3hOGzFttzTjHD1IONafeMT3vFTeDh3zfQVK wdTQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si24136288pgv.51.2019.04.30.06.15.45; Tue, 30 Apr 2019 06:16:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbfD3NOj (ORCPT + 99 others); Tue, 30 Apr 2019 09:14:39 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:50035 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbfD3NOj (ORCPT ); Tue, 30 Apr 2019 09:14:39 -0400 X-Originating-IP: 90.88.149.145 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-29-145.w90-88.abo.wanadoo.fr [90.88.149.145]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 2F8581BF20C; Tue, 30 Apr 2019 13:14:34 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com, Russell King , linux-arm-kernel@lists.infradead.org, Saeed Mahameed , Jakub Kicinski Subject: [PATCH net-next 0/4] net: mvpp2: cls: Add classification Date: Tue, 30 Apr 2019 15:14:25 +0200 Message-Id: <20190430131429.19361-1-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everyone, This series is a rework of the previously standalone patch adding classification support for mvpp2 : https://lore.kernel.org/netdev/20190423075031.26074-1-maxime.chevallier@bootlin.com/ This patch has been reworked according to Saeed's review, to make sure that the location of the rule is always respected and serves as a way to prioritize rules between each other. This the 3rd iteration of this submission, but since it's now a series, I reset the revision numbering. This series implements that in a limited configuration for now, since we limit the total number of rules per port to 4. The main factors for this limitation are that : - We share the classification tables between all ports (4 max, although one is only used for internal loopback), hence we have to perform a logical separation between rules, which is done today by dedicated ranges for each port in each table - The "Flow table", which dictates which lookups operations are performed for an ingress packet, in subdivided into 22 "sub flows", each corresponding to a traffic type based on the L3 proto, L4 proto, the presence or not of a VLAN tag and the L3 fragmentation. This makes so that when adding a rule, it has to be added into each of these subflows, introducing duplications of entries and limiting our max number of entries. These limitations can be overcomed in several ways, but for readability sake, I'd rather submit basic classification offload support for now, and improve it gradually. This series also adds a small cosmetic cleanup patch (1), and also adds support for the "Drop" action compared to the first submission of this feature. It is simple enough to be added with this basic support. Compared to the first submissions, the NETIF_F_NTUPLE flag was also removed, following Saeed's comment. Thanks, Maxime Maxime Chevallier (4): net: mvpp2: cls: Remove extra whitespace in mvpp2_cls_flow_write net: mvpp2: cls: Use a bitfield to represent the flow_type net: mvpp2: cls: Add Classification offload support net: mvpp2: cls: Allow dropping packets with classification offload drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 42 ++ .../net/ethernet/marvell/mvpp2/mvpp2_cls.c | 497 +++++++++++++++--- .../net/ethernet/marvell/mvpp2/mvpp2_cls.h | 70 ++- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 20 +- 4 files changed, 545 insertions(+), 84 deletions(-) -- 2.20.1