Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658816pxa; Mon, 17 Aug 2020 15:46:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEysxnnAi2GFdBJNDir8+/xOy38EtTOvhqwCCbFd0IKt3SbqTt+UaNW2D8tt+t5EakdISB X-Received: by 2002:a05:6402:2038:: with SMTP id ay24mr17557982edb.200.1597704361220; Mon, 17 Aug 2020 15:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704361; cv=none; d=google.com; s=arc-20160816; b=ufgKHS6hmnH9hjbK08fvhtwVRLqkTUVcHgBnyEbMXMZyeHWYwcMXbVbymbu+Ts84gb uM8vLvXwo5aHMARgBYP+CqTdJnY1AGgC+uMeDndKUkcpGvdr99cB+LO+MpFwzyHWETt2 AhEN8NXhsJubkIUYn5Y2G5noh6Wno5VVGLiThXFrshkmJEtTkAPJATXXWvCM3pycmZjv uwGzoDsnfgAEm+aXyBc4nldKccvLihNDlSy8Ig3olY649V9oVM+/UOqJR+Uip89bbR+s x6ADD5IiUUFS4hB3cXYax7cYrXSBZmcD6qX774Plw8wmF4m+tB4ddlIG0lFpgcJhfi4I IHEA== 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=K/UkV2qeVyljnAUiluQ4tJYXUCPRJ4Eu66KNTjKcVBg=; b=dj7CAm3J064zLUPqwMFgs5bNAm1fqb1jw8jQMQpkeMTYMzev3SsIfa1BaXbU8Ej7zO qMAGuBGtAO+HFS7rP74Bc4gSV6c35K4NxpUqEMw3gUZVkGacQy32BjcdxIexCpfDq3oO BOojdhBc2rAjlQ4B9lW4+v5X8q6zpFUmqDKlT9Bih+yWhczQnI7/KBW198y1NR7dnlNq PMzr0h/fmARXLHmyA4tMOgxTBs6OHWdLXnPbc5/vI5f8feAqNH+GnIqi1UzlLPYU8omO Q/5InTgu5UA4v2a33Sv+pcy4iFktS+Q83c7yfIuQGqlqWM7pOrOHk2sSSQgdpiYNW0/Y 8lGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n9etYjBI; 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=fail (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 h19si11840828edq.302.2020.08.17.15.45.37; Mon, 17 Aug 2020 15:46:01 -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=@kernel.org header.s=default header.b=n9etYjBI; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392461AbgHQTWj (ORCPT + 99 others); Mon, 17 Aug 2020 15:22:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:42560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730251AbgHQPfk (ORCPT ); Mon, 17 Aug 2020 11:35:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 BA73D20789; Mon, 17 Aug 2020 15:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678539; bh=QQAU1ikOIrDs5aF2Kgt4xXf0KPkLOjsnmxxrhoi6nYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9etYjBIEw8ucXM/MCxiBZOYXYeiZ1GRmknFkY1NQQbPng5qyWppWlSjfNrB+xuym VXfw1qV0jWYSbTVtkRuUfSpUx0CpAne2AEYKM2MU7cMl8PyY360cCY9Zv91OkdLtLB 5azV12+KVXw25iLbsAdj2N3757lOOCftpqrbb+6Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Vesker , Maor Gottlieb , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.8 352/464] net/mlx5: DR, Change push vlan action sequence Date: Mon, 17 Aug 2020 17:15:05 +0200 Message-Id: <20200817143850.630208221@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Alex Vesker [ Upstream commit b206490940216542c68563699b279eed3c55107c ] The DR TX state machine supports the following order: modify header, push vlan and encapsulation. Instead fs_dr would pass: push vlan, modify header and encapsulation. The above caused the rule creation to fail on invalid action sequence provided error. Fixes: 6a48faeeca10 ("net/mlx5: Add direct rule fs_cmd implementation") Signed-off-by: Alex Vesker Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- .../mellanox/mlx5/core/steering/fs_dr.c | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c index 8887b2440c7d5..9b08eb557a311 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c @@ -279,29 +279,9 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, /* The order of the actions are must to be keep, only the following * order is supported by SW steering: - * TX: push vlan -> modify header -> encap + * TX: modify header -> push vlan -> encap * RX: decap -> pop vlan -> modify header */ - if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) { - tmp_action = create_action_push_vlan(domain, &fte->action.vlan[0]); - if (!tmp_action) { - err = -ENOMEM; - goto free_actions; - } - fs_dr_actions[fs_dr_num_actions++] = tmp_action; - actions[num_actions++] = tmp_action; - } - - if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2) { - tmp_action = create_action_push_vlan(domain, &fte->action.vlan[1]); - if (!tmp_action) { - err = -ENOMEM; - goto free_actions; - } - fs_dr_actions[fs_dr_num_actions++] = tmp_action; - actions[num_actions++] = tmp_action; - } - if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_DECAP) { enum mlx5dr_action_reformat_type decap_type = DR_ACTION_REFORMAT_TYP_TNL_L2_TO_L2; @@ -354,6 +334,26 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, actions[num_actions++] = fte->action.modify_hdr->action.dr_action; + if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) { + tmp_action = create_action_push_vlan(domain, &fte->action.vlan[0]); + if (!tmp_action) { + err = -ENOMEM; + goto free_actions; + } + fs_dr_actions[fs_dr_num_actions++] = tmp_action; + actions[num_actions++] = tmp_action; + } + + if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2) { + tmp_action = create_action_push_vlan(domain, &fte->action.vlan[1]); + if (!tmp_action) { + err = -ENOMEM; + goto free_actions; + } + fs_dr_actions[fs_dr_num_actions++] = tmp_action; + actions[num_actions++] = tmp_action; + } + if (delay_encap_set) actions[num_actions++] = fte->action.pkt_reformat->action.dr_action; -- 2.25.1