Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2734721pxj; Mon, 31 May 2021 09:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxb/AyOTKwrC4JFa/1LrWDZmxyQGctFMj0xK9PonHPVM7nOu47E0h7h5tgoEm1jBFLrBM8 X-Received: by 2002:a6b:6016:: with SMTP id r22mr2011413iog.47.1622478240006; Mon, 31 May 2021 09:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622478239; cv=none; d=google.com; s=arc-20160816; b=qEE0WWQqL4TeF7HrB425Q+bwKBsUbcG9JHsjney6nVi1uprjfSosmLj9snfDo/gjzL YuwLo7kMv+9Lx0i8Rq0Kh4EKQw0yKNFFcZbivAnJys6FJJucF5CRyEuiGyt4EXxxr5Pr 4lT1xr2Yi4c3EU9swQjfyD99MEj6y1K6YraAOUWqn4U3sO2t90WWmeXl9DiAm/ciBVqK rom4oMobZm5AU71l4ixKudgrqC3EgtP5zQp7y5DjH2XnmsXP5T6XGcigteu/slZsFWL3 tJmwYlmNvCcH0gbyFzkgUTto3MhBbyBt3aJC7ZZKWBLvAirgOvYoZ44z4oOstDHTs37l wG3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j4aPgj3HzDnSQaLulWMDMbXJDDCtHmE/6tE9pNxcq/8=; b=mHgvPVMUdRL0PvOndFNqCPi6+7FXUhcJd0UEwiq6hGx1NO9Xt8fTmlWLDaoh3aAjgW nOCsVtNrhN1ygqDZLrLKJSqt9Hd+Qq6MszZ4gqUK0hOZYNIeecUVMyQhMJJyex52eUo4 WkWizhdq4XeY0/NJfFfJKUr/0SexHRmyUwkz3Qlm7fHes/2WEHSJwfdY+dZa/DhRvs6y w++dWO/iOpU5Xltn0LSuhdCUX42W3Zv1SNlfAAIRLMQpv2halgfrTCMBfE/ZKGrEpCc7 PTX2mV+I8wpnLBR4kZ3pL56aLNfGYv4dBQeheR8vCVJWFqzepoTnJLhkjUvZYup+EPZu aBMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DzSMAf/N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si12803338ilq.4.2021.05.31.09.23.46; Mon, 31 May 2021 09:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DzSMAf/N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234723AbhEaQYc (ORCPT + 99 others); Mon, 31 May 2021 12:24:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233184AbhEaOnd (ORCPT ); Mon, 31 May 2021 10:43:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5243C613B9; Mon, 31 May 2021 13:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469257; bh=b6pxLm9b+aHmQ8leoDa2uMcseGzhDvHezK5XJWEJodM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DzSMAf/Na7J+8L/E5gF6sXT8GNtAJl4+Lue/dF1qIGtzWEO7wghG7EsLxAjebJPn2 uJ7pEM8O+46sPrH0LxQ51o3Bj47cZaDBgVjYSRy14V9KyOFkpPTGuPGseBgofanLLi DGn74r9BqEPVcwyj3oQOf0p2/o6GkSwouKZMHt8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ariel Levkovich Subject: [PATCH 5.12 128/296] net/mlx5: Set term table as an unmanaged flow table Date: Mon, 31 May 2021 15:13:03 +0200 Message-Id: <20210531130708.200759345@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ariel Levkovich commit 6ff51ab8aa8fcbcddeeefce8ca705b575805d12b upstream. Termination tables are restricted to have the default miss action and cannot be set to forward to another table in case of a miss. If the fs prio of the termination table is not the last one in the list, fs_core will attempt to attach it to another table. Set the unmanaged ft flag when creating the termination table ft and select the tc offload prio for it to prevent fs_core from selecting the forwarding to next ft miss action and use the default one. In addition, set the flow that forwards to the termination table to ignore ft level restrictions since the ft level is not set by fs_core for unamanged fts. Fixes: 249ccc3c95bd ("net/mlx5e: Add support for offloading traffic from uplink to uplink") Signed-off-by: Ariel Levkovich Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c @@ -76,10 +76,11 @@ mlx5_eswitch_termtbl_create(struct mlx5_ /* As this is the terminating action then the termination table is the * same prio as the slow path */ - ft_attr.flags = MLX5_FLOW_TABLE_TERMINATION | + ft_attr.flags = MLX5_FLOW_TABLE_TERMINATION | MLX5_FLOW_TABLE_UNMANAGED | MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT; - ft_attr.prio = FDB_SLOW_PATH; + ft_attr.prio = FDB_TC_OFFLOAD; ft_attr.max_fte = 1; + ft_attr.level = 1; ft_attr.autogroup.max_num_groups = 1; tt->termtbl = mlx5_create_auto_grouped_flow_table(root_ns, &ft_attr); if (IS_ERR(tt->termtbl)) { @@ -216,6 +217,7 @@ mlx5_eswitch_termtbl_required(struct mlx int i; if (!MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, termination_table) || + !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ignore_flow_level) || attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH || !mlx5_eswitch_offload_is_uplink_port(esw, spec)) return false; @@ -288,6 +290,7 @@ mlx5_eswitch_add_termtbl_rule(struct mlx /* create the FTE */ flow_act->action &= ~MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT; flow_act->pkt_reformat = NULL; + flow_act->flags |= FLOW_ACT_IGNORE_FLOW_LEVEL; rule = mlx5_add_flow_rules(fdb, spec, flow_act, dest, num_dest); if (IS_ERR(rule)) goto revert_changes;