From patchwork Tue Jul 27 23:20:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 487297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92F1AC4320E for ; Tue, 27 Jul 2021 23:21:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A57E60F59 for ; Tue, 27 Jul 2021 23:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233328AbhG0XVA (ORCPT ); Tue, 27 Jul 2021 19:21:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:34816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbhG0XUy (ORCPT ); Tue, 27 Jul 2021 19:20:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E040260FC2; Tue, 27 Jul 2021 23:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627428054; bh=37/3bzpTa9W95WTyqcx/+wdBlmK7AxMxt7U5RRb+URw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2Svpo8ySPhKeB7VJblMjBNr9wYzvVNYemSd0GvCWFuD3yEf0YWfQzH8SelTwwOpz NAuR1HencsWbq1Yuz6dabTEf+81YmY8VaN+1X3kkIGnCFxzjAjF1ZaYMt9pIbI1z2l 1E97FufvJ4ExnSmo9RK0+DfpA1HNIhckLgoqfrCpvPVZpVD0Jvpiha704JiCirRMw6 rlkpe4KnMX01X+40MGCqRibp+oi3aI/RtTwBYrPMBvIeXwwB8MTHoyWyFu9T1qwA8B JaClvFdl4zrcmvmiPMqLjdPXqYfubvCvJ9gcp1Kl44ljhFs0hb/ygurzu1BwtC+n5X 5QQrFnDyDLUWg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Maor Dickman , Roi Dayan , Saeed Mahameed Subject: [net 03/12] net/mlx5: E-Switch, Set destination vport vhca id only when merged eswitch is supported Date: Tue, 27 Jul 2021 16:20:41 -0700 Message-Id: <20210727232050.606896-4-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210727232050.606896-1-saeed@kernel.org> References: <20210727232050.606896-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maor Dickman Destination vport vhca id is valid flag is set only merged eswitch isn't supported. Change destination vport vhca id value to be set also only when merged eswitch is supported. Fixes: e4ad91f23f10 ("net/mlx5e: Split offloaded eswitch TC rules for port mirroring") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 7579f3402776..b0a2ca9037ac 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -382,10 +382,11 @@ esw_setup_vport_dest(struct mlx5_flow_destination *dest, struct mlx5_flow_act *f { dest[dest_idx].type = MLX5_FLOW_DESTINATION_TYPE_VPORT; dest[dest_idx].vport.num = esw_attr->dests[attr_idx].rep->vport; - dest[dest_idx].vport.vhca_id = - MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id); - if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) + if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) { + dest[dest_idx].vport.vhca_id = + MLX5_CAP_GEN(esw_attr->dests[attr_idx].mdev, vhca_id); dest[dest_idx].vport.flags |= MLX5_FLOW_DEST_VPORT_VHCA_ID; + } if (esw_attr->dests[attr_idx].flags & MLX5_ESW_DEST_ENCAP) { if (pkt_reformat) { flow_act->action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT;