From patchwork Mon Mar 6 23:05:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cabaj X-Patchwork-Id: 1752821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=o8Xlih20; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PVvMF4ws6z1yWw for ; Tue, 7 Mar 2023 10:06:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pZJtz-0007E7-TE; Mon, 06 Mar 2023 23:05:55 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pZJtx-0007DT-VT for kernel-team@lists.ubuntu.com; Mon, 06 Mar 2023 23:05:53 +0000 Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B6A013F828 for ; Mon, 6 Mar 2023 23:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678143953; bh=fFNmftvqb0tctAySenFVHDxnl4HMrBCQyiVkAXJKK+M=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=o8Xlih20ZiIC4o8YvHW9gkUkWIBcZMayoPn8GDqfhhBS128GEwbBSP1ayYfqjkdpM AaqhjASeLizZGJ94lEkdtc+K+J/nWRhlOwzgqEOsCamGeQeSOO/SiXmax+ybut0MpH e/uG7LaUkuCTubdp3wy9i/cuBrsz/9eY1M1GXwsngryIsagcrmkx4YFCOyKr10wloF F5X/ukhGwq8gi1NsVQjr7N/BiNvI1qDRWEjKhdD2mqsXBBrmWUIX/DBjWoy1Rcp/hP 6zvKuG0hXXBmPJRjWW7+5w223RqSpflQ+BzYWeqLJf3lk5vKN0lIMUSMpS3KcGIf1m UDFL/6638YlVg== Received: by mail-il1-f199.google.com with SMTP id y2-20020a929502000000b0031707c6b348so6098400ilh.8 for ; Mon, 06 Mar 2023 15:05:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678143952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fFNmftvqb0tctAySenFVHDxnl4HMrBCQyiVkAXJKK+M=; b=jYiBrlsmMBfL0vEb+WRNc6wgi0ywgCJuMWJv3qknjPG+Q6I8XG9WVFCajBe96oa+z0 PAg7vK3JDJNTTyqxv3n3MoCoBEflG8N9Ty9j2/2i4T8b0JZQcokpc0fidfI1aV95bGZN xkCPtfjo+KkmgtFOnLL/HI6m0RzEj+hxznG9Ecz2I0aE1QRpFaGVeIHQmI5hqAlCDtMr noXJxCgJTQSmdU+VEc/dH0ggzP8xxXbzaz+2QhP86xDs06wOLkulL3mLWdrMBUclnVLu 8gwK85mJ2IZSdDhYAr/XMU2Nunzpt4HJ5EY3HNnojjUnhPo9UNvz95JMLAVIV9+uXS0Z ZrQQ== X-Gm-Message-State: AO0yUKX2ywwHzqdSnRPhz0H1hLyh3qvL3o3hK2zaO5qOcpAQ9ckqJbqY 7NJcvXDfVTRWXhV2+DwyL0krs4fkOQoIogYnhhXZyVhaBUKORwT675UX+UNMAmbB8a0GZGme09D lWhF0hJmLdzgLNDdzfriMqjxmjhOcE9aKqdR8mlCXBfBRDIXXLg== X-Received: by 2002:a05:6e02:2189:b0:317:93dc:110f with SMTP id j9-20020a056e02218900b0031793dc110fmr10327233ila.6.1678143952300; Mon, 06 Mar 2023 15:05:52 -0800 (PST) X-Google-Smtp-Source: AK7set/RGpTHZFjN397purIg3AELac+2qj4cxOh26a5HInqcz+yuCDhcprMS9Z1Urep6ASpv5ISSFg== X-Received: by 2002:a05:6e02:2189:b0:317:93dc:110f with SMTP id j9-20020a056e02218900b0031793dc110fmr10327220ila.6.1678143951968; Mon, 06 Mar 2023 15:05:51 -0800 (PST) Received: from smtp.gmail.com (h69-130-246-116.mdtnwi.broadband.dynamic.tds.net. [69.130.246.116]) by smtp.gmail.com with ESMTPSA id o15-20020a056e02068f00b003152eec4057sm3191771ils.27.2023.03.06.15.05.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 15:05:51 -0800 (PST) From: John Cabaj To: kernel-team@lists.ubuntu.com Subject: [SRU][jammy][PATCH 1/1] net/mlx5e: Set action fwd flag when parsing tc action goto Date: Mon, 6 Mar 2023 17:05:50 -0600 Message-Id: <20230306230550.65625-2-john.cabaj@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230306230550.65625-1-john.cabaj@canonical.com> References: <20230306230550.65625-1-john.cabaj@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Roi Dayan BugLink: https://canonical.lightning.force.com/lightning/r/Case/5004K00000TKB4OQAX/view (Pickup upstream mlx patch to Ubuntu 22.04 ibm-gt kernel) Do it when parsing like in other actions instead of when checking if goto is supported in current scenario. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed (cherry picked from commit 7f8770c71646cf93abdf3fea8b7733aaec4c82a3) Signed-off-by: John Cabaj --- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index f92105834e12..c504c0f24005 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3672,7 +3672,8 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv, if (err) return err; - action |= MLX5_FLOW_CONTEXT_ACTION_COUNT; + action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | + MLX5_FLOW_CONTEXT_ACTION_COUNT; attr->dest_chain = act->chain_index; break; case FLOW_ACTION_CT: @@ -3707,12 +3708,9 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv, attr->action = action; - if (attr->dest_chain) { - if (attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) { - NL_SET_ERR_MSG(extack, "Mirroring goto chain rules isn't supported"); - return -EOPNOTSUPP; - } - attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; + if (attr->dest_chain && parse_attr->mirred_ifindex[0]) { + NL_SET_ERR_MSG(extack, "Mirroring goto chain rules isn't supported"); + return -EOPNOTSUPP; } if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) @@ -4329,7 +4327,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, if (err) return err; - action |= MLX5_FLOW_CONTEXT_ACTION_COUNT; + action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | + MLX5_FLOW_CONTEXT_ACTION_COUNT; attr->dest_chain = act->chain_index; break; case FLOW_ACTION_CT: @@ -4409,24 +4408,18 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, if (!actions_match_supported(priv, flow_action, parse_attr, flow, extack)) return -EOPNOTSUPP; - if (attr->dest_chain) { - if (decap) { - /* It can be supported if we'll create a mapping for - * the tunnel device only (without tunnel), and set - * this tunnel id with this decap flow. - * - * On restore (miss), we'll just set this saved tunnel - * device. - */ - - NL_SET_ERR_MSG(extack, - "Decap with goto isn't supported"); - netdev_warn(priv->netdev, - "Decap with goto isn't supported"); - return -EOPNOTSUPP; - } + if (attr->dest_chain && decap) { + /* It can be supported if we'll create a mapping for + * the tunnel device only (without tunnel), and set + * this tunnel id with this decap flow. + * + * On restore (miss), we'll just set this saved tunnel + * device. + */ - attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; + NL_SET_ERR_MSG(extack, "Decap with goto isn't supported"); + netdev_warn(priv->netdev, "Decap with goto isn't supported"); + return -EOPNOTSUPP; } if (esw_attr->split_count > 0 && !mlx5_esw_has_fwd_fdb(priv->mdev)) {