From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD87C14A90 for ; Thu, 22 Jun 2023 05:47:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15CD0C433C9; Thu, 22 Jun 2023 05:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687412877; bh=Gk8y4OKeeQK+QK8EDke/WczfriAFm8OyPteNoasVnJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BW/UicpNB5Xaw4lEWtQOorFBGxRLqV6l/zcWp2arC45CNJdyEXwQElUPE+B3V/Yuq LCDFOMO60LptZAcjdf6y+TVmJBlBL5xkIJsCOSEniWD4p/wvTqYTOOp4TYrf+72+m3 wS+1bv3eRb7DbQrVraNynAkWZ/JDGRgmVHWojjyQPiWim3f8clX7Vg8y8kE3Talwt8 yYQh6kRPF/OpdOqdAh3X4h7971I4rhe38B9WS3kP/VC/HFQtnxUnLxo8K9ZPwGMuvq JrINh/BUSNmmPprhQUbScKFJmPjbX8l7/upTroampAmoPegmluxK2aHxCr74eiz48+ Oxe4n/Mv58Z/g== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Roi Dayan , Shay Drory Subject: [net-next 09/15] net/mlx5e: E-Switch, Pass other_vport flag if vport is not 0 Date: Wed, 21 Jun 2023 22:47:29 -0700 Message-ID: <20230622054735.46790-10-saeed@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622054735.46790-1-saeed@kernel.org> References: <20230622054735.46790-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Roi Dayan When creating flow table for shared fdb resources, there is only need to pass other_vport flag if vport is not 0 or if the port is ECPF in BlueField. Signed-off-by: Roi Dayan Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 9 ++++++--- 1 file changed, 6 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 6f3b7d5eb6a4..ee507b12e908 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -2551,13 +2551,13 @@ static int __esw_set_master_egress_rule(struct mlx5_core_dev *master, return err; } -static int esw_master_egress_create_resources(struct mlx5_flow_namespace *egress_ns, +static int esw_master_egress_create_resources(struct mlx5_eswitch *esw, + struct mlx5_flow_namespace *egress_ns, struct mlx5_vport *vport, size_t count) { int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); struct mlx5_flow_table_attr ft_attr = { .max_fte = count, .prio = 0, .level = 0, - .flags = MLX5_FLOW_TABLE_OTHER_VPORT, }; struct mlx5_flow_table *acl; struct mlx5_flow_group *g; @@ -2572,6 +2572,9 @@ static int esw_master_egress_create_resources(struct mlx5_flow_namespace *egress if (!flow_group_in) return -ENOMEM; + if (vport->vport || mlx5_core_is_ecpf(esw->dev)) + ft_attr.flags = MLX5_FLOW_TABLE_OTHER_VPORT; + acl = mlx5_create_vport_flow_table(egress_ns, &ft_attr, vport->vport); if (IS_ERR(acl)) { err = PTR_ERR(acl); @@ -2642,7 +2645,7 @@ static int esw_set_master_egress_rule(struct mlx5_core_dev *master, if (vport->egress.acl && vport->egress.type != VPORT_EGRESS_ACL_TYPE_SHARED_FDB) return 0; - err = esw_master_egress_create_resources(egress_ns, vport, count); + err = esw_master_egress_create_resources(esw, egress_ns, vport, count); if (err) return err; -- 2.41.0