Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3877702ybi; Tue, 18 Jun 2019 07:56:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9pxTdcOxTzYLdx5/6UFy+0CuvEzbDKp+22vsw3qomdsAnx3bEaRlGuJJxrFiMFcn8t0ep X-Received: by 2002:a17:90a:7f02:: with SMTP id k2mr5625100pjl.78.1560869763004; Tue, 18 Jun 2019 07:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560869762; cv=none; d=google.com; s=arc-20160816; b=L7a20o9tCi0RtFbWxuJJ5jjieaIXefzw1XqA81CRumKNaE6C8uORrl+3FvlcrVyoWf 2UAvjlfNA8uq8TRd0iAyeuI0Hm96GJxFwtlxALecYfKzL3sGcUoZcdCxZNzMNG3+4EED WCATaPR94dGSLvFTVOIWhaqWlp5IOgCmxOf/X5Ekuba5tYcjZ4iqOjd/BfpPzfBLKwqS h4E92723gQ7aXbSGgoZABQKv1yUXZp8E07h9X30DIaz9BJoxoUWmMhqze1Kua8Vg94r1 +5Mv4pQM4GGBzj86NiQGl2+xuWwvqk5rI0V971FTzSXjBIEF83GMitedfNd7W/cjzLXP sW/w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0R0NrIQLVdvlh/dhX+KTXGCVuvRDw561vR6Z986KU0E=; b=tTUigoTD0W2BQgvg0NAPGpag5cKPNiucVbkAQUMcdzcUuaOSVsJ+CLPUL3w+ssQIvu 6t29LSEVfKI9Js3HSjDYJ58LDWrj00Qi45W+UM1igxuhLr38QPxFuRg44i7tAyfM/M/h UVdTQhIPQEyawUiX4qJggcxzDwzQYWIFxI6Ka/rm/EysiRIJ5Kd/MXuoTa0JzJpVAw1t AS7x0LX7GdRVu8MeaHZazXplBtTuXuaKNY8rZc8U7vPmBiPI3tL4w3cdE5okt9VBRCLG /af2M0fU2xc3oSedsUgCS6nEts/zB4+iZLqrIgUtlAsN24KhgYFRS5Ik3GvXcAh16925 7pfQ== 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 r185si387136pgr.10.2019.06.18.07.55.47; Tue, 18 Jun 2019 07:56:02 -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 S1729642AbfFROze (ORCPT + 99 others); Tue, 18 Jun 2019 10:55:34 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55089 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729594AbfFROzc (ORCPT ); Tue, 18 Jun 2019 10:55:32 -0400 X-Originating-IP: 90.88.23.150 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-81-150.w90-88.abo.wanadoo.fr [90.88.23.150]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 5309240014; Tue, 18 Jun 2019 14:55:28 +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, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 2/4] net: mvpp2: cls: Only select applicable flows of classification offload Date: Tue, 18 Jun 2019 16:55:17 +0200 Message-Id: <20190618145519.27705-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618145519.27705-1-maxime.chevallier@bootlin.com> References: <20190618145519.27705-1-maxime.chevallier@bootlin.com> 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 The way we currently handle classification offload and RSS is by having dedicated lookup sequences in the flow table, each being selected depending on several fields being present in the packet header. We need to make sure the classification operation we want to perform can be done in each flow we want to insert it into. As an example, classifying on VLAN tag can only be done on flows used for tagged traffic. This commit makes sure we don't insert rules in flows we aren't compatible with. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index 8af13316ecb1..7cd9d6da0319 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1201,6 +1201,9 @@ static int mvpp2_port_flt_rfs_rule_insert(struct mvpp2_port *port, if (!flow) return 0; + if ((rule->hek_fields & flow->supported_hash_opts) != rule->hek_fields) + continue; + index = MVPP2_CLS_FLT_C2_RFS(port->id, flow->flow_id, rule->loc); mvpp2_cls_flow_read(priv, index, &fe); -- 2.20.1