From patchwork Tue May 14 20:18:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 1099697 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=solarflare.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 453TXD46cVz9s4Y for ; Wed, 15 May 2019 06:18:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbfENUST (ORCPT ); Tue, 14 May 2019 16:18:19 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:38124 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbfENUST (ORCPT ); Tue, 14 May 2019 16:18:19 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id A386C340133; Tue, 14 May 2019 20:18:17 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 May 2019 13:18:14 -0700 From: Edward Cree Subject: [PATCH net 1/2] flow_offload: support CVLAN match To: David Miller CC: Jiri Pirko , Pablo Neira Ayuso , , Jianbo Liu References: <6ba9ac10-411c-aa04-a8fc-f4c7172fa75e@solarflare.com> Message-ID: <852c7843-0b97-3352-3bfd-23d074ceae7d@solarflare.com> Date: Tue, 14 May 2019 21:18:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6ba9ac10-411c-aa04-a8fc-f4c7172fa75e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24612.005 X-TM-AS-Result: No-1.547900-4.000000-10 X-TMASE-MatchedRID: lnut831UkvCtIop/D9Co1T8Ckw9b/GFeTJDl9FKHbrkKA2OoGAlTk8bb 06Xu0adr4vM1YF6AJbZFi+KwZZttL42j49Ftap9Eymsk/wUE4hpbPkJPLKY8y97KoO8fPZbh5Ci 1WhaQ/FHsTzAzOZF2uu5BV3JhGvsZ924FCF2f8bWXrRIM/ThybDfE0kJ44HXYQHNaOvpj9ANdcF XkHCaP10ODDY5/BuEsoxrk6Q2mIeSJ+wv7oJjhGWXfFD5fdmZR X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.547900-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24612.005 X-MDID: 1557865098-GBlpaTSiHb1R Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Plumb it through from the flow_dissector. Signed-off-by: Edward Cree --- include/net/flow_offload.h | 2 ++ net/core/flow_offload.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 6200900434e1..a2df99f9b196 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -71,6 +71,8 @@ void flow_rule_match_eth_addrs(const struct flow_rule *rule, struct flow_match_eth_addrs *out); void flow_rule_match_vlan(const struct flow_rule *rule, struct flow_match_vlan *out); +void flow_rule_match_cvlan(const struct flow_rule *rule, + struct flow_match_vlan *out); void flow_rule_match_ipv4_addrs(const struct flow_rule *rule, struct flow_match_ipv4_addrs *out); void flow_rule_match_ipv6_addrs(const struct flow_rule *rule, diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index c3a00eac4804..5ce7d47a960e 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -54,6 +54,13 @@ void flow_rule_match_vlan(const struct flow_rule *rule, } EXPORT_SYMBOL(flow_rule_match_vlan); +void flow_rule_match_cvlan(const struct flow_rule *rule, + struct flow_match_vlan *out) +{ + FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_CVLAN, out); +} +EXPORT_SYMBOL(flow_rule_match_cvlan); + void flow_rule_match_ipv4_addrs(const struct flow_rule *rule, struct flow_match_ipv4_addrs *out) { From patchwork Tue May 14 20:18:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Cree X-Patchwork-Id: 1099698 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=solarflare.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 453TXy6b9lz9sNm for ; Wed, 15 May 2019 06:18:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbfENUS5 (ORCPT ); Tue, 14 May 2019 16:18:57 -0400 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:33778 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfENUS5 (ORCPT ); Tue, 14 May 2019 16:18:57 -0400 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 2959F140079; Tue, 14 May 2019 20:18:56 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 14 May 2019 13:18:52 -0700 From: Edward Cree Subject: [PATCH net 2/2] net/mlx5e: Fix calling wrong function to get inner vlan key and mask To: David Miller CC: Jiri Pirko , Pablo Neira Ayuso , , Jianbo Liu References: <6ba9ac10-411c-aa04-a8fc-f4c7172fa75e@solarflare.com> Message-ID: Date: Tue, 14 May 2019 21:18:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6ba9ac10-411c-aa04-a8fc-f4c7172fa75e@solarflare.com> Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24612.005 X-TM-AS-Result: No-1.010300-4.000000-10 X-TMASE-MatchedRID: jW2Old1ajwAMiQrcTwX2Aao2fOuRT7aaDyV2oSIWznIda1Vk3RqxOBFA +ewA1AiF/279qGcpzeaUgjpAAuN4mDZxjkmratY+sFkCLeeufNs1X1Ls767cpmMunwKby/AXCh5 FGEJlYgEjlKSXhxkO7JscC5DV1Se5YlldA0POS1IaPMGCcVm9Do7BlHEYXpfjmyiLZetSf8nJ4y 0wP1A6AEl4W8WVUOR/9xS3mVzWUuBUNjjpwwGmR8FtawVESjpsHUz9y2k2/w0cWghBv5g1hN7LZ nsFqnRFEf4CCoVWr9UuoRx21TJF4keUT1zqRwpk9uH9CNWhT1Ef+z3G/93kgxoQVhcDKUH1JRIz mbBpwaQgJCm6ypGLZ6Ol5oRXyhFEWoC08z/YUWKUTGVAhB5EbQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-1.010300-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24612.005 X-MDID: 1557865136-ps3cNgOXstbq Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jianbo Liu When flow_rule_match_XYZ() functions were first introduced, flow_rule_match_cvlan() for inner vlan is missing. In mlx5_core driver, to get inner vlan key and mask, flow_rule_match_vlan() is just called, which is wrong because it obtains outer vlan information by FLOW_DISSECTOR_KEY_VLAN. This commit fixes this by changing to call flow_rule_match_cvlan() after it's added. Fixes: 8f2566225ae2 ("flow_offload: add flow_rule and flow_match structures and use them") Signed-off-by: Jianbo Liu Signed-off-by: Edward Cree --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 122f457091a2..542354b5eb4d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1595,7 +1595,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN)) { struct flow_match_vlan match; - flow_rule_match_vlan(rule, &match); + flow_rule_match_cvlan(rule, &match); if (match.mask->vlan_id || match.mask->vlan_priority || match.mask->vlan_tpid) {