From nobody Thu Dec 19 00:12:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YD9wT6Jq1z5h95h; Thu, 19 Dec 2024 00:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YD9wT5s2kz49sY; Thu, 19 Dec 2024 00:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734567145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ad9nPkSj8qc8WUzK2D8w75yP9t7bvK0NCllkG62B2U4=; b=lDp3iIFSiojVwnyAFuelJfWM+20RjRNzOpwFWhqd6yM2JL6A/vaAgu4niwH8Ibf19/R1BU 34Mc+oL5xgo3p7YM1zEmlZxRCRgqN0oiXpbe0MFchErHpxMYHi/lg4hUWa437y9tUYdYzR ZJRoHZOYsuh96QsKO2FwKJkI3MjTW6gUCtD5/C5aociILBvdscK6Eksr6/PPbwQ5f43xq8 i2YtfI6lssI4a+N5bF5IFhczlCBkl3OwqIt6LYtTjCrZtiiGyM5ME3kb9z35lwGRZR4hAb Xkh2AHQukdm1C4vaeuHnJBeqeAP86zFBnYU9lvQN3q0fq0OoIepsV23RLPoaJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734567145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ad9nPkSj8qc8WUzK2D8w75yP9t7bvK0NCllkG62B2U4=; b=ciU8OpQpf++P00KtIKVeLo2/RY5yA+weIk1ImHYvHzsPlX8hvvnR7LLkU4+fh1Tt5E0xpp dZd7v7gU5bQdHLS+tA1MEWy+U3wQ4Q8m8Wz3r/hnvO4VQ86naHHrMaiqbEA7OodJAIeBGl BE6k9+m8VE49DHeTO7Eqgr0/GUANG0aOXCoBajpQYFhpRN1UD+tZDZVJF4WJxciJLBD5g6 z5P1V+97bla2PVkDlCUiRmFwRpaMvrmQK+o3GVk5GhzXWnTbZsLKq/bbL1aQrHzIbrFZzI xK7y7YitmGXGn/dwZYqfyQjXwmwl1snKQcNsPr6TY2mTCSU6dUbTgOfewN0vjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734567145; a=rsa-sha256; cv=none; b=H1B9qXxnb84802lhGm4k9iOcx8VEeQBCucyO20IGxQnwFRSecXF0djU3CHwXjS+H7tj+a9 +5BTPIc9s8nQtFmiXyuiPAE78VoSQnGCMV1on2u6mYaoL7iK0F8P235LjSyPSIfynbGypf plh0vmONTaY4t1cECU+jlZod87ABTyjf4IjG3h63tu5qVvYjoP7SB5sH/aIsUqUgo4zuiM tTf0UgV2/SLB9HykUtK/nKITfl/NUAPlOZDX1jBwwH+YqSU2cWfATTw+nxguxQx7ERgRnR XG9SkKOiYLguKGPByIDnFtAbFH8LyFtPsrP9J2NCp/0u4X3GSe9P+puqKlUhaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YD9wT5NRSzW40; Thu, 19 Dec 2024 00:12:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BJ0CPoD092977; Thu, 19 Dec 2024 00:12:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BJ0CPnK092974; Thu, 19 Dec 2024 00:12:25 GMT (envelope-from git) Date: Thu, 19 Dec 2024 00:12:25 GMT Message-Id: <202412190012.4BJ0CPnK092974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b762b199afc6 - main - mlx5: Eliminate the use of mlx5_rule_fwd_action List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b762b199afc6ed56ac95ca19c7fc29c2927fa85c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b762b199afc6ed56ac95ca19c7fc29c2927fa85c commit b762b199afc6ed56ac95ca19c7fc29c2927fa85c Author: Slava Shwartsman AuthorDate: 2024-12-12 15:57:58 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-18 23:59:42 +0000 mlx5: Eliminate the use of mlx5_rule_fwd_action Driver defined all flow context actions in MLX5_FLOW_CONTEXT_ACTION_*, no need to duplicate them with mlx5_rule_fwd_action. Sponsored by: NVidia networking MFC after: 1 week --- sys/dev/mlx5/fs.h | 6 ------ sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c | 4 ++-- sys/dev/mlx5/mlx5_core/mlx5_eswitch.c | 6 +++--- sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c | 4 ++-- sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 10 +++++----- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/sys/dev/mlx5/fs.h b/sys/dev/mlx5/fs.h index ee0d28b6758a..6bb05e004479 100644 --- a/sys/dev/mlx5/fs.h +++ b/sys/dev/mlx5/fs.h @@ -69,12 +69,6 @@ enum { MLX5_FS_SNIFFER_FLOW_TAG = 0xFFFFFD, }; -enum mlx5_rule_fwd_action { - MLX5_FLOW_RULE_FWD_ACTION_ALLOW = 0x1, - MLX5_FLOW_RULE_FWD_ACTION_DROP = 0x2, - MLX5_FLOW_RULE_FWD_ACTION_DEST = 0x4, -}; - enum { MLX5_FS_FLOW_TAG_MASK = 0xFFFFFF, }; diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c index 9523dc8d5e95..f7950bf61269 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c @@ -321,9 +321,9 @@ static int ipsec_miss_create(struct mlx5_core_dev *mdev, } if (dest) - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_DEST; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; else - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_DROP; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP; /* Create miss rule */ miss->rule = mlx5_add_flow_rules(ft, NULL, &flow_act, dest, 1); if (IS_ERR(miss->rule)) { diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c index 8c96beeb509f..30f04144502b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c @@ -815,7 +815,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, MLX5_SET_TO_ONES(fte_match_param, spec->match_criteria, outer_headers.cvlan_tag); MLX5_SET_TO_ONES(fte_match_param, spec->match_value, outer_headers.cvlan_tag); - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_DROP; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP; spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; vport->ingress.drop_rule = mlx5_add_flow_rules(vport->ingress.acl, spec, @@ -867,7 +867,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, MLX5_SET(fte_match_param, spec->match_value, outer_headers.first_vid, vport->vlan); spec->match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_ALLOW; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_ALLOW; vport->egress.allowed_vlan = mlx5_add_flow_rules(vport->egress.acl, spec, @@ -879,7 +879,7 @@ static int esw_vport_egress_config(struct mlx5_eswitch *esw, goto out; } - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_DROP; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_DROP; vport->egress.drop_rule = mlx5_add_flow_rules(vport->egress.acl, NULL, &flow_act, NULL, 0); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c index f7ec5af81773..f69c36aa72de 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c @@ -159,7 +159,7 @@ mlx5e_accel_fs_add_inpcb(struct mlx5e_priv *priv, dest.type = MLX5_FLOW_DESTINATION_TYPE_TIR; dest.tir_num = tirn; - flow_act.action = MLX5_FLOW_RULE_FWD_ACTION_DEST; + flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; flow = mlx5_add_flow_rules(ft->t, spec, &flow_act, &dest, 1); out: @@ -175,7 +175,7 @@ accel_fs_tcp_add_default_rule(struct mlx5e_priv *priv, int type) struct mlx5e_accel_fs_tcp *fs_tcp; struct mlx5_flow_handle *rule; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; fs_tcp = &priv->fts.accel_tcp; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index ac275b5b145c..f8be5b9e881c 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -263,7 +263,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, u32 tt_vec; int err = 0; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; u8 *mc; u8 *mv; @@ -474,7 +474,7 @@ mlx5e_add_main_vxlan_rules_sub(struct mlx5e_priv *priv, struct mlx5_flow_table *ft = priv->fts.main_vxlan.t; u32 *tirn = priv->tirn_inner_vxlan; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; int err = 0; u8 *mc; @@ -670,7 +670,7 @@ mlx5e_add_vlan_rule_sub(struct mlx5e_priv *priv, struct mlx5_flow_handle **rule_p; int err = 0; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; u8 *mv; u8 *mc; @@ -1671,7 +1671,7 @@ mlx5e_add_vxlan_rule_sub(struct mlx5e_priv *priv, struct mlx5_flow_spec *spec, struct mlx5_flow_handle **rule_p; int err = 0; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; u8 *mc; u8 *mv; @@ -1808,7 +1808,7 @@ mlx5e_add_vxlan_catchall_rule_sub(struct mlx5e_priv *priv, struct mlx5_flow_handle **rule_p; int err = 0; struct mlx5_flow_act flow_act = { - .action = MLX5_FLOW_RULE_FWD_ACTION_DEST, + .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST, }; spec->flow_context.flow_tag = MLX5_FS_ETH_FLOW_TAG; diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 1b688b70f3dd..5825cee87d9b 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -2213,7 +2213,7 @@ static struct mlx5_ib_flow_handler *create_flow_rule(struct mlx5_ib_dev *dev, } spec->match_criteria_enable = get_match_criteria_enable(spec->match_criteria); - action = dst ? MLX5_FLOW_RULE_FWD_ACTION_DEST : 0; + action = dst ? MLX5_FLOW_CONTEXT_ACTION_FWD_DEST : 0; flow_act.action = action; handler->rule = mlx5_add_flow_rules(ft, spec, &flow_act, dst, 1);