Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2661598imj; Mon, 11 Feb 2019 06:38:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IaP4uSY9LSwhY7ZPgCBOqCM49eVfDrSzpa00pk/IgL5NBqwzqh0FKu5+xr/wRvsHkblFszA X-Received: by 2002:a62:6f49:: with SMTP id k70mr36717210pfc.7.1549895914870; Mon, 11 Feb 2019 06:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895914; cv=none; d=google.com; s=arc-20160816; b=I91KAWFLN7Z4Y4TDOX+iWrPJ8uot0EkohKes7wBG0N9d/xa6DXq25HTZ53pA53PzAy Zjvk8pAqmhsENqZIODC7VJCIXPu7j9pQjuHikMZrTU4eUILniYENDYk3NgdxEeYChUDo CmFiIrpCKX97xwqjVSVCYgT1R9TsQM6DEEFCNvzNeKd37tzraZH4/Pn5jJhm6WM4Gl0r zWsMujKx4Jh9JlUwTAZetcRBvzu/kVwkCkEVxLk31ae3aYYdy2F70gLNRiSiEDyy4mv1 xS7dtfnFWIu//bAMnpjCOZFQfVfdT0EpJ1H74QFWIUrCPDHDowSkxE1U7mQyW703/xM6 TDQw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sA6vzkmbxt7z1mw4Kux8O6K3gswIXjgC+Se7PaP15M4=; b=qEAH5eoOytf8F6RbHlUvvl2gdlxJvr7OmpMllkYhttcLZnpjgu1bIzj4A6KIKk5uo+ pqsNkbp2Y8ln19XhkoUugtRvB6L0tsBvFTdD99NjvDKObw9FpzmZ7pPfLsLr53FUUY39 PaqvmvZComQ6OMS8Rpt0Ui4HhJteVDMw0I9VllLjvuV4BkL/iu0RhpseIxK83jl7NUwc 2gCH7NXPzxaOowdrR3MpFOcc+5NsB0+8V8JTB/eL4yzb2n5ytKt1fwmeKPw7aR3rf0za n49t2v66teGrZin+wadFiN3twRV2tizmpZWaqbInF4zG+QacjHmjJZvvh1BDgqsooHKq MNlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ggiDpG1p; 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 t22si1977414pga.463.2019.02.11.06.38.18; Mon, 11 Feb 2019 06:38:34 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ggiDpG1p; 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 S1731459AbfBKOha (ORCPT + 99 others); Mon, 11 Feb 2019 09:37:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:46810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731445AbfBKOh1 (ORCPT ); Mon, 11 Feb 2019 09:37:27 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D441B20700; Mon, 11 Feb 2019 14:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895846; bh=+6X3NTbqlSpjZME1/xm6n/Ck4+VDlGa8gAD4BEsUMc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ggiDpG1p3Bgs9rJIru9G/JjTGlCLaqSRjGJvrBx+Rm5VsTvvrwAcWcXNEdNJ0y7O7 kGBLfMyiLNzPtP5PO6x4sFB/CF4PJ+cU+IWcIur4osq2ID8MGDLpzDOFZ2FKeayJUa 31YsNTw5q6eRWB/oHtIluqAg4PHU8BcADGW2V59w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guy Shattah , Or Gerlitz , Saeed Mahameed Subject: [PATCH 4.20 311/352] net/mlx5e: Use the inner headers to determine tc/pedit offload limitation on decap flows Date: Mon, 11 Feb 2019 15:18:58 +0100 Message-Id: <20190211141906.620299354@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guy Shattah [ Upstream commit 1651925d403e077e3fc86f961905e27c6810e132 ] In packets that need to be decaped the internal headers have to be checked, not the external ones. Fixes: bdd66ac0aeed ("net/mlx5e: Disallow TC offloading of unsupported match/action combinations") Signed-off-by: Guy Shattah Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2133,6 +2133,7 @@ static bool csum_offload_supported(struc static bool modify_header_match_supported(struct mlx5_flow_spec *spec, struct tcf_exts *exts, + u32 match_actions, struct netlink_ext_ack *extack) { const struct tc_action *a; @@ -2143,7 +2144,11 @@ static bool modify_header_match_supporte u16 ethertype; int nkeys, i; - headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers); + if (match_actions & MLX5_FLOW_CONTEXT_ACTION_DECAP) + headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, inner_headers); + else + headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers); + ethertype = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ethertype); /* for non-IP we only re-write MACs, so we're okay */ @@ -2200,7 +2205,7 @@ static bool actions_match_supported(stru if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) return modify_header_match_supported(&parse_attr->spec, exts, - extack); + actions, extack); return true; }